uploaded on IIS

This commit is contained in:
Stoyan Zlatev
2023-06-01 13:16:14 +02:00
parent 844c81caa3
commit 97856b2cc8
127 changed files with 7 additions and 5906 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,176 +0,0 @@
.scrollable, .scrollable-sm {
overflow-y: auto !important;
overflow-x: hidden !important;
}
.scrollable::-webkit-scrollbar {
width: 1rem;
}
.scrollable::-webkit-scrollbar-track {
background: var(--bs-light);
}
.scrollable::-webkit-scrollbar-thumb {
background: var(--bs-gray-500);
border: .3rem solid var(--bs-light);
border-radius: .5rem;
}
.scrollable::-webkit-scrollbar-thumb:hover {
background: var(--bs-gray-800);
}
.scrollable-sm::-webkit-scrollbar {
width: .8rem;
}
.scrollable-sm::-webkit-scrollbar-track {
background: var(--bs-light);
}
.scrollable-sm::-webkit-scrollbar-thumb {
background: var(--bs-gray-500);
border: .2rem solid var(--bs-light);
border-radius: .4rem;
}
.scrollable-sm::-webkit-scrollbar-thumb:hover {
background: var(--bs-gray-800);
}
.text-smallcaps {
font-variant: small-caps;
}
.white-space-break {
white-space: pre-wrap;
}
.white-space-nowrap {
white-space: nowrap;
}
.dropdown-menu.show:empty {
display: none;
}
.dropdown-item:hover {
cursor: pointer;
}
.print-page {
width: 21cm;
min-height: 29.7cm;
}
.form-control-success:focus {
border-color: rgba(25, 135, 84, .5);
box-shadow: 0 0 0 0.25rem rgba(25, 135, 84, .25);
}
.va-middle {
vertical-align: middle;
}
tr {
position: relative;
}
tr.is_scaned_0::after {
position: absolute;
display: block;
content: '';
width: 100%;
height: 100%;
left: 0;
top: 0;
}
.a-4 {
width: 21cm;
min-height: 29.7cm;
}
table.table table.table {
margin-bottom: 0 !important;
}
table.table table.table tr:first-child {
border-top: 0 !important;
}
table.table table.table tr:last-child {
border-bottom: 0 !important;
}
table.table table.table th:first-child,
table.table table.table td:first-child {
border-left: 0 !important;
}
table.table table.table th:last-child,
table.table table.table td:last-child {
border-right: 0 !important;
}
.text-teal {
color: var(--bs-teal);
}
.btn.btn-link:hover {
text-decoration: underline !important;
}
.bg-whitesmoke {
background-color: whitesmoke !important
}
.bi-bold:before {
font-weight: bolder !important;
}
.table-responsive::-webkit-scrollbar:horizontal {
position: fixed;
bottom: 0;
}
.cursor-pointer:hover {
cursor: pointer !important;
text-decoration: underline !important;
}
label.bi-search:before {
position: relative !important;
left: -.5rem !important;
}
.list-group.list-group-transparent {
--bs-list-group-color: gray;
--bs-list-group-bg: transparent !important;
--bs-list-group-action-color: black !important;
--bs-list-group-action-hover-color: #495057 !important;
--bs-list-group-action-hover-bg: transparent !important;
--bs-list-group-action-active-color: black !important;
--bs-list-group-action-active-bg: transparent !important;
--bs-list-group-active-color: black !important;
--bs-list-group-active-bg: transparent !important;
--bs-list-group-active-border-color: black !important;
}
.list-group-item.active {
border-top-color: var(--bs-list-group-border-color);
}
.bi-small::before {
font-size: 80%;
}
span.td-error {
position: absolute;
bottom: -.5rem;
font-size: 75%;
color: var(--bs-danger);
background-color: white;
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,12 +0,0 @@
(function () {
let href = location.href;
document
.querySelectorAll('.nav-link')
.forEach(x => {
if (href.startsWith(x.href)) {
x.classList.add('active');
} else {
x.classList.remove('active');
}
})
})();
@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 275.27 123.65"><defs><style>.cls-1{fill:#71d54c;}.cls-2{fill:#003895;}.cls-3{fill:#078ab1;}</style></defs><title>sensus_xylem_logo</title><g id="Layer_2" data-name="Layer 2"><g id="Layer_1-2" data-name="Layer 1"><rect class="cls-1" x="47.04" width="37.99" height="7.14"/><rect class="cls-1" x="47.04" y="11.65" width="37.99" height="7.14"/><rect class="cls-1" x="47.04" y="23.29" width="37.99" height="7.14"/><path class="cls-2" d="M124.94,35h-22.3c-7.14,0-9.31,2.08-9.31,8.9v27.5h9.14V42.71h22.64V71.36h9.14V43.86c0-6.82-2.18-8.9-9.31-8.9"/><path class="cls-2" d="M219.87,35V63.61H197.23V35h-9.14v27.5c0,6.82,2.18,8.9,9.31,8.9h22.3c7.14,0,9.31-2.08,9.31-8.9V35Z"/><path class="cls-2" d="M55.38,35c-6.82,0-8.91,2.18-8.91,9.31V62.05c0,7.14,2.08,9.31,8.91,9.31H85V63.61H55v-7H85V49.2H55v-7H85V35Z"/><path class="cls-2" d="M38.4,42.23V35H9.31C2.18,35,0,37,0,43.86v3.89c0,6.82,2.18,8.9,9.31,8.9H30.78v7H0v7.75H29.76c7.1,0,9.38-2.16,9.38-8.9V57.61c0-6.74-2.28-8.9-9.38-8.9H8.3V42.23Z"/><path class="cls-2" d="M179.92,42.23V35H150.83c-7.14,0-9.32,2.08-9.32,8.9v3.89c0,6.82,2.18,8.9,9.32,8.9h21.46v7H141.52v7.75h29.76c7.1,0,9.38-2.16,9.38-8.9V57.61c0-6.74-2.28-8.9-9.38-8.9H149.82V42.23Z"/><path class="cls-2" d="M274.53,42.23V35H245.44c-7.14,0-9.31,2.08-9.31,8.9v3.89c0,6.82,2.17,8.9,9.31,8.9H266.9v7H236.13v7.75h29.75c7.1,0,9.39-2.16,9.39-8.9V57.61c0-6.74-2.28-8.9-9.39-8.9H244.43V42.23Z"/><path class="cls-3" d="M68.21,103.11c0-3-1.66-4.54-4.69-4.54a7.49,7.49,0,0,0-5.23,2.07l-1.42-1.7a9.79,9.79,0,0,1,6.9-2.51c3.8,0,6.84,2.1,6.84,6.38v7.7a23.25,23.25,0,0,0,.3,4h-2.3a19,19,0,0,1-.26-2.86h-.06a7,7,0,0,1-6.38,3.31c-2.67,0-6.1-1.43-6.1-5.33,0-5.42,6-5.9,12.4-5.9Zm-.75,2.55c-4.16,0-9,.46-9,3.8,0,2.51,2.13,3.33,4.13,3.33A5.48,5.48,0,0,0,68.21,107v-1.31Z"/><path class="cls-3" d="M190.39,111.47v3h-2.55V86.07h2.55V99.92h.07a8,8,0,0,1,6.65-3.49c5.49,0,9.09,4.05,9.09,9.23s-3.6,9.24-9.09,9.24a8.08,8.08,0,0,1-6.65-3.43Zm6.47-12.91a7.09,7.09,0,0,0,0,14.16c4.22,0,6.64-3.15,6.64-7.06s-2.41-7.09-6.64-7.09"/><path class="cls-3" d="M209.09,96.87h2.46c.06.95.15,2.25.15,3h.07a6.25,6.25,0,0,1,5.64-3.45,6.58,6.58,0,0,1,1.68.18l-.34,2.4a6.89,6.89,0,0,0-1.8-.22c-2.7,0-5.15,2-5.15,6.65v9h-2.55V100.74c0-.94,0-2.66-.16-3.87"/><path class="cls-3" d="M232.09,103.11c0-3-1.66-4.54-4.69-4.54a7.46,7.46,0,0,0-5.23,2.07l-1.41-1.7a9.74,9.74,0,0,1,6.89-2.51c3.8,0,6.84,2.1,6.84,6.38v7.7a24.22,24.22,0,0,0,.31,4h-2.3a18.26,18.26,0,0,1-.26-2.86h-.07a7.05,7.05,0,0,1-6.39,3.31c-2.66,0-6.07-1.43-6.07-5.33,0-5.42,6-5.9,12.39-5.9Zm-.75,2.55c-4.18,0-9,.46-9,3.8,0,2.51,2.14,3.33,4.13,3.33a5.48,5.48,0,0,0,5.64-5.82v-1.31Z"/><path class="cls-3" d="M241.1,96.87c.06.95.16,2.25.16,3h.07a6.85,6.85,0,0,1,6-3.45c4.47,0,6.68,2.89,6.68,7.25v10.78h-2.55v-9.73c0-3.67-1.08-6.16-4.77-6.16-2.69,0-5.33,2.18-5.33,6.87v9h-2.55V100.74c0-.94,0-2.66-.14-3.87Z"/><path class="cls-3" d="M266,114.9c-5.49,0-9.09-4.06-9.09-9.24s3.59-9.23,9.09-9.23a8,8,0,0,1,6.65,3.49h.07V86.07h2.55v28.39h-2.55v-3h-.07A8.1,8.1,0,0,1,266,114.9m.27-2.18a6.71,6.71,0,0,0,6.75-7.06c0-4-2.81-7.09-6.75-7.09-4.24,0-6.64,3.19-6.64,7.09s2.4,7.06,6.64,7.06"/><path class="cls-3" d="M176.07,111.18v3.28h-1.85c-3.13,0-4.65-1.63-4.65-5.28v-5.72c0-1.79-.56-3.63-2.82-3.63s-3,1.84-3,3.63v11h-4v-11c0-1.79-.78-3.63-3.09-3.63s-3.06,1.84-3.06,3.63v11h-3.92V103.32c0-4.35,2.8-7,7-7a6.78,6.78,0,0,1,5.09,2.06,6.77,6.77,0,0,1,5.08-2.06c3.85,0,6.59,2.48,6.59,7v5.91c0,1.35.62,1.95,1.76,1.95Zm-30.61.47a11.42,11.42,0,0,1-7.74,3.07c-5.88,0-9.35-3.82-9.35-9.22s3.73-9.23,9-9.23c5.48,0,8.82,4.25,8.82,9.53,0,.66-.05,1.33-.05,1.33h-13.7c.51,2.59,2.1,4.22,5.28,4.22a7.37,7.37,0,0,0,5.21-2.17Zm-13-7.63h9.73c-.45-2.66-2.2-4.39-4.78-4.39s-4.39,1.79-5,4.39M120,109c0,3.83,1.58,5.42,4.83,5.42h1.78v-3.37h-.84c-1.2,0-1.87-.59-1.87-2.05V86.95H120Zm-10.95,2H109c-1,0-1.55-1.49-2.54-4.18l-1.64-4.52c-1.54-4.21-3.1-6.11-6.66-6.11-3,0-4.52,1.81-6.38,4.32L90.4,102.4,86,96.56H81.39l6.69,8.77-2.61,3.51c-1.34,1.8-2.16,2.34-3.31,2.34h-.78v3.28h1.67a4.91,4.91,0,0,0,4.41-2.27l2.86-4,4.6,6.29h4.69l-7-9.21,1.74-2.3c1.58-2.11,2.33-3.12,3.67-3.12s2.12,1.31,3.32,4.36l2,5.09c1.15,3,2.26,5.17,4.29,5.17h.26l-1,2.58c-.8,2-1.56,3.28-3.67,3.28h-.92v3.33h1.34c3.13,0,5.36-1.54,6.81-5.59l7.73-21.51H114Z"/></g></g></svg>

Before

Width:  |  Height:  |  Size: 4.2 KiB

@@ -1,5 +0,0 @@
{
"CSD 770951": "Anglian Water",
"CSD 773102": "Yorkshire Water",
"38977_LP": "Stream/Leep"
}
@@ -1,24 +0,0 @@
namespace LaaProductionHost.App_Infrastructure
{
using System.Security.Claims;
using System.Web.Mvc;
public class AllowedRolesAttribute : AuthorizeAttribute
{
public AllowedRolesAttribute(params string[] roles)
=> this.Roles = string.Join(",", roles);
protected override void HandleUnauthorizedRequest(AuthorizationContext filterContext)
{
if (filterContext.HttpContext.User is ClaimsPrincipal claimsPrincipal)
{
filterContext.Controller.TempData["Unauthorized"] = "Dir fehlen berechtigungen.";
filterContext.Result = new RedirectResult("~/");
}
else
{
base.HandleUnauthorizedRequest(filterContext);
}
}
}
}
@@ -1,13 +0,0 @@
namespace LaaProductionHost.App_Infrastructure
{
using System.Configuration;
public class ApplicationSettings
{
public static string APIURL => ConfigurationManager.AppSettings.Get(nameof(APIURL));
public static string ConnectionString => ConfigurationManager.AppSettings.Get(nameof(ConnectionString));
public static int LoginTimeout => int.TryParse(ConfigurationManager.AppSettings.Get(nameof(LoginTimeout)), out int time) ? time : 0;
}
}
@@ -1,47 +0,0 @@
namespace LaaProductionHost.App_Infrastructure
{
using LaaProductionWeb.Services.Interfaces;
using LaaProductionWeb.Services.Models;
using System.Collections.Generic;
using System.Security.Claims;
using System.Web.Mvc;
public class AuthorizationFilter : IAuthorizationFilter
{
public void OnAuthorization(AuthorizationContext filterContext)
{
var httpContext = filterContext.HttpContext;
var userId = httpContext.UserId();
var accountService = ServiceProvider.Current.GetService<IAccountService>();
httpContext.User = new ClaimsPrincipal(new ClaimsIdentity(new Claim[]
{
new Claim(ClaimTypes.Name, string.Empty),
new Claim(ClaimTypes.Role, UserRoles.WEB_Anonymous),
}, nameof(Claim), ClaimTypes.Name, ClaimTypes.Role));
#if DEBUG
var employee = new Employee("DEVELOPER", UserRoles.ALL);
#else
var employee = accountService.FindEmployee(userId);
#endif
var claims = new List<Claim>();
if (employee.IsValid)
{
claims.Add(new Claim(ClaimTypes.NameIdentifier, $"{userId}"));
claims.Add(new Claim(ClaimTypes.Name, employee.Name));
foreach (var permission in employee.Permissions)
{
claims.Add(new Claim(ClaimTypes.Role, permission));
}
httpContext.User = new ClaimsPrincipal(new ClaimsIdentity(claims, nameof(Claim), ClaimTypes.Name, ClaimTypes.Role));
}
httpContext.SetUrlReferer();
}
}
}
@@ -1,37 +0,0 @@
namespace LaaProductionHost.App_Infrastructure
{
using System;
using System.Linq;
using System.Security.Claims;
using System.Security.Principal;
/// <summary>
/// Static class with extension methods that run on controller contexts.
/// </summary>
public static class ControllersExtensions
{
public static TDST Map<TSRC, TDST>(this TSRC model, Func<TSRC, TDST> mapper)
where TDST : class
where TSRC : class
{
if (model is null)
{
return default(TDST);
}
return mapper(model);
}
public static string ClaimName(this IPrincipal principal)
{
if (principal is ClaimsPrincipal claimsPrincipal)
{
return claimsPrincipal
.FindAll(ClaimTypes.Name)
.LastOrDefault()?.Value;
}
return "<unknown>";
}
}
}
@@ -1,12 +0,0 @@
namespace LaaProductionHost.App_Infrastructure
{
using System.Web.Mvc;
public class ExceptionFilter : IExceptionFilter
{
public void OnException(ExceptionContext filterContext)
{
filterContext.Result = new RedirectResult("/");
}
}
}
@@ -1,29 +0,0 @@
namespace LaaProductionHost.App_Infrastructure
{
using Microsoft.Extensions.DependencyInjection;
using System;
public class ServiceProvider
{
private readonly IServiceProvider services;
private ServiceProvider(IServiceProvider services)
=> this.services = services;
public T GetService<T>() where T : class
{
if (this.services.GetService<T>() is T service)
{
return service;
}
return default(T);
}
public static ServiceProvider Current { get; private set; }
internal static void SetServiceProvider(IServiceProvider serviceProvider)
=> Current = new ServiceProvider(serviceProvider);
}
}
@@ -1,14 +0,0 @@
namespace LaaProductionHost.App_Infrastructure
{
using System;
public static class ServiceProviderExtensions
{
public static IServiceProvider RegisterServiceProvider(this IServiceProvider serviceProvider)
{
ServiceProvider.SetServiceProvider(serviceProvider);
return serviceProvider;
}
}
}
@@ -1,127 +0,0 @@
namespace LaaProductionHost.App_Infrastructure
{
using Newtonsoft.Json;
using System;
using System.Net;
using System.Web;
public class SessionUser
{
public SessionUser()
=> this.UserId = -1;
public SessionUser(int userId, DateTime expires)
{
this.UserId = userId;
this.Expires = expires;
}
public int UserId { get; }
public DateTime Expires { get; }
public bool IsExpired => this.Expires < DateTime.Now.AddMinutes(30) || this.Expires > DateTime.Now;
}
public static class SessionUserExtensions
{
public static int UserId(this HttpContextBase httpContext)
{
var cookies = httpContext.Request.Cookies;
var userCookie = cookies.Get(nameof(SessionUser));
var cookieUserId = userCookie?.Value ?? string.Empty;
if (int.TryParse(cookieUserId, out int userId))
{
userCookie.Expires = DateTime.Now.AddSeconds(ApplicationSettings.LoginTimeout);
cookies.Set(userCookie);
return userId;
}
return -1;
}
public static bool SignIn(this HttpContextBase httpContext, int userId)
{
if (userId > 0)
{
httpContext.Response.AppendCookie(new HttpCookie(nameof(SessionUser), $"{userId}")
{
Expires = DateTime.Now.AddSeconds(ApplicationSettings.LoginTimeout)
});
return true;
}
return false;
}
public static void SignOut(this HttpContextBase httpContext)
{
var cookieUserId = httpContext
.Response
.Cookies
.Get(nameof(SessionUser))
?.Value ?? string.Empty;
}
const string DATA = nameof(DATA);
public static void SetUserData(this HttpContextBase httpContext, object data)
{
if (data != null)
{
var userId = httpContext.UserId();
var json = JsonConvert.SerializeObject(data);
var encoded = WebUtility.UrlEncode(json);
var cookie = new HttpCookie($"{DATA}_{userId}")
{
Value = encoded,
Expires = DateTime.Now.AddHours(7)
};
httpContext.Response.Cookies.Set(cookie);
}
}
public static T GetUserData<T>(this HttpContextBase httpContext)
{
var userId = httpContext.UserId();
var cookie = httpContext.Request.Cookies.Get($"{DATA}_{userId}");
if (cookie != null && cookie.Value != null)
{
try
{
var json = WebUtility.UrlDecode(cookie.Value);
return JsonConvert.DeserializeObject<T>(json);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
return default(T);
}
const string URL_REFERER = nameof(URL_REFERER);
public static void SetUrlReferer(this HttpContextBase httpContext)
=> httpContext
.Response
.Cookies
.Add(new HttpCookie(URL_REFERER, $"{httpContext.Request.Url}"));
public static string GetUrlReferer(this HttpContextBase httpContext)
=> httpContext
.Request
.Cookies
.Get(URL_REFERER)
?.Value ?? "/";
}
}
@@ -1,23 +0,0 @@
namespace LaaProductionHost.App_Infrastructure
{
public class UserRoles
{
public const string WEB_Admin = nameof(WEB_Admin);
public const string WEB_Anonymous = nameof(WEB_Anonymous);
public const string WEB_API_Explorer = nameof(WEB_API_Explorer);
public const string WEB_HeReport = nameof(WEB_HeReport);
public const string WEB_PalettenScan = nameof(WEB_PalettenScan);
public const string WEB_ProdApproval = nameof(WEB_ProdApproval);
public const string WEB_PuneProtokoll = nameof(WEB_PuneProtokoll);
public static string[] ALL = new string []
{
WEB_Admin,
WEB_API_Explorer,
WEB_HeReport,
WEB_PalettenScan,
WEB_ProdApproval,
WEB_PuneProtokoll
};
}
}
@@ -1,37 +0,0 @@
namespace LaaProductionHost
{
using System.Web.Optimization;
/// <summary>
/// A class that configures all static assets (.css, .js, fonts, etc.) for the web application.
/// </summary>
public class BundleConfig
{
/// <summary>
/// Registers all configured static assets for the web application.
/// </summary>
/// <param name="bundles"><see cref="BundleCollection"/> - passed by calling this method.</param>
public static void RegisterBundles(BundleCollection bundles)
{
bundles
.Add(new StyleBundle("~/bootstrap_css")
.Include("~/App_Content/css/bootstrap.min.css"));
bundles
.Add(new StyleBundle("~/styles_css")
.Include("~/App_Content/css/styles.css"));
bundles
.Add(new Bundle("~/bootstrap_js")
.Include("~/App_Content/js/bootstrap.bundle.min.js"));
bundles
.Add(new Bundle("~/barcodes_js")
.Include("~/App_Content/js/jsbarcode.all.min.js"));
bundles
.Add(new Bundle("~/scripts_js")
.Include("~/App_Content/js/scripts.js"));
}
}
}
@@ -1,12 +0,0 @@
namespace LaaProductionHost
{
using System.Web.Mvc;
public class FilterConfig
{
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute());
}
}
}
@@ -1,18 +0,0 @@
namespace LaaProductionHost
{
using System.Web.Mvc;
using System.Web.Routing;
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional });
}
}
}
@@ -1,17 +0,0 @@
namespace LaaProductionHost
{
using System.Web.Http;
public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
{
config.MapHttpAttributeRoutes();
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional });
}
}
}
@@ -1,17 +0,0 @@
namespace LaaProductionWeb.Areas.Administration
{
using System.Web.Mvc;
public class AdministrationAreaRegistration : AreaRegistration
{
public override string AreaName => "Administration";
public override void RegisterArea(AreaRegistrationContext context)
{
context.MapRoute(
name: "Administration_WithId",
url: "Administration/{controller}/{action}/{id}",
defaults: new { action = "Index", id = UrlParameter.Optional });
}
}
}
@@ -1,326 +0,0 @@
namespace LaaProductionWeb.Areas.Administration.Controllers
{
using LaaProductionHost.App_Infrastructure;
using LaaProductionWeb.Areas.Administration.Models.Software;
using LaaProductionWeb.Services.Interfaces;
using System;
using System.Linq;
using System.Web.Mvc;
[RouteArea("Administration")]
[Authorize(Roles = UserRoles.WEB_Admin)]
public class SoftwareController : Controller
{
private readonly ISoftwareService softwareService;
public SoftwareController()
=> this.softwareService = ServiceProvider.Current.GetService<ISoftwareService>();
[HttpGet]
public ActionResult Index()
{
var model = new SoftwareModel
{
SoftwareInfo = this.softwareService
.GetSoftwares()
.Select(x => new SoftwareOverviewModel
{
AppId = x.AppId,
Name = x.Name
.Split('.')
.LastOrDefault(),
Versions = x.Versions,
Functions = x.Functions
})
};
return this.View(model);
}
[HttpGet]
public ActionResult SoftwareVersions(short? id)
{
var model = new SoftwareVersionsModel();
if (id.HasValue)
{
var appId = id.Value;
model = this.softwareService
.GetSoftwareOverview(appId)
.Map(x => new SoftwareVersionsModel
{
AppId = x.AppId,
Name = x.Name
.Split('.')
.LastOrDefault(),
Versions = x.Versions,
Functions = x.Functions
});
if (model != null)
{
model.SoftwareVersions = this.softwareService
.GetSoftwareVersions(appId)
.Select(x => new SoftwareVersionModel
{
AppId = x.AppId,
BuildV = x.BuildV,
Description = x.Description,
FullName = x.FullName,
Id = x.Id,
MajorV = x.MajorV,
MinorV = x.MinorV,
ValidTo = x.ValidTo
});
}
}
return this.View(model);
}
[HttpGet]
public ActionResult SoftwareFunctions(short? id)
{
var appId = id ?? 0;
var model = new SoftwareFunctionsModel();
if (appId > 0)
{
model = this.softwareService
.GetSoftwareOverview(appId)
.Map(x => new SoftwareFunctionsModel
{
AppId = x.AppId,
Name = x.Name
.Split('.')
.LastOrDefault(),
Versions = x.Versions,
Functions = x.Functions
}) ?? model;
model.SoftwareFunctions = this.softwareService
.GetSoftwareFunctions(appId)
.Select(x => new SoftwareFunctionModel
{
Id = x.Id,
AppId = x.AppId,
Function = x.Function
});
}
else
{
model.SoftwareFunctions = this.softwareService
.GetAllSoftwareFunctions()
.Select(x => new SoftwareFunctionModel
{
Id = x.Id,
AppId = x.AppId,
Function = x.Function
});
}
model.Users = this.softwareService
.GetUsersWithFunctions()
.Select(x => new UserFunctions
{
Id = x.Id,
FirstName = x.FirstName,
LastName = x.LastName,
Username = x.Username,
FunctionsCount = x.FunctionsCount,
HasPassword = x.HasPassword,
Functions = x.Functions
?.Split(new[] { '-' }, StringSplitOptions.RemoveEmptyEntries)
?.Select(f => int.TryParse(f, out int funcId) ? funcId : 0)
?.Where(f => f > 0)
?? Array.Empty<int>()
});
return this.View(model);
}
[HttpPost]
public ActionResult SoftwareFunctions(FunctionUsersInputModel model)
{
if (this.ModelState.IsValid)
{
this.softwareService.UpdateUsersFunctions(x =>
{
x.FunctionId = model.FunctionId.Value;
x.Users = model.Users;
});
}
return this.Redirect(this.Request.UrlReferrer.ToString());
}
[HttpGet]
public ActionResult SoftwareListGroup()
{
var softwareList = this.softwareService
.GetSoftwares()
.Select(x => new SoftwareOverviewModel
{
AppId = x.AppId,
Name = x.Name
.Split('.')
.LastOrDefault(),
Versions = x.Versions,
Functions = x.Functions
});
return this.PartialView(softwareList);
}
[HttpPost]
public string AddFunction(AddFunctionModel model)
{
var appId = model.AppId.Value;
if (this.ModelState.IsValid)
{
this.softwareService.AddFunction(appId, model.Function);
}
return this.ModelState
.SelectMany(x => x.Value.Errors.Select(e => e.ErrorMessage))
.FirstOrDefault(x => !string.IsNullOrWhiteSpace(x));
}
[HttpPost]
public string EditFunction(EditFunctionModel model)
{
if (this.ModelState.IsValid)
{
if (string.IsNullOrWhiteSpace(model.Function))
{
this.softwareService.DeleteFunction(model.FuncId.Value);
}
else
{
this.softwareService.UpdateFunction(model.FuncId.Value, model.Function);
}
}
return this.ModelState
.SelectMany(x => x.Value.Errors.Select(e => e.ErrorMessage))
.FirstOrDefault(x => !string.IsNullOrWhiteSpace(x));
}
[HttpGet]
public ActionResult Users()
{
var usersModel = this.softwareService
.GetUsers()
.Select(x => new SoftwareUser
{
Id = x.Id,
FirstName = x.FirstName,
LastName = x.LastName,
Username = x.Username,
FunctionsCount = x.FunctionsCount,
HasPassword = x.HasPassword
});
return this.View(usersModel);
}
[HttpPost]
public ActionResult Users(string username)
{
var usersModel = this.softwareService
.GetUsers(username)
.Select(x => new SoftwareUser
{
Id = x.Id,
FirstName = x.FirstName,
LastName = x.LastName,
Username = x.Username,
FunctionsCount = x.FunctionsCount,
HasPassword = x.HasPassword
});
return this.View(usersModel);
}
[HttpGet]
public ActionResult UpdatePWDS()
{
this.softwareService.UpdatePasswordHashes();
return this.RedirectToAction(nameof(Users));
}
[HttpPost]
public bool ResetPWD(short id)
{
this.softwareService.ResetPassword(id);
return true;
}
[HttpGet]
public ActionResult UsersFunctions(int? id, string username)
{
object model;
if (id > 0)
{
model = this.UsersFunctionsModel(id: id.Value, username: $"{id}");
}
else
{
model = this.UsersFunctionsModel(username: username);
}
return this.View(model);
}
[HttpPost]
public ActionResult UsersFunctions(UsersFunctionsInputModel model)
{
if (this.ModelState.IsValid)
{
this.softwareService.UpdateUsersFunctions(x =>
{
x.UserId = model.UserId.Value;
x.Functions = model.Functions;
});
}
return this.Redirect(this.Request.UrlReferrer.ToString());
}
private UsersFunctionsModel UsersFunctionsModel(int id = -1, string username = null)
=> new UsersFunctionsModel
{
Functions = this.softwareService
.GetAllSoftwareFunctions()
.Select(x => new SoftwareFunctionModel
{
AppId = x.AppId,
Function = x.Function,
Id = x.Id,
}),
UsersFunctions = this.softwareService
.GetUsersWithFunctions(id, username)
.Select(x => new UserFunctions
{
Id = x.Id,
FirstName = x.FirstName,
LastName = x.LastName,
Username = x.Username,
FunctionsCount = x.FunctionsCount,
HasPassword = x.HasPassword,
Functions = x.Functions
?.Split(new[] { '-' }, StringSplitOptions.RemoveEmptyEntries)
?.Select(f => int.TryParse(f, out int funcId) ? funcId : 0)
?.Where(f => f > 0)
?? Array.Empty<int>()
})
};
}
}
@@ -1,14 +0,0 @@
namespace LaaProductionWeb.Areas.Administration.Models.Software
{
using System.ComponentModel.DataAnnotations;
public class AddFunctionModel
{
[Required]
public short? AppId { get; set; }
[Required]
[RegularExpression("[a-zA-Z0-9_]+")]
public string Function { get; set; }
}
}
@@ -1,16 +0,0 @@
namespace LaaProductionWeb.Areas.Administration.Models.Software
{
using System.ComponentModel.DataAnnotations;
public class EditFunctionModel
{
[Required]
public short? AppId { get; set; }
[Required]
public int? FuncId { get; set; }
[RegularExpression("[a-zA-Z0-9_]*")]
public string Function { get; set; }
}
}
@@ -1,12 +0,0 @@
namespace LaaProductionWeb.Areas.Administration.Models.Software
{
using System.ComponentModel.DataAnnotations;
public class FunctionUsersInputModel
{
[Required]
public int? FunctionId { get; set; }
public short[] Users { get; set; }
}
}
@@ -1,9 +0,0 @@
namespace LaaProductionWeb.Areas.Administration.Models.Software
{
using System.Collections.Generic;
public class SoftwareEditModel : SoftwareVersionModel
{
public IEnumerable<SoftwareFunctionModel> Functions { get; set; }
}
}
@@ -1,11 +0,0 @@
namespace LaaProductionWeb.Areas.Administration.Models.Software
{
public class SoftwareFunctionModel
{
public int Id { get; set; }
public short AppId { get; set; }
public string Function { get; set; }
}
}
@@ -1,11 +0,0 @@
namespace LaaProductionWeb.Areas.Administration.Models.Software
{
using System.Collections.Generic;
public class SoftwareFunctionsModel : SoftwareOverviewModel
{
public IEnumerable<SoftwareFunctionModel> SoftwareFunctions { get; set; }
public IEnumerable<UserFunctions> Users { get; set; }
}
}
@@ -1,9 +0,0 @@
namespace LaaProductionWeb.Areas.Administration.Models.Software
{
using System.Collections.Generic;
public class SoftwareModel
{
public IEnumerable<SoftwareOverviewModel> SoftwareInfo { get; set; }
}
}
@@ -1,13 +0,0 @@
namespace LaaProductionWeb.Areas.Administration.Models.Software
{
public class SoftwareOverviewModel
{
public short AppId { get; set; }
public string Name { get; set; }
public int Versions { get; set; }
public int Functions { get; set; }
}
}
@@ -1,17 +0,0 @@
namespace LaaProductionWeb.Areas.Administration.Models.Software
{
public class SoftwareUser
{
public short Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string Username { get; set; }
public int FunctionsCount { get; set; }
public bool HasPassword { get; set; }
}
}
@@ -1,29 +0,0 @@
namespace LaaProductionWeb.Areas.Administration.Models.Software
{
using System;
using System.Linq;
public class SoftwareVersionModel
{
public int Id { get; set; }
public short AppId { get; set; }
public string Name
=> this.FullName
?.Split('.')
?.LastOrDefault();
public string FullName { get; set; }
public int MajorV { get; set; }
public int MinorV { get; set; }
public int BuildV { get; set; }
public DateTime ValidTo { get; set; }
public string Description { get; set; }
}
}
@@ -1,9 +0,0 @@
namespace LaaProductionWeb.Areas.Administration.Models.Software
{
using System.Collections.Generic;
public class SoftwareVersionsModel : SoftwareOverviewModel
{
public IEnumerable<SoftwareVersionModel> SoftwareVersions { get; set; }
}
}
@@ -1,9 +0,0 @@
namespace LaaProductionWeb.Areas.Administration.Models.Software
{
using System.Collections.Generic;
public class UserFunctions : SoftwareUser
{
public IEnumerable<int> Functions { get; set; }
}
}
@@ -1,12 +0,0 @@
namespace LaaProductionWeb.Areas.Administration.Models.Software
{
using System.ComponentModel.DataAnnotations;
public class UsersFunctionsInputModel
{
[Required]
public short? UserId { get; set; }
public int[] Functions { get; set; }
}
}
@@ -1,14 +0,0 @@
namespace LaaProductionWeb.Areas.Administration.Models.Software
{
using System;
using System.Collections.Generic;
public class UsersFunctionsModel
{
public IEnumerable<SoftwareFunctionModel> Functions { get; set; }
= Array.Empty<SoftwareFunctionModel>();
public IEnumerable<UserFunctions> UsersFunctions { get; set; }
= Array.Empty<UserFunctions>();
}
}
@@ -1,53 +0,0 @@
@using LaaProductionWeb.App_Infrastructure
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/svg" href="~/favicon.svg">
@Styles.Render("~/bootstrap_css")
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css">
@Styles.Render("~/styles_css")
<title>Laatzen Production Web</title>
</head>
<body class="d-flex flex-column vh-100 overflow-hidden">
@if (this.User.IsInRole(UserRoles.WEB_Admin))
{
<nav class="navbar navbar-expand-lg navbar-dark bg-dark shadow-sm">
<div class="container-fluid">
<button class="navbar-toggler" data-bs-toggle="collapse" data-bs-target="#mainnav" aria-controls="mainnav" aria-expanded="false">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="mainnav">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link text-smallcaps" href="~/Administration/Software">Software</a>
</li>
</ul>
<ul class="navbar-nav ms-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link text-smallcaps" href="~/">Exit</a>
</li>
</ul>
</div>
</div>
</nav>
}
<main class="h-100 scrollable">
@this.RenderBody()
</main>
@Scripts.Render("~/bootstrap_js")
@Scripts.Render("~/barcodes_js")
@Scripts.Render("~/scripts_js")
@this.RenderSection("scripts", required: false)
</body>
</html>
@@ -1,6 +0,0 @@
<div class="list-group list-group-flush list-group-transparent">
<a href="~/Administration/Software" class="list-group-item list-group-item-action bg-light">Software</a>
<a href="~/Administration/Software/SoftwareFunctions" class="list-group-item list-group-item-action bg-light">Software Functions</a>
<a href="~/Administration/Software/UsersFunctions" class="list-group-item list-group-item-action bg-light">Users Functions</a>
<a href="~/Administration/Software/Users" class="list-group-item list-group-item-action bg-light">Users</a>
</div>
@@ -1,40 +0,0 @@
@model LaaProductionWeb.Areas.Administration.Models.Software.SoftwareModel
<div class="container-fluid h-100">
<div class="row h-100">
<div class="col-2 bg-light">
<div class="list-group list-group-flush list-group-transparent">
<a href="~/Administration/Software" class="list-group-item list-group-item-action bg-light active">Software</a>
<a href="~/Administration/Software/SoftwareFunctions" class="list-group-item list-group-item-action bg-light">Software Functions</a>
<a href="~/Administration/Software/UsersFunctions" class="list-group-item list-group-item-action bg-light">Users Functions</a>
<a href="~/Administration/Software/Users" class="list-group-item list-group-item-action bg-light">Users</a>
</div>
</div>
<div class="col-10 p-0">
@if (this.Model.SoftwareInfo != null)
{
<table class="table table-sm table-bordered w-100">
<thead class="table-secondary">
<tr>
<th class="text-nowrap">AppId</th>
<th class="w-100">Name</th>
<th class="text-nowrap">Versions</th>
<th class="text-nowrap">Functions</th>
</tr>
</thead>
<tbody>
@foreach (var item in this.Model.SoftwareInfo)
{
<tr>
<td>@item.AppId</td>
<td class="text-smallcaps">@item.Name</td>
<td><a href="~/Administration/Software/SoftwareVersions/@item.AppId" class="btn btn-sm btn-light border-0 d-block text-start fw-bold">@item.Versions</a></td>
<td><a href="~/Administration/Software/SoftwareFunctions/@item.AppId" class="btn btn-sm btn-light border-0 d-block text-start text-smallcaps fw-bold">@item.Functions</a></td>
</tr>
}
</tbody>
</table>
}
</div>
</div>
</div>
@@ -1,238 +0,0 @@
@model LaaProductionWeb.Areas.Administration.Models.Software.SoftwareFunctionsModel
@{
var softwareSelected = (this.Model?.AppId ?? 0) > 0;
var hasAnyFunctions = this.Model?.SoftwareFunctions?.Any() ?? false;
}
<div class="container-fluid h-100">
<div class="row h-100 overflow-hidden">
<div class="col-2 bg-light h-100">
<div class="list-group list-group-flush list-group-transparent">
<a href="~/Administration/Software" class="list-group-item list-group-item-action bg-light">Software</a>
@if (softwareSelected)
{
<a href="~/Administration/Software/SoftwareFunctions" class="list-group-item list-group-item-action bg-light active">
<i class="bi bi-caret-left-fill bi-small"></i> Software Functions
</a>
<div class="list-group-item list-group-item-action bg-light">
<table class="table table-sm table-borderless w-100 m-0">
<tbody>
<tr>
<td class="text-smallcaps small">AppId</td>
<td class="text-smallcaps small">@this.Model.AppId</td>
</tr>
<tr>
<td class="text-smallcaps small">Name</td>
<td class="text-smallcaps small">@this.Model.Name</td>
</tr>
<tr>
<td class="text-smallcaps small">Versions</td>
<td class="text-smallcaps small">@this.Model.Versions</td>
</tr>
<tr>
<td class="text-smallcaps small">Functions</td>
<td class="text-smallcaps small">@this.Model.Functions</td>
</tr>
</tbody>
</table>
</div>
}
else
{
<a href="~/Administration/Software/SoftwareFunctions" class="list-group-item list-group-item-action bg-light active">
Software Functions
</a>
<div class="list-group-item list-group-item-action bg-light">
@{
this.Html.RenderAction("SoftwareListGroup");
}
</div>
}
<a href="~/Administration/Software/UsersFunctions" class="list-group-item list-group-item-action bg-light">Users Functions</a>
<a href="~/Administration/Software/Users" class="list-group-item list-group-item-action bg-light">Users</a>
</div>
</div>
<div class="col-10 p-0 h-100 scrollable-sm">
<table class="table table-sm table-bordered w-100">
<thead class="table-secondary">
<tr>
<th class="text-nowrap">App Id</th>
<th class="text-nowrap">Function Id</th>
<th class="text-nowrap">Function Name</th>
<th class="text-nowrap">Function Users</th>
</tr>
</thead>
<tbody>
@if (softwareSelected)
{
if (hasAnyFunctions)
{
foreach (var function in this.Model.SoftwareFunctions)
{
<tr>
<td>@function.AppId</td>
<td>@function.Id</td>
<td class="position-relative">
<input id="func_@function.Id"
class="form-control form-control-sm rounded-0 border-0"
data-id="@function.Id"
value="@function.Function"
onchange="javascript:editFunction(this.getAttribute('data-id'), this.value)" />
</td>
<td>
<div class="dropdown btn-group w-100">
<button class="btn btn-light btn-sm border-0 dropdown-toggle w-100 text-start" type="button" data-bs-toggle="dropdown" aria-expanded="false">
Users
</button>
<div class="dropdown-menu w-100">
<form action="~/Administration/Software/SoftwareFunctions" method="post" id="form_@function.Id" class="px-3">
<input type="hidden" name="FunctionId" value="@function.Id" />
<input class="form-control form-control-sm" id="user_serach_@function.Id" />
<div class="scrollable-sm" style="max-height: 500px">
@foreach (var u in this.Model.Users)
{
var id = $"f_{function.Id}_{u.Id}";
<div class="form-check">
<input class="form-check-input"
type="checkbox"
value="@u.Id"
name="Users[]"
@(u.Functions.Contains(function.Id) ? "checked=\"checked\"" : null)>
<label class="form-check-label text-nowrap">@u.FirstName @u.LastName - (@u.Username)</label>
</div>
}
</div>
<button class="btn btn-light btn-sm w-100 border fw-bold" type="submit">Aktualizieren</button>
</form>
</div>
</div>
</td>
</tr>
}
}
<tr>
<td>@this.Model.AppId</td>
<td>#</td>
<td class="position-relative">
<input id="add_func"
class="form-control form-control-sm rounded-0 border-0"
onchange="javascript:addFunction(this.value)" />
</td>
</tr>
}
else if (hasAnyFunctions)
{
foreach (var function in this.Model.SoftwareFunctions)
{
<tr>
<td>@function.AppId</td>
<td>@function.Id</td>
<td>@function.Function</td>
<td>
<div class="dropdown btn-group w-100">
<button class="btn btn-light btn-sm border-0 dropdown-toggle w-100 text-start" type="button" data-bs-toggle="dropdown" aria-expanded="false">
Users
</button>
<div class="dropdown-menu w-100">
<form action="~/Administration/Software/SoftwareFunctions" method="post" id="form_@function.Id" class="px-3">
<input type="hidden" name="FunctionId" value="@function.Id" />
<input class="form-control form-control-sm" id="user_serach_@function.Id" />
<div class="scrollable-sm" style="max-height: 500px">
@foreach (var u in this.Model.Users)
{
var id = $"f_{function.Id}_{u.Id}";
<div class="form-check">
<input class="form-check-input"
type="checkbox"
value="@u.Id"
name="Users[]"
@(u.Functions.Contains(function.Id) ? "checked=\"checked\"" : null)>
<label class="form-check-label text-nowrap">@u.FirstName @u.LastName - (@u.Username)</label>
</div>
}
</div>
<button class="btn btn-light btn-sm w-100 border fw-bold" type="submit">Aktualizieren</button>
</form>
</div>
</div>
</td>
</tr>
}
}
</tbody>
</table>
</div>
</div>
</div>
@section scripts {
<script>
const appId = @Model.AppId;
const fetchOptions = {
credentials: 'same-origin',
mode: 'same-origin',
method: 'POST',
body: '',
headers: { 'Content-Type': 'application/json' }
};
function showError(funcId, text) {
if (text) {
let spanError = document.createElement('span');
spanError.classList.add('td-error');
spanError.classList.add('px-2');
spanError.innerText = text;
let td = document
.getElementById(funcId ? `func_${funcId}` : 'add_func')
.parentElement;
td.append(spanError);
td.classList.add('border');
td.classList.add('border-danger');
} else {
location.reload(true);
}
}
function addFunction(funcName) {
fetchOptions.body = JSON.stringify({ AppId: appId, Function: funcName });
fetch('@this.Url.Content("~/Administration/Software/AddFunction")', fetchOptions)
.then(response => response.text())
.then(text => showError(0, text));
}
function editFunction(funcId, funcName) {
fetchOptions.body = JSON.stringify({ AppId: appId, FuncId: funcId, Function: funcName });
fetch('@this.Url.Content("~/Administration/Software/EditFunction")', fetchOptions)
.then(response => response.text())
.then(text => showError(funcId, text));
}
function filterUsers(e) {
let input = e.target;
let value = input.value.toLowerCase();
let formChecks = input
.nextElementSibling
.querySelectorAll('.form-check');
formChecks.forEach(function (x) {
let innerText = x.lastElementChild.innerText.toLowerCase();
if (innerText.includes(value)) {
x.classList.remove('d-none');
} else {
x.classList.add('d-none');
}
});
}
document
.querySelectorAll('input[id^="user_serach_"]')
.forEach(input => input.oninput = filterUsers);
</script>
}
@@ -1,13 +0,0 @@
@model IEnumerable<LaaProductionWeb.Areas.Administration.Models.Software.SoftwareOverviewModel>
@if (this.Model?.Any() ?? false)
{
<div class="list-group list-group-flush list-group-transparent">
@foreach (var software in this.Model)
{
<a href="~/Administration/Software/SoftwareFunctions/@software.AppId" class="list-group-item list-group-item-action bg-light small d-flex justify-content-between text-dark">
@software.Name <i class="bi bi-caret-right bi-small"></i>
</a>
}
</div>
}
@@ -1,68 +0,0 @@
@model LaaProductionWeb.Areas.Administration.Models.Software.SoftwareVersionsModel
<div class="container-fluid h-100">
<div class="row h-100 overflow-hidden">
<div class="col-2 bg-light h-100">
<div class="list-group list-group-flush list-group-transparent">
<a href="~/Administration/Software" class="list-group-item list-group-item-action bg-light active"><i class="bi bi-caret-left-fill bi-small"></i> Software</a>
<div class="list-group-item list-group-item-action bg-light">
<table class="table table-sm table-borderless w-100 m-0">
<tbody>
<tr>
<td class="text-smallcaps small">AppId</td>
<td class="text-smallcaps small">@this.Model.AppId</td>
</tr>
<tr>
<td class="text-smallcaps small">Name</td>
<td class="text-smallcaps small">@this.Model.Name</td>
</tr>
<tr>
<td class="text-smallcaps small">Versions</td>
<td class="text-smallcaps small">@this.Model.Versions</td>
</tr>
<tr>
<td class="text-smallcaps small"><a href="~/Administration/Software/SoftwareFunctions/@this.Model.AppId">Functions</a></td>
<td class="text-smallcaps small">@this.Model.Functions</td>
</tr>
</tbody>
</table>
</div>
<a href="~/Administration/Software/SoftwareFunctions" class="list-group-item list-group-item-action bg-light">Software Functions</a>
<a href="~/Administration/Software/UsersFunctions" class="list-group-item list-group-item-action bg-light">Users Functions</a>
<a href="~/Administration/Software/Users" class="list-group-item list-group-item-action bg-light">Users</a>
</div>
</div>
<div class="col-10 p-0 h-100 scrollable-sm">
@if (this.Model.SoftwareVersions != null)
{
<table class="table table-sm table-bordered w-100">
<thead class="table-secondary">
<tr>
<th>Id</th>
<th>FullName</th>
<th>Major</th>
<th>Minor</th>
<th>Build</th>
<th>Valid to</th>
<th>Description</th>
</tr>
</thead>
<tbody>
@foreach (var version in this.Model.SoftwareVersions)
{
<tr>
<td>@version.Id</td>
<td>@version.FullName</td>
<td>@version.MajorV</td>
<td>@version.MinorV</td>
<td>@version.BuildV</td>
<td>@version.ValidTo.ToString("yyyy-MM-dd")</td>
<td>@version.Description</td>
</tr>
}
</tbody>
</table>
}
</div>
</div>
</div>
@@ -1,92 +0,0 @@
@model IEnumerable<LaaProductionWeb.Areas.Administration.Models.Software.SoftwareUser>
@using LaaProductionWeb.App_Infrastructure
<div class="container-fluid h-100">
<div class="row h-100 overflow-hidden">
<div class="col-2 bg-light h-100">
<div class="list-group list-group-flush list-group-transparent">
<a href="~/Administration/Software" class="list-group-item list-group-item-action bg-light">Software</a>
<a href="~/Administration/Software/SoftwareFunctions" class="list-group-item list-group-item-action bg-light">Software Functions</a>
<a href="~/Administration/Software/UsersFunctions" class="list-group-item list-group-item-action bg-light">Users Functions</a>
<a href="~/Administration/Software/Users" class="list-group-item list-group-item-action bg-light active">Users</a>
<div class="list-group list-group-flush list-group-transparent">
<form action="~/Administration/Software/Users" method="post" class="list-group-item list-group-item-action bg-light">
<div class="input-group input-group-sm">
<input class="form-control" name="username">
<button class="btn btn-sm btn-dark input-group-text small" type="submit"><i class="bi bi-search"></i></button>
</div>
</form>
@if (this.User.IsInRole(UserRoles.WEB_Admin))
{
<a href="~/Administration/Software/UpdatePWDS" class="list-group-item list-group-item-action bg-light small active border-0 py-0">Update users passwords</a>
}
</div>
</div>
</div>
<div class="col-10 p-0 h-100 scrollable-sm">
<table class="table table-sm table-bordered w-100">
<thead class="table-secondary">
<tr>
<th>Vorname</th>
<th>Name</th>
<th>Benutzername</th>
<th class="w-auto">Funktionenanzahl</th>
<th class="w-auto"></th>
</tr>
</thead>
<tbody>
@if (this.Model != null)
{
foreach (var user in this.Model)
{
<tr>
<td>@user.FirstName</td>
<td>@user.LastName</td>
<td>@user.Username</td>
<td>
<a class="btn btn-sm btn-light border-0 w-100 text-start fw-bold" href="~/Administration/Software/UsersFunctions/@user.Id">
@user.FunctionsCount
</a>
</td>
<td>
@if (user.HasPassword)
{
<a class="btn btn-sm btn-light border-0 w-100 text-start fw-bold" id="pwd_@user.Id">
<i class="bi bi-exclamation-circle"></i> Passwort zurücksetzen
</a>
}
</td>
</tr>
}
}
</tbody>
</table>
</div>
</div>
</div>
@section scripts {
<script>
function resetPassword(e) {
if (e.target.id) {
let id = e.target.id.replace('pwd_', '');
fetch('@this.Url.Content("~/Administration/Software/ResetPWD")', {
credentials: 'same-origin',
mode: 'same-origin',
method: 'POST',
body: JSON.stringify({ id }),
headers: { 'Content-Type': 'application/json' }
})
.then(function (response) {
if (response.ok) {
location.reload(true);
}
});
}
}
document
.querySelectorAll('a[id^="pwd_"]')
.forEach(x => x.onclick = resetPassword);
</script>
}
@@ -1,75 +0,0 @@
@model LaaProductionWeb.Areas.Administration.Models.Software.UsersFunctionsModel
@using System.Linq
<div class="container-fluid h-100">
<div class="row h-100 overflow-hidden">
<div class="col-2 bg-light h-100">
<div class="list-group list-group-flush list-group-transparent">
<a href="~/Administration/Software" class="list-group-item list-group-item-action bg-light">Software</a>
<a href="~/Administration/Software/SoftwareFunctions" class="list-group-item list-group-item-action bg-light">Software Functions</a>
<a href="~/Administration/Software/UsersFunctions" class="list-group-item list-group-item-action bg-light active">Users Functions</a>
<div class="list-group list-group-flush list-group-transparent">
<form action="~/Administration/Software/UsersFunctions" method="get" class="list-group-item list-group-item-action bg-light">
<div class="input-group input-group-sm">
<input class="form-control" name="username">
<button class="btn btn-sm btn-dark input-group-text small" type="submit"><i class="bi bi-search"></i></button>
</div>
</form>
</div>
<a href="~/Administration/Software/Users" class="list-group-item list-group-item-action bg-light">Users</a>
</div>
</div>
<div class="col-10 p-0 h-100 scrollable-sm">
<table class="table table-sm table-bordered w-100">
<thead class="table-secondary">
<tr>
<th>Vorname</th>
<th>Name</th>
<th>Benutzername</th>
<th>Funktionen</th>
</tr>
</thead>
<tbody>
@if (this.Model != null)
{
foreach (var user in this.Model.UsersFunctions)
{
<tr>
<td>@user.FirstName</td>
<td>@user.LastName</td>
<td>@user.Username</td>
<td>
<div class="dropdown btn-group w-100">
<button class="btn btn-light btn-sm border-0 dropdown-toggle w-100 text-start" type="button" data-bs-toggle="dropdown" aria-expanded="false">
@user.FunctionsCount Functionen
</button>
<div class="dropdown-menu w-100">
<form action="~/Administration/Software/UsersFunctions" method="post" id="form_@user.Id" class="p-3">
<input type="hidden" name="UserId" value="@user.Id" />
@foreach (var f in this.Model.Functions)
{
var id = $"f_{user.Id}_{f.Id}";
<div class="form-check">
<input class="form-check-input"
type="checkbox"
value="@f.Id"
name="Functions[]"
id="@id" @(user.Functions.Contains(f.Id) ? "checked=\"checked\"" : null)>
<label class="form-check-label">@f.Function</label>
</div>
}
<button class="btn btn-light btn-sm w-100 border-0 fw-bold" type="submit">Aktualizieren</button>
</form>
</div>
</div>
</td>
</tr>
}
}
</tbody>
</table>
</div>
</div>
</div>
@@ -1,3 +0,0 @@
@{
this.Layout = "~/Areas/Administration/Views/Shared/_Layout.cshtml";
}
@@ -1,19 +0,0 @@
namespace LaaProductionWeb.Controllers
{
using LaaProductionHost.App_Infrastructure;
using LaaProductionWeb.Services.Interfaces;
using System.Web.Mvc;
[AllowedRoles(UserRoles.WEB_Admin)]
public class AdminController : Controller
{
private readonly IAccountService accountService;
public AdminController()
=> this.accountService = ServiceProvider.Current.GetService<IAccountService>();
public ActionResult Index()
=> this.View();
}
}
@@ -1,49 +0,0 @@
namespace LaaProductionWeb.Controllers
{
using LaaProductionHost.App_Infrastructure;
using LaaProductionWeb.Services.Interfaces;
using LaaProductionWeb.Services.Models;
using System;
using System.Web.Mvc;
[AllowedRoles(UserRoles.WEB_ProdApproval)]
public class ApprovalsController : Controller
{
private readonly IApprovalsService approvals;
public ApprovalsController()
=> this.approvals = ServiceProvider.Current.GetService<IApprovalsService>();
[HttpGet]
public ActionResult Add()
=> this.View(new ProductionApproval
{
ApproverName = this.User.ClaimName(),
ApprovalDate = DateTime.Now
});
[HttpPost]
public ActionResult Add(ProductionApproval approval)
{
if (this.ModelState.IsValid)
{
approval.ApprovalDate = DateTime.Now;
approval.ApproverName = this.User.ClaimName();
var addResult = this.approvals.Add(approval);
if (addResult)
{
this.TempData["Success"] = (string)addResult;
return this.RedirectToAction(nameof(this.Add));
}
this.TempData["Error"] = (string)addResult;
}
return this.View(approval);
}
}
}
@@ -1,52 +0,0 @@
namespace LaaProductionHost.Controllers
{
using LaaProductionHost.App_Infrastructure;
using LaaProductionWeb.Services.Interfaces;
using System.Web.Mvc;
[AllowAnonymous]
public class HomeController : Controller
{
private readonly IAccountService accountService;
public HomeController()
=> this.accountService = ServiceProvider.Current.GetService<IAccountService>();
[HttpGet]
public ActionResult Index()
=> this.View();
[HttpPost]
public ActionResult Index(string username, string password)
{
if (string.IsNullOrWhiteSpace(username))
{
this.ModelState.AddModelError(nameof(username), "Benutzername ist erforderlich.");
}
if (string.IsNullOrWhiteSpace(password))
{
this.ModelState.AddModelError(nameof(password), "Kennwort ist erforderlich.");
}
if (this.ModelState.IsValid)
{
var userId = this.accountService.Login(username, password);
if (this.HttpContext.SignIn(userId))
{
return this.Redirect(this.HttpContext.GetUrlReferer());
}
}
return this.View();
}
public ActionResult Logout()
{
this.HttpContext.SignOut();
return this.View(nameof(Index));
}
}
}
@@ -1,127 +0,0 @@
namespace LaaProductionWeb.Controllers
{
using LaaProductionHost.App_Infrastructure;
using LaaProductionWeb.Services.Interfaces;
using LaaProductionWeb.Services.Models;
using System.Web.Mvc;
[AllowedRoles(UserRoles.WEB_PuneProtokoll)]
public class ProtocolController : Controller
{
public const string FilePDF = nameof(FilePDF);
private readonly IProtocolService protocolService;
public ProtocolController()
=> this.protocolService = ServiceProvider.Current.GetService<IProtocolService>();
[HttpGet]
public ActionResult Index(int orderId = 0)
{
var orderClientModel = this.protocolService.FindOrder(orderId);
if (orderClientModel.FileId > 0)
{
return this.RedirectToAction(nameof(Document), orderClientModel);
}
return this.View(orderClientModel);
}
[HttpPost]
public ActionResult Index(OrderClientModel model)
{
if (model.OrderId > 0 && model.ClientId > 0)
{
var files = this.Request.Files;
if (files.Count > 0)
{
var file = files.Get(0);
if (file.ContentType == "application/pdf")
{
if (this.protocolService.OrderCompleted(model.OrderId.Value))
{
model.FileId = this.protocolService.SaveFile(file.InputStream, model.ClientId.Value, model.OrderId.Value);
if (model.FileId > 0)
{
return this.RedirectToAction(nameof(this.Document), model);
}
else
{
this.TempData[FilePDF] = $"Der PDF Datei wurde nicht hochgeladen.";
}
}
else
{
this.TempData[FilePDF] = $"Auftrag enthält nicht bestandene Prüfungen.";
}
}
else
{
this.TempData[FilePDF] = $"Bitte, PDF Datei hochladen.";
}
}
else
{
this.TempData[FilePDF] = "Kein PDF Datei wurde ausgewählt.";
}
}
else
{
this.TempData[FilePDF] = $"Bitte Auftrag auswählen.";
}
return this.View(model);
}
[HttpGet]
public ActionResult Document(OrderClientModel model)
{
model.FileContent = this.protocolService.FileContent(model.FileId);
return this.View(model);
}
[HttpPost]
public ActionResult DeleteFile(int fileId, int orderId)
{
this.protocolService.DeleteFile(fileId);
return this.RedirectToAction(nameof(this.Index), new { orderId });
}
public ActionResult Clients(string search = null)
{
var clientsOrders = this.protocolService.FindOrdersByClient(search);
return this.PartialView(clientsOrders);
}
public ActionResult Orders(int search = 0)
{
var clientsOrders = this.protocolService.FindOrdersById(search);
return this.PartialView(clientsOrders);
}
[HttpGet]
public ActionResult Body(int orderId = 0)
{
var testStatus = this.protocolService.LoadTestStatus(orderId);
return this.PartialView(testStatus);
}
[HttpGet]
public ActionResult Print(int orderId = 0)
{
var orderClientModel = this.protocolService.FindOrder(orderId);
return this.View(orderClientModel);
}
}
}
@@ -1,95 +0,0 @@
namespace LaaProductionWeb.Controllers
{
using LaaProductionHost.App_Infrastructure;
using LaaProductionWeb.Services.Interfaces;
using LaaProductionWeb.Services.Models.Reports;
using System;
using System.Web.Mvc;
[AllowedRoles(UserRoles.WEB_HeReport)]
public class ReportController : Controller
{
private readonly IReportService reportService;
public ReportController()
=> this.reportService = ServiceProvider.Current.GetService<IReportService>();
[HttpGet]
public ActionResult Helium()
{
var model = this.reportService.LoadHeliumPressureReport();
return this.View(model);
}
[HttpPost]
public ActionResult Helium(HeliumReportModel model)
{
model = this.reportService.LoadHeliumPressureReport(model);
return this.View(model);
}
[HttpPost]
public ActionResult HeliumCSV(HeliumReportModel model)
{
var csvReport = this.reportService.LoadHeliumPressureReportAsCSV(model);
var fileName = $"HeReport_{DateTime.Now:yyyyMMddhhmmss}.csv";
this.Response.AddHeader("Content-Disposition", $"attachment;filename={fileName}");
return this.File(csvReport, "application/csv");
}
public ActionResult HeliumResults(int testId = 0)
{
var results = this.reportService.LoadHeliumPressureResults(testId);
return this.PartialView(results);
}
[HttpGet]
public ActionResult Kottmann()
{
var model = this.reportService.LoadKottmannPressureReport();
return this.View(model);
}
[HttpPost]
public ActionResult Kottmann(KottmannReportModel model)
{
model = this.reportService.LoadKottmannPressureReport(model);
return this.View(model);
}
[HttpPost]
public ActionResult KottmannCSV(KottmannReportModel model)
{
var csvReport = this.reportService.LoadKottmannPressureReportAsCSV(model);
var fileName = $"KottmannReport_{DateTime.Now:yyyyMMddhhmmss}.csv";
this.Response.AddHeader("Content-Disposition", $"attachment;filename={fileName}");
return this.File(csvReport, "application/csv");
}
[HttpGet]
public ActionResult CordonelPressureSensor()
{
var model = this.reportService.LoadCordonelPressureSensorReport();
return this.View(model);
}
[HttpPost]
public ActionResult CordonelPressureSensor(CordonelPressureSensorModel model)
{
model = this.reportService.LoadCordonelPressureSensorReport(model);
return this.View(model);
}
}
}
@@ -1,94 +0,0 @@
namespace LaaProductionWeb.Controllers
{
using LaaProductionHost.App_Infrastructure;
using LaaProductionWeb.Services.Interfaces;
using LaaProductionWeb.Services.Models.Search;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using System.Web.Mvc;
public class SearchController : Controller
{
private readonly IOrdersService ordersService;
private readonly IHttpService httpService;
public SearchController()
{
this.ordersService = ServiceProvider.Current.GetService<IOrdersService>();
this.httpService = ServiceProvider.Current.GetService<IHttpService>();
}
[HttpGet]
public ActionResult Orders(string search)
{
var model = this.ordersService.FindOrders(search);
return this.PartialView(model);
}
[HttpGet]
public ActionResult Production(string productionNr)
{
var model = this.ordersService.FindProductionOrders(productionNr);
return this.PartialView(model);
}
[HttpGet]
public ActionResult Positions(string orderNr)
{
var model = this.ordersService.FindPositions(orderNr);
return this.PartialView(model);
}
[HttpGet]
public async Task<ActionResult> Wildcard()
{
var httpOptions = await this.httpService.OptionsAsync("/Search/Wildcard");
var model = new SearchWildcardModel();
if (httpOptions.Succeeded)
{
model.Fields = httpOptions
.Deserialize<List<string>>()
.ToDictionary(x => x, x => false);
}
return this.View(model);
}
[HttpPost]
[AllowedRoles(UserRoles.WEB_API_Explorer)]
public async Task<ActionResult> Wildcard(SearchWildcardModel model)
{
var fields = string.Empty;
if (model.Fields.Any(x => x.Value))
{
fields = WebUtility.UrlEncode(string.Join(",", model.Fields.Where(x => x.Value).Select(x => x.Key)));
}
var httpResult = await this.httpService.GetAsync($"/Search/Wildcard?token={model.Token}&fields={fields}");
if (httpResult.Succeeded)
{
model.Results = httpResult.Deserialize<List<Dictionary<string, object>>>();
}
else
{
var errors = httpResult.Deserialize<Dictionary<string, string>>();
foreach (var errorKVP in errors)
{
this.ModelState.AddModelError(errorKVP.Key, errorKVP.Value.Replace("Token", "'Search text'"));
}
}
return this.View(model);
}
}
}
@@ -1,173 +0,0 @@
namespace LaaProductionWeb.Controllers
{
using LaaProductionHost.App_Infrastructure;
using LaaProductionWeb.Services.Interfaces;
using LaaProductionWeb.Services.Models;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Net;
using System.Threading.Tasks;
using System.Web.Mvc;
using SystemFile = System.IO.File;
[AllowedRoles(UserRoles.WEB_PalettenScan)]
public class ShipmentsController : Controller
{
private readonly IShipmentsService shipmentsService;
private readonly IHttpService httpService;
public ShipmentsController()
{
this.shipmentsService = ServiceProvider.Current.GetService<IShipmentsService>();
this.httpService = ServiceProvider.Current.GetService<IHttpService>();
}
[HttpGet]
public ActionResult Index()
{
var shipmentModel = new ShipmentModel();
var orderScanModel = this.HttpContext.GetUserData<OrderScanModel>();
if (orderScanModel != null)
{
shipmentModel = new ShipmentModel(orderScanModel);
}
return this.View(shipmentModel);
}
[HttpPost]
public ActionResult Index(ShipmentModel model)
{
this.HttpContext.SetUserData(model.OrderScanModel);
return this.View(model);
}
[HttpGet]
public ActionResult Pallet(OrderScanModel model)
{
this.HttpContext.SetUserData(model);
return this.View(nameof(this.Index), new ShipmentModel(model));
}
public ActionResult Batch(OrderScanModel model)
{
var batchModel = this.shipmentsService.LoadBatchModel(model);
this.UpdateClientName(batchModel);
return this.PartialView(batchModel);
}
public ActionResult Scan(OrderScanModel model)
{
model = this.shipmentsService.LoadPallets(model);
return this.PartialView(model);
}
[HttpPost]
public async Task<ActionResult> ScanPost(OrderScanModel model)
{
if (this.ModelState.IsValid)
{
model.Host = this.HttpContext.Request.UserHostAddress;
model.Place = this.HttpContext.Request.UserHostName;
model.SerialNr = model.SerialNr?.Replace(" ", string.Empty);
var result = this.shipmentsService.UpdateBatchModel(model);
if (result)
{
await this.httpService.GetAsync($"/Shipment/Scanned/Serial/{WebUtility.UrlEncode(model.SerialNr)}");
model.SerialNr = default(string);
this.HttpContext.SetUserData(model);
}
else
{
this.TempData[nameof(model.SerialNr)] = result;
}
}
else if (this.TempData[nameof(model.PositionNr)] is int p && p != model.PositionNr)
{
this.TempData[nameof(model.PositionNr)] = model.PositionNr;
return this.Pallet(model);
}
this.TempData[nameof(model.PositionNr)] = model.PositionNr;
return this.View(nameof(this.Index), new ShipmentModel(model));
}
[HttpGet]
public ActionResult Delete(int id)
{
var orderScanModel = this.shipmentsService.DeletePalletEntry(id);
return this.View(nameof(this.Index), new ShipmentModel(orderScanModel));
}
[HttpGet]
public ActionResult Missing()
{
var model = this.shipmentsService.MissingItems();
return this.View(model);
}
[HttpGet]
public ActionResult Print(OrderScanModel model)
{
var batchModel = this.shipmentsService.LoadBatchModel(model);
var batchPrintModel = new BatchPrintModel(batchModel);
return this.View(batchPrintModel);
}
[HttpGet]
public ActionResult Download(OrderScanModel model)
{
var batchBuffer = this.shipmentsService.LoadBatchBuffer(model);
var fileName = $"{model.OrderNr}_{model.PositionNr}_{model.PalletsCount}.csv";
this.Response.AddHeader("Content-Disposition", $"attachment;filename={fileName}");
return this.File(batchBuffer, "application/vnd.ms-excel");
}
private void UpdateClientName(PalletsBatchModel batchModel)
{
try
{
var path = this.Server.MapPath("~/App_Data/client_map.json");
var jsonContent = SystemFile.ReadAllText(path);
var clientMap = JsonConvert.DeserializeObject<IDictionary<string, string>>(jsonContent);
var additionalText = batchModel.AdditionalText ?? string.Empty;
foreach (var kvp in clientMap)
{
if (additionalText.Contains(kvp.Key))
{
batchModel.Customer = kvp.Value;
break;
}
}
}
catch (Exception e)
{
Debug.WriteLine(e);
}
}
}
}
@@ -1,35 +0,0 @@
namespace LaaProductionHost.Controllers
{
using System.Web.Http;
using System.Web.Http.Results;
public class ValuesController : ApiController
{
// GET api/values
public JsonResult<string[]> Get()
{
return this.Json(new string[] { "value1", "value2" });
}
// GET api/values/5
public string Get(int id)
{
return "value";
}
// POST api/values
public void Post([FromBody]string value)
{
}
// PUT api/values/5
public void Put(int id, [FromBody]string value)
{
}
// DELETE api/values/5
public void Delete(int id)
{
}
}
}
@@ -1 +0,0 @@
<%@ Application Codebehind="Global.asax.cs" Inherits="LaaProductionHost.WebApiApplication" Language="C#" %>
@@ -1,20 +0,0 @@
namespace LaaProductionHost
{
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
public class WebApiApplication : HttpApplication
{
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
GlobalConfiguration.Configure(WebApiConfig.Register);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
}
}
}
@@ -1,282 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>
</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{A501F63D-1F2B-4A14-AE53-859DF99AFD71}</ProjectGuid>
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>LaaProductionHost</RootNamespace>
<AssemblyName>LaaProductionHost</AssemblyName>
<TargetFrameworkVersion>v4.8.1</TargetFrameworkVersion>
<MvcBuildViews>false</MvcBuildViews>
<UseIISExpress>true</UseIISExpress>
<Use64BitIISExpress />
<IISExpressSSLPort />
<IISExpressAnonymousAuthentication />
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
<UseGlobalApplicationHostFile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.7.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.4.1.0\lib\net472\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.7.0.0\lib\net462\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Web.Infrastructure, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Web.Infrastructure.2.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http.Formatting, Version=5.2.9.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.2.9\lib\net45\System.Net.Http.Formatting.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.Web.DynamicData" />
<Reference Include="System.Web.Entity" />
<Reference Include="System.Web.ApplicationServices" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Web.Helpers, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.9\lib\net45\System.Web.Helpers.dll</HintPath>
</Reference>
<Reference Include="System.Web.Http, Version=5.2.9.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Core.5.2.9\lib\net45\System.Web.Http.dll</HintPath>
</Reference>
<Reference Include="System.Web.Http.WebHost, Version=5.2.9.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.9\lib\net45\System.Web.Http.WebHost.dll</HintPath>
</Reference>
<Reference Include="System.Web.Mvc, Version=5.2.9.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.Mvc.5.2.9\lib\net45\System.Web.Mvc.dll</HintPath>
</Reference>
<Reference Include="System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.Razor.3.2.9\lib\net45\System.Web.Razor.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.9\lib\net45\System.Web.WebPages.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages.Deployment, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.9\lib\net45\System.Web.WebPages.Deployment.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.9\lib\net45\System.Web.WebPages.Razor.dll</HintPath>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Web.Abstractions" />
<Reference Include="System.Web.Routing" />
<Reference Include="System.Xml" />
<Reference Include="System.Configuration" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Net.Http">
</Reference>
<Reference Include="System.Net.Http.WebRequest">
</Reference>
<Reference Include="System.Web.Optimization">
<HintPath>..\packages\Microsoft.AspNet.Web.Optimization.1.1.3\lib\net40\System.Web.Optimization.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="WebGrease">
<Private>True</Private>
<HintPath>..\packages\WebGrease.1.6.0\lib\WebGrease.dll</HintPath>
</Reference>
<Reference Include="Antlr3.Runtime">
<Private>True</Private>
<HintPath>..\packages\Antlr.3.5.0.2\lib\Antlr3.Runtime.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="App_Infrastructure\AllowedRolesAttribute.cs" />
<Compile Include="App_Infrastructure\ApplicationSettings.cs" />
<Compile Include="App_Infrastructure\AuthorizationFilter.cs" />
<Compile Include="App_Infrastructure\ControllersExtensions.cs" />
<Compile Include="App_Infrastructure\ExceptionFilter.cs" />
<Compile Include="App_Infrastructure\ServiceProvider.cs" />
<Compile Include="App_Infrastructure\ServiceProviderExtensions.cs" />
<Compile Include="App_Infrastructure\SessionUser.cs" />
<Compile Include="App_Infrastructure\UserRoles.cs" />
<Compile Include="App_Start\BundleConfig.cs" />
<Compile Include="App_Start\FilterConfig.cs" />
<Compile Include="App_Start\RouteConfig.cs" />
<Compile Include="App_Start\WebApiConfig.cs" />
<Compile Include="Areas\Administration\AdministrationAreaRegistration.cs" />
<Compile Include="Areas\Administration\Controllers\SoftwareController.cs" />
<Compile Include="Areas\Administration\Models\Software\AddFunctionModel.cs" />
<Compile Include="Areas\Administration\Models\Software\EditFunctionModel.cs" />
<Compile Include="Areas\Administration\Models\Software\FunctionUsersInputModel.cs" />
<Compile Include="Areas\Administration\Models\Software\SoftwareEditModel.cs" />
<Compile Include="Areas\Administration\Models\Software\SoftwareFunctionModel.cs" />
<Compile Include="Areas\Administration\Models\Software\SoftwareFunctionsModel.cs" />
<Compile Include="Areas\Administration\Models\Software\SoftwareModel.cs" />
<Compile Include="Areas\Administration\Models\Software\SoftwareOverviewModel.cs" />
<Compile Include="Areas\Administration\Models\Software\SoftwareUser.cs" />
<Compile Include="Areas\Administration\Models\Software\SoftwareVersionModel.cs" />
<Compile Include="Areas\Administration\Models\Software\SoftwareVersionsModel.cs" />
<Compile Include="Areas\Administration\Models\Software\UserFunctions.cs" />
<Compile Include="Areas\Administration\Models\Software\UsersFunctionsInputModel.cs" />
<Compile Include="Areas\Administration\Models\Software\UsersFunctionsModel.cs" />
<Compile Include="Controllers\AdminController.cs" />
<Compile Include="Controllers\ApprovalsController.cs" />
<Compile Include="Controllers\HomeController.cs" />
<Compile Include="Controllers\ProtocolController.cs" />
<Compile Include="Controllers\ReportController.cs" />
<Compile Include="Controllers\SearchController.cs" />
<Compile Include="Controllers\ShipmentsController.cs" />
<Compile Include="Controllers\ValuesController.cs" />
<Compile Include="Global.asax.cs">
<DependentUpon>Global.asax</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="App_Content\css\bootstrap.min.css" />
<Content Include="App_Content\css\styles.css" />
<Content Include="App_Content\font\bootstrap-icons.min.css" />
<Content Include="App_Content\js\bootstrap.bundle.min.js" />
<Content Include="App_Content\js\jsbarcode.all.min.js" />
<Content Include="App_Content\js\scripts.js" />
<Content Include="App_Content\svg\sensus_xylem_logo.svg" />
<Content Include="favicon.ico" />
<Content Include="favicon.svg" />
<Content Include="Global.asax" />
<Content Include="Web.config" />
<Content Include="Views\Web.config" />
<Content Include="Views\_ViewStart.cshtml" />
<Content Include="Views\Home\Index.cshtml" />
<Content Include="Views\Shared\Error.cshtml" />
<Content Include="Views\Shared\_Layout.cshtml" />
</ItemGroup>
<ItemGroup>
<Folder Include="Models\" />
</ItemGroup>
<ItemGroup>
<Content Include="App_Content\css\bootstrap.min.css.map" />
<Content Include="App_Content\font\fonts\bootstrap-icons.woff" />
<Content Include="App_Content\font\fonts\bootstrap-icons.woff2" />
<Content Include="App_Data\client_map.json" />
<Content Include="Areas\Administration\Views\_ViewStart.cshtml" />
<Content Include="Areas\Administration\Views\Shared\_Layout.cshtml" />
<Content Include="Areas\Administration\Views\Shared\_SoftwareSidebar.cshtml" />
<Content Include="Areas\Administration\Views\Software\Index.cshtml" />
<Content Include="Areas\Administration\Views\Software\SoftwareFunctions.cshtml" />
<Content Include="Areas\Administration\Views\Software\SoftwareListGroup.cshtml" />
<Content Include="Areas\Administration\Views\Software\SoftwareVersions.cshtml" />
<Content Include="Areas\Administration\Views\Software\Users.cshtml" />
<Content Include="Areas\Administration\Views\Software\UsersFunctions.cshtml" />
<Content Include="Areas\Administration\Views\web.config" />
<None Include="packages.config" />
<Content Include="Views\Admin\Index.cshtml" />
<Content Include="Views\Approvals\Add.cshtml" />
<Content Include="Views\Protocol\Body.cshtml" />
<Content Include="Views\Protocol\Clients.cshtml" />
<Content Include="Views\Protocol\Document.cshtml" />
<Content Include="Views\Protocol\Index.cshtml" />
<Content Include="Views\Protocol\Orders.cshtml" />
<Content Include="Views\Protocol\Print.cshtml" />
<Content Include="Views\Report\CordonelPressureSensor.cshtml" />
<Content Include="Views\Report\DateFilter.cshtml" />
<Content Include="Views\Report\Filter.cshtml" />
<Content Include="Views\Report\Helium.cshtml" />
<Content Include="Views\Report\HeliumResults.cshtml" />
<Content Include="Views\Report\HiddenFilter.cshtml" />
<Content Include="Views\Report\Kottmann.cshtml" />
<Content Include="Views\Search\Orders.cshtml" />
<Content Include="Views\Search\Positions.cshtml" />
<Content Include="Views\Search\Production.cshtml" />
<Content Include="Views\Search\Wildcard.cshtml" />
<Content Include="Views\Shared\_PrintLayout.cshtml" />
<Content Include="Views\Shipments\Batch.cshtml" />
<Content Include="Views\Shipments\Index.cshtml" />
<Content Include="Views\Shipments\Missing.cshtml" />
<Content Include="Views\Shipments\Print.cshtml" />
<Content Include="Views\Shipments\Scan.cshtml" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LaaProductionWeb.Services\LaaProductionWeb.Services.csproj">
<Project>{FF167011-431A-41A7-A7DB-560E08860388}</Project>
<Name>LaaProductionWeb.Services</Name>
</ProjectReference>
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
<Target Name="MvcBuildViews" AfterTargets="AfterBuild" Condition="'$(MvcBuildViews)'=='true'">
<AspNetCompiler VirtualPath="temp" PhysicalPath="$(WebProjectOutputDir)" />
</Target>
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<UseIIS>True</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>55230</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost:55230/</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>
</CustomServerUrl>
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
<Import Project="..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.4.1.0\build\net472\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.targets" Condition="Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.4.1.0\build\net472\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.4.1.0\build\net472\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.4.1.0\build\net472\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.targets'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target> -->
</Project>
@@ -1,35 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("aspnet")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("aspnet")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("1ee99268-be94-400f-a16f-8d5b44654c97")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
@@ -1,3 +0,0 @@
<h2 class="mt-5">Hallo admin</h2>
@@ -1,170 +0,0 @@
@model LaaProductionWeb.Services.Models.ProductionApproval
<form action="~/Approvals/Add" method="post" autocomplete="off">
<div class="container my-3">
<div class="row">
<div class="col">
<h4>Neue Genehmigung erstellen</h4>
<hr />
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-floating dropdown mb-3">
@this.Html.TextBoxFor(x => x.OrderNr, new { @class = "form-control", placeholder = "0" })
@this.Html.LabelFor(x => x.OrderNr, labelText: "FertigungsNr")
<ul class="dropdown-menu w-100 shadow-sm mt-2" id="fertigungNrMenu" style="max-height: 500px; overflow-y: auto;"></ul>
</div>
</div>
<div class="col-md-6">
<div class="form-floating mb-3">
@this.Html.TextBoxFor(x => x.PcbId, new { @class = "form-control", placeholder = "0" })
@this.Html.LabelFor(x => x.PcbId, labelText: "PcbId")
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-floating mb-3">
@this.Html.TextBoxFor(x => x.OverrideFwCheck, new { @class = "form-control", placeholder = "0" })
@this.Html.LabelFor(x => x.OverrideFwCheck, labelText: "OverrideFwCheck")
</div>
</div>
<div class="col-md-6">
<div class="form-floating mb-3">
@this.Html.TextBoxFor(x => x.OverrideLutCheck, new { @class = "form-control", placeholder = "0" })
@this.Html.LabelFor(x => x.OverrideLutCheck, labelText: "OverrideLutCheck")
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-floating mb-3">
@this.Html.TextBoxFor(x => x.RequiredLifeTimeYearsAssembly, new { @class = "form-control", placeholder = "0" })
@this.Html.LabelFor(x => x.RequiredLifeTimeYearsAssembly, labelText: "RequiredLifeTimeYearsAssembly")
</div>
</div>
<div class="col-md-6">
<div class="form-floating mb-3">
@this.Html.TextBoxFor(x => x.RequiredLifeTimeYearsShipping, new { @class = "form-control", placeholder = "0" })
@this.Html.LabelFor(x => x.RequiredLifeTimeYearsShipping, labelText: "RequiredLifeTimeYearsShipping")
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-check form-switch pt-3">
@this.Html.CheckBoxFor(x => x.SkipRadioCheck, new { @class = "form-check-input", type = "checkbox", role = "switch", @checked = (this.Model.SkipRadioCheck ? "checked" : null) })
@this.Html.LabelFor(x => x.SkipRadioCheck, labelText: "Überprüfung der Funkparameter überspringen", htmlAttributes: new { @class = "form-check-label" })
</div>
</div>
<div class="col-md-6">
<div class="form-floating mb-3">
@this.Html.TextBoxFor(x => x.KitronProductionDate, new { @class = "form-control", placeholder = "0", type = "date" })
@this.Html.LabelFor(x => x.KitronProductionDate, labelText: "KitronProductionDate")
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-floating mb-3">
@this.Html.TextBoxFor(x => x.MaxDrainedBatteryLoadPercent, new { @class = "form-control", placeholder = "0" })
@this.Html.LabelFor(x => x.RequiredLifeTimeYearsShipping, labelText: "MaxDrainedBatteryLoadPercent")
</div>
</div>
<div class="col-md-6">
<div class="form-floating mb-3">
@this.Html.TextBoxFor(x => x.MaxStorageMonths, new { @class = "form-control", placeholder = "0" })
@this.Html.LabelFor(x => x.RequiredLifeTimeYearsShipping, labelText: "MaxStorageMonths")
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-floating mb-3">
@this.Html.TextBoxFor(x => x.ApproverName, new { @class = "form-control bg-light border-light", placeholder = "0", @readonly = "readonly" })
@this.Html.LabelFor(x => x.ApproverName, labelText: "Name des Genehmigers")
</div>
</div>
<div class="col-md-6">
<div class="form-floating mb-3">
@this.Html.TextBoxFor(x => x.ApprovalDate, new { @class = "form-control bg-light border-light", placeholder = "0", @readonly = "readonly" })
@this.Html.LabelFor(x => x.ApprovalDate, labelText: "Datum der Genehmigung")
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="form-floating mb-3">
@this.Html.TextAreaFor(x => x.ApprovalComment, new { @class = "form-control", placeholder = "0", style = "height: 210px" })
@this.Html.LabelFor(x => x.ApprovalComment, labelText: "Genehmigungskommentar")
@this.Html.ValidationMessageFor(x => x.ApprovalComment, string.Empty, new { @class = "small text-danger" })
</div>
</div>
</div>
<div class="row">
<div class="col d-flex">
<input type="submit" class="btn btn-primary py-3 px-5 me-3" value="Neue Genehmigung erstellen" />
@if (this.TempData.TryGetValue("Success", out object message))
{
<div class="toast fade show position-relative align-items-center text-bg-success border-0 ms-auto w-100" role="alert" aria-live="assertive" aria-atomic="true">
<div class="toast-header">
<i class="bi-bold bi-check text-success me-2 fs-4"></i>
<strong class="me-auto text-success">@message</strong>
<small class="text-nowrap">Just now</small>
<button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
</div>
</div>
}
else if (this.TempData.TryGetValue("Error", out object error))
{
<div class="toast fade show position-relative align-items-center text-bg-danger border-0 ms-auto w-100" role="alert" aria-live="assertive" aria-atomic="true">
<div class="toast-header">
<i class="bi-bold bi-x text-danger me-2 fs-4"></i>
<strong class="me-auto text-danger">@error</strong>
<small class="text-nowrap">Just now</small>
<button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
</div>
</div>
}
</div>
</div>
</div>
</form>
@section scripts {
<script>
(function () {
let fertigungNrMenu = document.getElementById('fertigungNrMenu');
let orderNrInput = document.getElementById('OrderNr');
if (fertigungNrMenu && orderNrInput) {
function loadDropdownItems(html) {
fertigungNrMenu.innerHTML = html;
let items = fertigungNrMenu.querySelectorAll('.dropdown-item');
if (items && items.length == 1) {
orderNrInput.value = items.item(0).innerHTML;
fertigungNrMenu.classList.remove('show');
}
}
orderNrInput.onfocus = () => fertigungNrMenu.classList.add('show');
orderNrInput.oninput = (e) => {
let value = e.target.value;
if (value && value.length > 2) {
fetch(`@this.Url.Action("Production", "Search")?productionNr=${orderNrInput.value}`)
.then(response => response.text())
.then(html => loadDropdownItems(html))
.catch(error => console.log(error));
fertigungNrMenu.classList.add('show');
} else {
fertigungNrMenu.innerHTML = null;
fertigungNrMenu.classList.remove('show');
}
};
window.addEventListener('hashchange', function () {
orderNrInput.value = location.hash.substring(1);
fertigungNrMenu.classList.remove('show');
});
}
})();
</script>
}
@@ -1,58 +0,0 @@
@using LaaProductionWeb.App_Infrastructure
<div class="container my-5 py-5">
<div class="row">
<div class="col-12">
<div class="jumbotron">
<h1>ASP.NET</h1>
<p class="lead">ASP.NET is a free web framework for building great Web sites and Web applications using HTML, CSS and JavaScript.</p>
<p><a class="btn btn-primary btn-lg">Learn more &raquo;</a></p>
</div>
<div class="row">
<div class="col-md-4">
<h2>Getting started</h2>
<p>
ASP.NET MVC gives you a powerful, patterns-based way to build dynamic websites that
enables a clean separation of concerns and gives you full control over markup
for enjoyable, agile development.
</p>
<p><a class="btn btn-default">Learn more &raquo;</a></p>
</div>
<div class="col-md-4">
<h2>Get more libraries</h2>
<p>NuGet is a free Visual Studio extension that makes it easy to add, remove, and update libraries and tools in Visual Studio projects.</p>
<p><a class="btn btn-default">Learn more &raquo;</a></p>
</div>
<div class="col-md-4">
<h2>Web Hosting</h2>
<p>You can easily find a web hosting company that offers the right mix of features and price for your applications.</p>
<p><a class="btn btn-default">Learn more &raquo;</a></p>
</div>
</div>
</div>
</div>
@if (this.User.IsInRole(UserRoles.WEB_Anonymous))
{
<div class="row">
<div class="col-5">
<form action="~/" method="post" autocomplete="off">
<div class="form-floating mb-3">
<input type="text" class="form-control" id="username" name="username" placeholder="Benutzername" autocomplete="off">
<label for="username">Benutzername</label>
@this.Html.ValidationMessage("username", new { @class = "small text-danger" })
</div>
<div class="form-floating mb-3">
<input type="password" class="form-control" id="password" name="password" placeholder="Kennwort" autocomplete="off">
<label for="password">Kennwort</label>
@this.Html.ValidationMessage("password", new { @class = "small text-danger" })
</div>
<div class="d-flex mb-3">
<input class="btn btn-success py-3 px-5" value="Anmelden" type="submit" />
</div>
</form>
</div>
</div>
}
</div>
@@ -1,145 +0,0 @@
@model IEnumerable<LaaProductionWeb.Services.Models.Reports.TestStatus>
@{
Func<bool?, bool, MvcHtmlString> testPassed = (testStatus, nullable) =>
{
if (testStatus is null && nullable)
{
return new MvcHtmlString("<td class=\"text-center text-success\">OK*</td>");
}
else if (testStatus is null)
{
return new MvcHtmlString("<td class=\"text-center text-secondary small\">n/a</td>");
}
else if (testStatus == false)
{
return new MvcHtmlString("<td class=\"text-center text-danger\">X</td>");
}
else
{
return new MvcHtmlString("<td class=\"text-center text-success\">OK</td>");
}
};
}
<tbody>
<tr>
<td colspan="2" class="p-0">
<table class="table table-bordered">
<tr>
<th class="white-space-nowrap">Pos.</th>
<th class="white-space-nowrap">Serial No.</th>
<th class="text-center">T1</th>
<th class="text-center">T2</th>
<th class="text-center">T3</th>
<th class="text-center">T4</th>
<th class="text-center">T5</th>
<th class="text-center">T6</th>
<th class="text-center">T7</th>
</tr>
@foreach (var item in this.Model)
{
<tr>
<td class="va-middle">@item.PosNr</td>
<td class="va-middle white-space-nowrap">@item.SerialNr</td>
@testPassed(null, true)
@testPassed(item.PressureTest, false)
@testPassed(item.HeliumTest, false)
@testPassed(null, true)
@testPassed(item.MetroTest, false)
@testPassed(item.RadioTest, false)
@testPassed(null, true)
</tr>
}
</table>
</td>
</tr>
<tr>
<td colspan="2" class="pt-5 pb-0 px-0 small">
<table class="table table-sm table-bordered border-top">
<tr>
<th>Legend:</th>
<th>Component & Operation</th>
<th>Quantum of Check</th>
<th>Acceptance Norms</th>
</tr>
<tr>
<th class="va-middle py-0">T1</th>
<th class="va-middle py-0">Powder coating</th>
<td class="py-0">
1 piece per quarter<br />
1 piece per h
</td>
<td class="va-middle py-0">
Adhesion according to DIN 53151,coating faultless & corrosion free<br />
According drawing
</td>
</tr>
<tr>
<th class="va-middle py-0">T2</th>
<th class="va-middle py-0">Pressure and burst test composit transducer</th>
<td class="py-0">
First part / batch<br />
500 th part / batch<br />
Last part / batch
</td>
<td class="va-middle">Rejected in case of leakage or breakage</td>
</tr>
<tr>
<th class="va-middle py-0">T3</th>
<th class="va-middle py-0">Tightness Test</th>
<td class="py-0">100%</td>
<td class="va-middle">Rejected in case of leakage</td>
</tr>
<tr>
<th class="va-middle py-0">T4</th>
<th class="va-middle py-0">Pressure and tightness test</th>
<td class="py-0">100% at start of production</td>
<td class="va-middle py-0">Rejected in case of leakage or breakage</td>
</tr>
<tr>
<th class="va-middle py-0">T5</th>
<th class="va-middle py-0">Metrological testing</th>
<td class="py-0">100%</td>
<td class="va-middle py-0">
Maximum Permissible Error at<br />
Q1 < ± 5%<br />
Q2 < ± 2%<br />
Q3 < ± 2%
</td>
</tr>
<tr>
<th class="va-middle py-0">T6</th>
<th class="va-middle py-0">Config comparison and radio test</th>
<td class="py-0">100%</td>
<td class="va-middle py-0">
Main functions, LCD display, LED, Radio functions according to specs<br />
Parameter readable and according to customer specification
</td>
</tr>
<tr>
<th class="va-middle py-0">T7</th>
<th class="py-0">100%</th>
<td class="va-middle py-0">Packaging of meter</td>
<td class="va-middle py-0">SENSUS-1-924</td>
</tr>
<tr>
<th class="va-middle py-0">n/a</th>
<td class="va-middle py-0" colspan="3">Not applicable</td>
</tr>
<tr>
<th class="va-middle py-0">Ok</th>
<td class="va-middle py-0" colspan="3">Test passed</td>
</tr>
<tr>
<th class="va-middle py-0">Ok*</th>
<td class="va-middle py-0" colspan="3">Test passed according to the Quantum of Check</td>
</tr>
<tr>
<th class="va-middle py-0">X</th>
<td class="va-middle py-0" colspan="3">Test not passed</td>
</tr>
</table>
</td>
</tr>
</tbody>
@@ -1,16 +0,0 @@
@model IEnumerable<KeyValuePair<int, string>>
@if (this.Model != null && this.Model.Any())
{
foreach (var kvp in this.Model)
{
<li><a class="dropdown-item" href="#@kvp.Key">@kvp.Key - @kvp.Value</a></li>
}
}
else
{
<li>
<a class="dropdown-item text-secondary bg-light text-normal" href="#"><i class="bi bi-search"></i> Search by client name</a>
</li>
}
@@ -1,21 +0,0 @@
@model OrderClientModel
@using LaaProductionWeb.Services.Models
<div class="d-flex flex-column h-100">
<form action="~/Protocol/DeleteFile" method="post" class="nav justify-content-end bg-whitesmoke">
@this.Html.HiddenFor(x => x.FileId)
@this.Html.HiddenFor(x => x.OrderId)
<button class="btn btn-link text-danger nav-link">
<i class="bi bi-trash"></i> Delete
</button>
</form>
<div class="container-fluid h-100 p-0">
<div class="row h-100">
<div class="position-relative h-100">
<iframe class="position-absolute align-top align-left w-100 h-100" src="@this.Model.FileContent" frameborder="0" allowfullscreen />
</div>
</div>
</div>
</div>
@@ -1,136 +0,0 @@
@model OrderClientModel
@using LaaProductionWeb.Controllers
@using LaaProductionWeb.Services.Models
<table class="table table-bordered mb-5">
<thead>
<tr>
<th class="align-top p-0 w-100">
<table class="table table-bordered">
<tr>
<td colspan="2" class="py-1 fs-5 white-space-nowrap text-center text-smallcaps">Test Protocol</td>
</tr>
<tr>
<td class="py-1 white-space-nowrap va-middle"><label for="client_name">Client</label></td>
<td class="p-1 dropdown w-75">
<input id="client_name" class="form-control border-0 rounded-0" value="@this.Model.ClientName" />
<ul class="dropdown-menu mt-2 w-100" id="client_name_options">
<li class="text-secondary bg-light text-normal">Search by client name</li>
</ul>
</td>
</tr>
<tr>
<td class="py-1 white-space-nowrap va-middle"><label for="order_no">Order No.</label></td>
<td class="p-1 w-75">
<input id="order_no" class="form-control border-0 rounded-0" value="@this.Model.OrderId" />
<ul class="dropdown-menu mt-2 w-100" id="order_no_options">
<li class="text-secondary bg-light text-normal">Search by order no.</li>
</ul>
</td>
</tr>
<tr class="border-bottom-0">
<td class="py-1 white-space-nowrap va-middle">Positions</td>
<td class="p-1 w-75">
<div class="form-control border-0 rounded-0">
@if (string.IsNullOrWhiteSpace(this.Model.Positions))
{
<span class="text-white">...</span>
}
else
{
<span>@this.Model.Positions</span>
}
</div>
</td>
</tr>
</table>
</th>
<th class="text-center va-middle w-auto">
<img src="~/App_Content/svg/sensus_xylem_logo.svg" width="210" class="mx-5"/>
<form action="~/Protocol/Index" method="post" enctype="multipart/form-data">
@this.Html.HiddenFor(x => x.OrderId)
@this.Html.HiddenFor(x => x.ClientId)
@this.Html.HiddenFor(x => x.ClientName)
@this.Html.HiddenFor(x => x.Positions)
<input name="FilePDF" id="FilePDF" type="file" class="d-none" accept="application/pdf" onchange="javascript: this.form.submit();" />
<div class="input-group flex-nowrap mt-3">
<a class="btn btn-light border white-space-nowrap w-100" href="~/Protocol/Print?orderId=@this.Model.OrderId" target="_blank">
<i class="bi bi-printer me-2"></i> Vorschau
</a>
<label for="FilePDF" class="btn btn-outline-light border text-dark white-space-nowrap w-100">
<i class="bi bi-filetype-pdf"></i> Auswählen
</label>
</div>
@if (this.TempData.TryGetValue(ProtocolController.FilePDF, out object errorMessage))
{
<div class="text-danger small fw-normal">
@($"{errorMessage}")
</div>
}
</form>
</th>
</tr>
</thead>
@if (this.Model.OrderId > 0)
{
this.Html.RenderAction("Body", "Protocol", new { orderId = this.Model.OrderId });
}
</table>
@section scripts {
<script>
document.addEventListener("DOMContentLoaded", () => {
const show = 'show';
let clientNrInput = document.getElementById('client_name');
let clientMenu = document.getElementById('client_name_options');
if (clientNrInput && clientMenu) {
clientNrInput.oninput = function loadOrdersByOrderNr() {
setTimeout(function handler() {
let search = clientNrInput.value;
if (search && search.length > 3) {
fetch(`@this.Url.Action("Clients", "Protocol")?search=${search}`)
.then(response => response.text())
.then(orderItems => {
clientMenu.innerHTML = orderItems;
clientMenu.classList.add(show);
})
} else {
orderMenu.classList.remove(show);
}
}, 50);
};
}
let orderNrInput = document.getElementById('order_no');
let orderMenu = document.getElementById('order_no_options');
if (orderNrInput && orderMenu) {
orderNrInput.oninput = function loadOrdersByOrderNr() {
setTimeout(function handler() {
let search = orderNrInput.value;
if (search && search.length > 3) {
fetch(`@this.Url.Action("Orders", "Protocol")?search=${search}`)
.then(response => response.text())
.then(orderItems => {
orderMenu.innerHTML = orderItems;
orderMenu.classList.add(show);
})
} else {
orderMenu.classList.remove(show);
}
}, 50);
};
}
window.addEventListener('hashchange', function () {
clientMenu.classList.remove(show);
orderMenu.classList.remove(show);
location.href = `@this.Url.Action("Index", "Protocol")?orderId=${location.hash.substring(1)}`
});
});
</script>
}
@@ -1,15 +0,0 @@
@model IEnumerable<KeyValuePair<int, string>>
@if (this.Model != null && this.Model.Any())
{
foreach (var kvp in this.Model)
{
<li><a class="dropdown-item" href="#@kvp.Key">@kvp.Key - @kvp.Value</a></li>
}
}
else
{
<li>
<a class="dropdown-item text-secondary bg-light text-normal" href="#"><i class="bi bi-search"></i> Search by order no.</a>
</li>
}
@@ -1,94 +0,0 @@
@model OrderClientModel
@using LaaProductionWeb.Controllers
@using LaaProductionWeb.Services.Models
@{
this.Layout = "~/Views/Shared/_PrintLayout.cshtml";
}
<table class="table table-bordered">
<thead>
<tr>
<th class="align-top p-0 w-100">
<table class="table table-bordered">
<tr>
<td colspan="2" class="py-1 fs-5 white-space-nowrap text-center text-smallcaps">Test Protocol</td>
</tr>
<tr>
<td class="py-1 white-space-nowrap va-middle"><label for="client_name">Client</label></td>
<td class="p-1 w-75">
<div class="form-control border-0 rounded-0">
@if (string.IsNullOrWhiteSpace(this.Model.ClientName))
{
<span class="text-white">...</span>
}
else
{
<span>@this.Model.ClientName</span>
}
</div>
</td>
</tr>
<tr>
<td class="py-1 white-space-nowrap va-middle"><label for="order_no">Order No.</label></td>
<td class="p-1 w-75">
<div class="form-control border-0 rounded-0">
@if (this.Model.OrderId is null)
{
<span class="text-white">...</span>
}
else
{
<span>@this.Model.OrderId</span>
}
</div>
</td>
</tr>
<tr class="border-bottom-0">
<td class="py-1 white-space-nowrap va-middle">Positions</td>
<td class="p-1 w-75">
<div class="form-control border-0 rounded-0">
@if (string.IsNullOrWhiteSpace(this.Model.Positions))
{
<span class="text-white">...</span>
}
else
{
<span>@this.Model.Positions</span>
}
</div>
</td>
</tr>
</table>
</th>
<th class="text-center va-middle w-auto p-3">
<img src="~/App_Content/svg/sensus_xylem_logo.svg" width="130" class="mx-5" />
</th>
</tr>
</thead>
@if (this.Model.OrderId > 0)
{
this.Html.RenderAction(nameof(ProtocolController.Body), new { orderId = this.Model.OrderId });
}
</table>
<div class="container-fluid">
<div class="row py-5">
<div class="col-4 d-flex flex-column justify-content-end">
<label class="small">Date: @($"{DateTime.Now:dd.MM.yyyy}")</label>
<hr class="mt-2" />
</div>
<div class="col-4 d-flex flex-column justify-content-end">
<div class="input-group align-items-end">
<label class="small">Name: </label>
<input class="form-control border-0 rounded-0" />
</div>
<hr class="mt-2" />
</div>
<div class="col-4 d-flex flex-column justify-content-end">
<label class="small">Sign: </label>
<hr class="mt-2" />
</div>
</div>
</div>
@@ -1,69 +0,0 @@
@model CordonelPressureSensorModel
@using LaaProductionWeb.Services.Models.Reports
<form action="~/Report/Kottmann" method="post" autocomplete="off" class="h-100" id="cor_report">
<div class="table-responsive h-100 mh-100">
<table class="table table-sm table-bordered mb-0">
<thead class="bg-light">
<tr>
<th class="text-nowrap p-2">@this.Model.Display(x => x.AuftragNr)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.PosNr)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.SerialNr)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.CustomerSerialNr)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.IdentNr)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.PcbId)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.TypeI)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.TypeII)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.Nennweite)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.Baulaenge)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.AVGPressure)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.TestPassed)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.TestDate)</th>
</tr>
<tr>
@foreach (var filter in this.Model.Filter)
{
if (filter.Type == PropertyType.Date)
{
<td>@this.Html.Partial("DateFilter", filter)</td>
}
else
{
<td>@this.Html.Partial("Filter", filter)</td>
}
}
</tr>
</thead>
<tbody>
@foreach (var item in this.Model.Items)
{
<tr>
<td class="text-nowrap p-2">@item.AuftragNr</td>
<td class="text-nowrap p-2">@item.PosNr</td>
<td class="text-nowrap p-2">@item.SerialNr</td>
<td class="text-nowrap p-2">@item.CustomerSerialNr</td>
<td class="text-nowrap p-2">@item.IdentNr</td>
<td class="text-nowrap p-2">@item.PcbId</td>
<td class="text-nowrap p-2">@item.TypeI</td>
<td class="text-nowrap p-2">@item.TypeII</td>
<td class="text-nowrap p-2">@item.Nennweite</td>
<td class="text-nowrap p-2">@item.Baulaenge</td>
<td class="text-nowrap p-2">@item.AVGPressure</td>
<td class="text-nowrap p-2"><i class="bi bi-bold @(item.TestPassed ? "bi-check text-success" : "bi-x text-danger")"></i></td>
<td class="text-nowrap p-2">@($"{item.TestDate:dd.MM.yyyy}")</td>
</tr>
}
</tbody>
</table>
</div>
</form>
@section scripts {
<script>
let form = document.getElementById('cor_report');
let inputFields = form
.querySelectorAll('input')
.forEach(x => x.onchange = () => form.submit());
</script>
}
@@ -1,33 +0,0 @@
@model LaaProductionWeb.Services.Models.Reports.ReportFilterProperty
@{
Func<bool, string> isChecked = x => x ? "checked" : string.Empty;
Func<bool, string> bgColor = x => !x ? "bg-light" : string.Empty;
}
<input type="hidden" name="@this.Model.TypeName" value="@this.Model.Type" />
<input type="hidden" name="@this.Model.IndexName" value="@this.Model.Index" />
<input type="hidden" name="@this.Model.ColumnName" value="@this.Model.Column" />
<input type="hidden" name="@this.Model.PropertyName" value="@this.Model.Property" />
<input autocomplete="off"
style="min-width: 200px"
class="form-control form-control-sm mb-1"
name="@this.Model.LikeName"
value="@this.Model.Like"
placeholder="dd.MM.yyyy-dd.MM.yyyy"/>
<div class="input-group flex-nowrap justify-content-center">
<input id="@(this.Model.OrderById)_1" name="@this.Model.OrderByName" type="radio" value="1" @isChecked(this.Model.OrderBy == 1) class="d-none" />
<label for="@(this.Model.OrderById)_1" class="form-control form-control-sm text-center text-secondary border-light @bgColor(this.Model.OrderBy == 1) cursor-pointer">
<i class="bi bi-chevron-up"></i>
</label>
<input id="@(this.Model.OrderById)_0" name="@this.Model.OrderByName" type="radio" value="0" @isChecked(this.Model.OrderBy == 0) class="d-none" />
<label for="@(this.Model.OrderById)_0" class="form-control form-control-sm text-center text-secondary border-light @bgColor(this.Model.OrderBy == 0) cursor-pointer">
<i class="bi bi-dash"></i>
</label>
<input id="@(this.Model.OrderById)__1" name="@this.Model.OrderByName" type="radio" value="-1" @isChecked(this.Model.OrderBy == -1) class="d-none" />
<label for="@(this.Model.OrderById)__1" class="form-control form-control-sm text-center text-secondary border-light @bgColor(this.Model.OrderBy == -1) cursor-pointer">
<i class="bi bi-chevron-down"></i>
</label>
</div>
@@ -1,27 +0,0 @@
@model LaaProductionWeb.Services.Models.Reports.ReportFilterProperty
@{
Func<bool, string> isChecked = x => x ? "checked" : string.Empty;
Func<bool, string> bgColor = x => !x ? "bg-light" : string.Empty;
}
<input type="hidden" name="@this.Model.TypeName" value="@this.Model.Type" />
<input type="hidden" name="@this.Model.IndexName" value="@this.Model.Index" />
<input type="hidden" name="@this.Model.ColumnName" value="@this.Model.Column" />
<input type="hidden" name="@this.Model.PropertyName" value="@this.Model.Property" />
<input name="@this.Model.LikeName" class="form-control form-control-sm mb-1" autocomplete="off" value="@this.Model.Like" />
<div class="input-group flex-nowrap justify-content-center">
<input id="@(this.Model.OrderById)_1" name="@this.Model.OrderByName" type="radio" value="1" @isChecked(this.Model.OrderBy == 1) class="d-none" />
<label for="@(this.Model.OrderById)_1" class="form-control form-control-sm text-center text-secondary border-light @bgColor(this.Model.OrderBy == 1) cursor-pointer">
<i class="bi bi-chevron-up"></i>
</label>
<input id="@(this.Model.OrderById)_0" name="@this.Model.OrderByName" type="radio" value="0" @isChecked(this.Model.OrderBy == 0) class="d-none" />
<label for="@(this.Model.OrderById)_0" class="form-control form-control-sm text-center text-secondary border-light @bgColor(this.Model.OrderBy == 0) cursor-pointer">
<i class="bi bi-dash"></i>
</label>
<input id="@(this.Model.OrderById)__1" name="@this.Model.OrderByName" type="radio" value="-1" @isChecked(this.Model.OrderBy == -1) class="d-none" />
<label for="@(this.Model.OrderById)__1" class="form-control form-control-sm text-center text-secondary border-light @bgColor(this.Model.OrderBy == -1) cursor-pointer">
<i class="bi bi-chevron-down"></i>
</label>
</div>
@@ -1,143 +0,0 @@
@model HeliumReportModel
@using LaaProductionWeb.Services.Models.Reports
<form action="~/Report/Helium" method="post" autocomplete="off" class="h-100" id="he_report">
<div class="table-responsive h-100 mh-100">
<table class="table table-sm table-bordered mb-0">
<thead class="bg-light">
<tr>
<th class="text-nowrap p-2">@this.Model.Display(x => x.FertigungNr)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.AuftragNr)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.PositionNr)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.SerialNr)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.IdentNr)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.HeId)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.HeTestId)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.PcbId)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.Nennweite)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.Baulaenge)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.Typ)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.Druck)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.Temperatur)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.HeLakeRate)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.HeTestPressure)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.IsValid)</th>
<th class="p-2" style="min-width: 200px">@this.Model.Display(x => x.Text)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.TestDate)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.Tester)</th>
</tr>
<tr>
@foreach (var filter in this.Model.Filter)
{
if (filter.Type == PropertyType.Date)
{
<td>@this.Html.Partial("DateFilter", filter)</td>
}
else
{
<td>@this.Html.Partial("Filter", filter)</td>
}
}
</tr>
</thead>
<tbody>
@foreach (var item in this.Model.Items)
{
<tr>
<td class="text-nowrap p-2">@item.FertigungNr</td>
<td class="text-nowrap p-2">@item.AuftragNr</td>
<td class="text-nowrap p-2">@item.PositionNr</td>
<td class="text-nowrap p-2">@item.SerialNr</td>
<td class="text-nowrap p-2">@item.IdentNr</td>
<td class="text-nowrap p-2">@item.HeId</td>
<td class="text-nowrap p-2">
<a class="text-decoration-none cursor-pointer" href="#@item.HeTestId">
@item.HeTestId
</a>
</td>
<td class="text-nowrap p-2">@item.PcbId</td>
<td class="text-nowrap p-2">@item.Nennweite</td>
<td class="text-nowrap p-2">@item.Baulaenge</td>
<td class="text-nowrap p-2">@item.Typ</td>
<td class="text-nowrap p-2">@item.Druck</td>
<td class="text-nowrap p-2">@item.Temperatur</td>
<td class="text-nowrap p-2">@item.HeLakeRate</td>
<td class="text-nowrap p-2">@item.HeTestPressure</td>
<td class="text-nowrap p-2"><i class="bi bi-bold @(item.IsValid ? "bi-check text-success" : "bi-x text-danger")"></i></td>
<td class="p-2">@item.Text</td>
<td class="text-nowrap p-2">@($"{item.TestDate:dd.MM.yyyy}")</td>
<td class="text-nowrap p-2">@item.Tester</td>
</tr>
}
</tbody>
</table>
</div>
</form>
<form action="~/Report/HeliumCSV" method="post" autocomplete="off" class="position-fixed bottom-0 end-0 m-2">
@foreach (var filter in this.Model.Filter)
{
this.Html.Partial("HiddenFilter", filter);
}
<button class="btn btn-light border-success" type="submit">
<i class="bi bi-filetype-csv text-success"></i>
</button>
</form>
<button id="modal_btn" class="d-none" data-bs-toggle="he_modal" data-bs-target="#he_modal"></button>
<!-- Modal -->
<div class="modal fade" id="he_modal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="exampleModalLabel">Testergebnisse</h1>
<button type="button" class="btn-close" data-bs-dismiss="he_modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<table class="table table-sm table-bordered">
<thead>
<tr>
<th>Test Id</th>
<th>Punkt Nr</th>
<th>Ergebniss</th>
</tr>
</thead>
<tbody id="tbody"></tbody>
</table>
</div>
</div>
</div>
</div>
@section scripts {
<script>
let form = document.getElementById('he_report');
let inputFields = form
.querySelectorAll('input')
.forEach(x => x.onchange = () => form.submit());
let tbody = this.document.getElementById('tbody');
let heModal = this.document.getElementById('he_modal');
let modalBtn = this.document.getElementById('modal_btn');
heModal.addEventListener('hide.bs.modal', _ => this.location.hash = '');
window.addEventListener('hashchange', function () {
tbody.innerHTML = null;
if (location.hash) {
let testId = location.hash.substring(1);
if (testId) {
fetch(`@this.Url.Action("HeliumResults", "Report")?testId=${testId}`)
.then(response => response.text())
.then(function (html) {
tbody.innerHTML = html;
modalBtn.click();
})
.catch(x => console.log(x));
}
}
});
</script>
}
@@ -1,10 +0,0 @@
@model IEnumerable<LaaProductionWeb.Services.Models.Reports.HeliumPressurePoint>
@foreach (var item in this.Model)
{
<tr>
<td>@item.TestId</td>
<td>@item.PointNr</td>
<td>@item.Result</td>
</tr>
}
@@ -1,8 +0,0 @@
@model LaaProductionWeb.Services.Models.Reports.ReportFilterProperty
<input type="hidden" name="@this.Model.TypeName" value="@this.Model.Type" />
<input type="hidden" name="@this.Model.IndexName" value="@this.Model.Index" />
<input type="hidden" name="@this.Model.ColumnName" value="@this.Model.Column" />
<input type="hidden" name="@this.Model.PropertyName" value="@this.Model.Property" />
<input type="hidden" name="@this.Model.LikeName" value="@this.Model.Like" />
<input type="hidden" name="@this.Model.OrderByName" value="@this.Model.OrderBy" />
@@ -1,99 +0,0 @@
@model LaaProductionWeb.Services.Models.Reports.KottmannReportModel
@using LaaProductionWeb.Services.Models.Reports
<form action="~/Report/Kottmann" method="post" autocomplete="off" class="h-100" id="kot_report">
<div class="table-responsive h-100 mh-100">
<table class="table table-sm table-bordered mb-0">
<thead class="bg-light">
<tr>
<th class="text-nowrap p-2">@this.Model.Display(x => x.FertigungsNr)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.SerialNr)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.PcbId)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.Typ)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.Nennweite)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.Baulaenge)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.StartDruck)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.EndDruck)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.DruckZeit)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.Dicht)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.Datum)</th>
<th class="text-nowrap p-2">@this.Model.Display(x => x.Bemerkung)</th>
</tr>
<tr>
@foreach (var filter in this.Model.Filter)
{
if (filter.Type == PropertyType.Date)
{
<td>@this.Html.Partial("DateFilter", filter)</td>
}
else
{
<td>@this.Html.Partial("Filter", filter)</td>
}
}
</tr>
</thead>
<tbody>
@foreach (var item in this.Model.Items)
{
<tr>
<td class="text-nowrap p-2">@item.FertigungsNr</td>
<td class="text-nowrap p-2">@item.SerialNr</td>
<td class="text-nowrap p-2">@item.PcbId</td>
<td class="text-nowrap p-2">@item.Typ</td>
<td class="text-nowrap p-2">@item.Nennweite</td>
<td class="text-nowrap p-2">@item.Baulaenge</td>
<td class="text-nowrap p-2">@item.StartDruck</td>
<td class="text-nowrap p-2">@item.EndDruck</td>
<td class="text-nowrap p-2">@item.DruckZeit</td>
<td class="text-nowrap p-2"><i class="bi bi-bold @(item.Dicht ? "bi-check text-success" : "bi-x text-danger")"></i></td>
<td class="text-nowrap p-2">@($"{item.Datum:dd.MM.yyyy}")</td>
<td class="text-nowrap p-2">@item.Bemerkung</td>
</tr>
}
</tbody>
</table>
</div>
</form>
<form action="~/Report/KottmannCSV" method="post" autocomplete="off" class="position-fixed bottom-0 end-0 m-2">
@foreach (var filter in this.Model.Filter)
{
this.Html.Partial("HiddenFilter", filter);
}
<button class="btn btn-light border-success" type="submit">
<i class="bi bi-filetype-csv text-success"></i>
</button>
</form>
@section scripts {
<script>
let form = document.getElementById('kot_report');
let inputFields = form
.querySelectorAll('input')
.forEach(x => x.onchange = () => form.submit());
@*let tbody = this.document.getElementById('tbody');
let modal = this.document.getElementById('modal');
let modalBtn = this.document.getElementById('modal_btn');
modal.addEventListener('hide.bs.modal', x => this.location.hash = '');
window.addEventListener('hashchange', function () {
tbody.innerHTML = null;
if (location.hash) {
let testId = location.hash.substring(1);
if (testId) {
fetch(`@this.Url.Action("HeliumResults", "Report")?testId=${testId}`)
.then(response => response.text())
.then(function (html) {
tbody.innerHTML = html;
modalBtn.click();
})
.catch(x => console.log(x));
}
}
});*@
</script>
}
@@ -1,6 +0,0 @@
@model LaaProductionWeb.Services.Models.OrdersFoundModel
@foreach (var order in this.Model)
{
<li><a class="dropdown-item" href="#@order.Nr,@order.ProductionOrderNr">@($"{order.OrderNr, 10} / {order.ProductionOrderNr, 10}") - @order.Customer</a></li>
}
@@ -1,8 +0,0 @@
@model LaaProductionWeb.Services.Models.OrderPositions
<li><span class="dropdown-item">Alle</span></li>
@foreach (var position in this.Model)
{
<li><span class="dropdown-item">@position</span></li>
}
@@ -1,6 +0,0 @@
@model LaaProductionWeb.Services.Models.ProductionOrders
@foreach (var fertigungNr in this.Model)
{
<li><a href="#@fertigungNr" class="dropdown-item" onclick="console.log(`#${@fertigungNr}`)">@fertigungNr</a></li>
}
@@ -1,70 +0,0 @@
@model LaaProductionWeb.Services.Models.Search.SearchWildcardModel
<div class="container-fluid">
<form action="~/Search/Wildcard" method="post" autocomplete="off">
<div class="row mt-3">
<div class="col-md-12 d-flex">
@this.Html.LabelFor(x => x.Fields, new { @for = "serial_nr", @class = "text-smallcaps fw-bold" })
</div>
@if (this.Model.Fields != null)
{
<div class="col-md-12 d-flex justify-content-between">
@foreach (var fieldKVP in this.Model.Fields)
{
var key = fieldKVP.Key;
var value = fieldKVP.Value;
var id = $"Fields_{key}";
var name = $"Fields[{key}]";
<div class="form-check">
@this.Html.CheckBox(name, value, new { @class = "form-check-input", id })
@this.Html.Label(key, new { @class = "form-check-label text-smallcaps", @for = id })
</div>
}
</div>
}
</div>
<div class="row">
<div class="col-md-12">
<div class="input-group mt-3">
<div class="form-floating">
@this.Html.TextBoxFor(x => x.Token, new { id = "serial_nr", @class = "form-control", placeholder = "0000000000" })
@this.Html.LabelFor(x => x.Token, new { @for = "serial_nr", @class = "opacity-50 text-smallcaps bi bi-search ps-4" })
</div>
<button type="submit" class="btn btn-primary px-5 py-3 text-smallcaps">Suchen</button>
</div>
@this.Html.ValidationMessageFor(x => x.Token, string.Empty, new { @class = "small text-danger mt-0" })
</div>
</div>
</form>
<div class="row">
<div class="col-md-12">
<div class="table-responsive rounded-1 mt-3">
<table class="table table-warning table-bordered mb-0">
@if (this.Model.Results != null)
{
<thead class="table-dark">
<tr>
@foreach (var header in this.Model.Results.FirstOrDefault()?.Keys ?? Array.Empty<string>())
{
<th class="py-3">@header</th>
}
</tr>
</thead>
<tbody class="table-group-divider">
@foreach (var data in this.Model.Results)
{
<tr>
@foreach (var value in data.Values)
{
<td class="py-3">@value</td>
}
</tr>
}
</tbody>
}
</table>
</div>
</div>
</div>
</div>
@@ -1,13 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Error</title>
</head>
<body>
<hgroup>
<h1>Error.</h1>
<h2>An error occurred while processing your request.</h2>
</hgroup>
</body>
</html>
@@ -1,92 +0,0 @@
@using LaaProductionWeb.App_Infrastructure
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/svg" href="~/favicon.svg">
@Styles.Render("~/bootstrap_css")
@*@Styles.Render("~/bootstrap_icons")*@
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css">
@Styles.Render("~/styles_css")
<title>Laatzen Production Web</title>
</head>
<body class="d-flex flex-column vh-100 overflow-hidden">
@if (!this.User.IsInRole(UserRoles.WEB_Anonymous))
{
<nav class="navbar navbar-expand-lg navbar-dark bg-dark shadow-sm">
<div class="container-fluid">
<button class="navbar-toggler" data-bs-toggle="collapse" data-bs-target="#mainnav" aria-controls="mainnav" aria-expanded="false">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="mainnav">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
@if (this.User.IsInRole(UserRoles.WEB_PalettenScan))
{
<li class="nav-item">
<a class="nav-link text-smallcaps" href="~/Shipments">Paletten Scan</a>
</li>
}
@if (this.User.IsInRole(UserRoles.WEB_PuneProtokoll))
{
<li class="nav-item">
<a class="nav-link text-smallcaps" href="~/Protocol">Prüfprotokoll</a>
</li>
}
@if (this.User.IsInRole(UserRoles.WEB_HeReport))
{
<li class="nav-item dropdown">
<a class="nav-link text-smallcaps dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false" href="#">Reports</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="~/Report/Helium">Helium</a></li>
<li><a class="dropdown-item" href="~/Report/Kottmann">Kottmann</a></li>
<li><a class="dropdown-item" href="~/Report/CordonelPressureSensor">Cordonel Pressure Sensor</a></li>
</ul>
</li>
}
@if (this.User.IsInRole(UserRoles.WEB_ProdApproval))
{
<li class="nav-item">
<a class="nav-link text-smallcaps" href="~/Approvals/Add">Production Approval</a>
</li>
}
</ul>
<ul class="navbar-nav ms-auto mb-2 mb-lg-0">
@if (this.User.IsInRole(UserRoles.WEB_Admin))
{
<li class="nav-item dropdown">
<a class="nav-link text-smallcaps dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false" href="#">@this.User.ClaimName()</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="~/Administration/Software">Software</a></li>
</ul>
</li>
}
else
{
<li class="nav-item">
<span class="nav-link text-smallcaps">Benutzer: @this.User.ClaimName()</span>
</li>
}
</ul>
</div>
</div>
</nav>
}
<main class="h-100 scrollable">
@this.RenderBody()
</main>
@Scripts.Render("~/bootstrap_js")
@Scripts.Render("~/barcodes_js")
@Scripts.Render("~/scripts_js")
@this.RenderSection("scripts", required: false)
</body>
</html>
@@ -1,15 +0,0 @@
<!DOCTYPE html>
<html>
<head>
@Styles.Render("~/bootstrap_css")
@Styles.Render("~/bootstrap_icons")
@Styles.Render("~/styles_css")
</head>
<body>
@this.RenderBody()
@Scripts.Render("~/bootstrap_js")
@Scripts.Render("~/barcodes_js")
@Scripts.Render("~/scripts_js")
@this.RenderSection("scripts", required: false)
</body>
</html>
@@ -1,93 +0,0 @@
@using LaaProductionWeb.Services.Models
@model PalletsBatchModel
@if (!string.IsNullOrWhiteSpace(this.Model.Customer))
{
<div class="d-flex justify-content-center">
<div id="batch" class="print-page border rounded shadow-sm mt-5 p-5">
<div class="table-responsive">
<table class="table table-borderless">
<tr>
<th colspan="2" class="fs-5">Paletten Begleitschein</th>
<th colspan="2" class="fs-5">@this.Model.Customer</th>
</tr>
<tr>
<th class="white-space-nowrap">Kunden-Auftrag</th>
<td class="">@this.Model.OrderNr</td>
<th class="white-space-nowrap">Fertigungsauftrags-Nr.</th>
<td class="">@this.Model.ProductionOrderNr</td>
</tr>
<tr class="border-top">
<td class="p-0 small" colspan="4">
<table class="table table-borderless">
<tr>
<th class="text-end">Pos</th>
<th >Bezeichnung</th>
<th class="text-end">Menge</th>
<th class="text-end">Bestellmenge</th>
</tr>
@foreach (var pos in this.Model.Positions)
{
<tr>
<td class="text-end">@pos.PositionNr</td>
<td >@pos.Description</td>
<td class="text-end">@pos.ItemsCount</td>
<td class="text-end">@pos.TotalItemsCount</td>
</tr>
}
<tr class="border-top">
<td colspan="3" class="text-end fw-bold">Palettenmenge: @this.Model.Positions.Sum(x => x.ItemsCount)</td>
<td colspan="1"></td>
</tr>
</table>
</td>
</tr>
</table>
<table class="table table-borderless table-striped">
<thead>
<tr>
<th>Nr.</th>
<th class="w-100">(Pos) Serial Nr.</th>
<th class="w-100">Barcode</th>
<th class="white-space-nowrap">Paletten Nr.</th>
<th class="w-100"></th>
</tr>
</thead>
<tbody>
@{
var count = 1;
foreach (var item in this.Model.Positions.SelectMany(x => x.Items))
{
<tr class="is_scaned_@(item.IsScanned ? 1 : 0)">
<td class="va-middle @(item.IsScanned ? null : "text-secondary")">@(count++).</td>
<td class="va-middle w-100 @(item.IsScanned ? null : "text-secondary")">(@item.PositionNr) @item.BarcodeNr</td>
<td class="va-middle w-100 text-center">
<svg class="barcode"
jsbarcode-format="auto"
jsbarcode-value="@item.BarcodeNr"
jsbarcode-displayValue="false"
jsbarcode-background="transparent"
jsbarcode-lineColor="@(item.IsScanned ? "black" : "#ced4da")"
jsbarcode-height="50"
jsbarcode-margin="0"
jsbarcode-textMargin="0"
jsbarcode-fontoptions="bold">
</svg>
</td>
<td class="va-middle text-end">@(item.IsScanned ? item.PalletNr : null)</td>
<td class="va-middle text-center">
<a class="btn btn-sm btn-danger" href="~/Shipments/Delete/@item.Id">
<i class="bi bi-x"></i>
</a>
</td>
</tr>
}
}
</tbody>
</table>
</div>
</div>
</div>
}
@@ -1,120 +0,0 @@
@using LaaProductionWeb.Controllers
@using LaaProductionWeb.Services.Models
@model ShipmentModel
<div class="container-fluid h-100">
<div class="row h-100 overflow-hidden">
<div class="col-md-3 py-3 h-100 scrollable-sm bg-light border-end shadow-sm">
<h5 class="text-smallcaps">Palettenbegleiter</h5>
<hr />
<form id="order_form" action="~/Shipments" method="post" autocomplete="off">
<div class="form-floating mb-3 dropdown">
@this.Html.TextBoxFor(x => x.OrderNr, new { id = "order_nr", @class = "form-control", placeholder = "0000000000" })
@this.Html.LabelFor(x => x.OrderNr, new { @for = "order_nr", @class = "text-smallcaps" })
@this.Html.ValidationMessageFor(x => x.OrderNr, string.Empty, new { @class = "small text-danger m-0 p-0" })
<ul id="order_nr_menu" class="dropdown-menu w-100 mt-1"></ul>
</div>
<div class="form-floating mb-3">
<button type="submit" class="btn btn-primary py-3 w-100 text-smallcaps">
@this.Model.BtnSubmit <i class="bi bi-chevron-right ms-2"></i>
</button>
</div>
</form>
@{
this.Html.RenderAction(nameof(ShipmentsController.Scan), this.Model.OrderScanModel);
}
</div>
<div class="col-md-9 h-100 scrollable-sm pb-5">
@{
this.Html.RenderAction(nameof(ShipmentsController.Batch), this.Model.OrderScanModel);
}
</div>
</div>
</div>
@section scripts {
<script>
(function autocompleteHandler() {
const show = 'show';
let orderNrInput = document.getElementById('order_nr');
let orderNrMenu = document.getElementById('order_nr_menu');
let positionNrInput = document.getElementById('pos_nr');
let positionNrMenu = document.getElementById('pos_nr_menu');
function ordersAutocomplete(orders) {
if (orders) {
orderNrMenu.innerHTML = orders;
if (orderNrMenu.children.length == 1) {
let firstOrder = orderNrMenu.querySelector('a.dropdown-item');
if (firstOrder) {
firstOrder.click();
} else {
orderNrMenu.classList.add(show);
}
} else {
orderNrMenu.classList.add(show);
}
}
}
function onOrderNrInput() {
orderNrMenu.classList.remove(show);
orderNrMenu.innerHTML = null;
let orderNr = orderNrInput.value;
if (orderNr && orderNr.length > 3) {
fetch(`@this.Url.Action("Orders", "Search")?search=${orderNr}`)
.then(response => response.text())
.then(data => ordersAutocomplete(data))
.catch(error => console.log(error));
}
}
function positionsHandler(data) {
const dropdownItemSelector = '#pos_nr_menu span.dropdown-item';
positionNrMenu.innerHTML = data;
positionNrMenu
.querySelectorAll(dropdownItemSelector)
.forEach(x => x.onclick = function (e) {
positionNrInput.value = e.target.innerText;
document
.getElementById('order_form')
.submit();
});
orderNrMenu.classList.remove(show);
}
function getPositions(orderNr) {
if (orderNr && orderNr.length > 3) {
fetch(`@this.Url.Action("Positions", "Search")?ordernr=${orderNr}`)
.then(response => response.text())
.then(data => positionsHandler(data))
.catch(error => console.log(error));
}
}
window.addEventListener('hashchange', function () {
if (location.hash) {
orderChanged = true;
let orderNr = location
.hash
.substring(1)
.split(',')[0];
orderNrInput.value = orderNr;
getPositions(orderNr);
}
});
orderNrInput.oninput = onOrderNrInput;
})();
let serialNrInput = document.getElementById('serial_nr');
if (serialNrInput) {
serialNrInput.focus({ focusVisible: true });
}
JsBarcode(".barcode").init();
</script>
}
@@ -1,36 +0,0 @@
@model IEnumerable<LaaProductionWeb.Services.Models.MissingItem>
<div class="container-fluid my-3">
<div class="row">
<div class="col-12">
<table class="table table-bordered table-striped">
<thead class="table-dark">
<tr>
<th>Auftrag Nr</th>
<th>Position Nr</th>
<th>Serien Nr</th>
<th>Kunden Serien Nr</th>
<th>Bezeichnung</th>
<th>Typ</th>
<th>Anlage Datum</th>
</tr>
</thead>
<tbody>
@foreach (var item in this.Model)
{
<tr>
<td>@item.OrderNr</td>
<td>@item.PosNr</td>
<td>@item.SerialNr</td>
<td>@item.CustomSerial</td>
<td>@item.Term</td>
<td>@item.Type</td>
<td>@item.EntryDate.ToString("yyyy-MM-dd")</td>
</tr>
}
</tbody>
</table>
</div>
</div>
</div>
@@ -1,131 +0,0 @@
@model LaaProductionWeb.Services.Models.BatchPrintModel
@{
this.Layout = "~/Views/Shared/_PrintLayout.cshtml";
}
<table class="table table-borderless table-striped" border="0">
<thead>
<tr>
<th colspan="8" class="px-0">
<table class="table table-borderless">
<thead>
<tr>
<th colspan="2" class="fs-4">Paletten Begleitschein</th>
<th colspan="2" class="fs-4">@this.Model.ClientName</th>
</tr>
<tr>
<td class="white-space-nowrap">Kunden-Auftrag</td>
<td class="fw-normal">@this.Model.OrderNr</td>
<td class="white-space-nowrap">Fertigungsauftrags-Nr.</td>
<td class="fw-normal">@this.Model.ProductionOrderNr</td>
</tr>
<tr class="border-top">
<td class="p-0 small" colspan="4">
<table class="table table-borderless">
<tr>
<th class="text-end">Pos</th>
<th>Bezeichnung</th>
<th class="text-end">Menge</th>
<th class="text-end">Bestellmenge</th>
</tr>
@foreach (var pos in this.Model.Positions)
{
<tr>
<td class="fw-normal text-end">@pos.PositionNr</td>
<td class="fw-normal ">@pos.Description</td>
<td class="fw-normal text-end">@pos.ItemsCount</td>
<td class="fw-normal text-end">@pos.TotalItemsCount</td>
</tr>
}
<tr class="border-top">
<td colspan="3" class="text-end fw-bold">Palettenmenge: @this.Model.Positions.Sum(x => x.ItemsCount)</td>
<td colspan="1" class="text-end fw-bold">Palettennummer: @this.Model.PalletNr</td>
</tr>
</table>
</td>
</tr>
</thead>
</table>
</th>
</tr>
<tr>
<th class="small">#</th>
<th class="small">Pos</th>
<th class="small">SerienNr</th>
<th class="small">Barcode</th>
<th class="small">#</th>
<th class="small">Pos</th>
<th class="small">SerienNr</th>
<th class="small">Barcode</th>
</tr>
</thead>
<tbody>
@{
var items = this.Model
.Positions
.SelectMany(x => x.Items
.Where(i => i.IsScanned))
.ToList();
var itemsCount = items.Count;
for (var i = 0; i < itemsCount; i += 2)
{
var ni = i + 1;
var item = items[i];
<tr>
<td class="va-middle">@(i + 1).</td>
<td class="va-middle">@item.PositionNr</td>
<td class="va-middle">@item.BarcodeNr</td>
<td class="p-0">
<svg class="barcode"
jsbarcode-marginTop="2"
jsbarcode-marginLeft="0"
jsbarcode-marginRight="0"
jsbarcode-marginBottom="2"
jsbarcode-height="50"
jsbarcode-format="auto"
jsbarcode-displayValue="false"
jsbarcode-background="transparent"
jsbarcode-value="@item.BarcodeNr" />
</td>
@if (ni < itemsCount)
{
var nitem = items[ni];
<td class="va-middle">@(ni + 1).</td>
<td class="va-middle">@nitem.PositionNr</td>
<td class="va-middle">@item.BarcodeNr</td>
<td class="p-0">
<svg class="barcode"
jsbarcode-marginTop="2"
jsbarcode-marginLeft="0"
jsbarcode-marginRight="0"
jsbarcode-marginBottom="2"
jsbarcode-height="50"
jsbarcode-format="auto"
jsbarcode-displayValue="false"
jsbarcode-background="transparent"
jsbarcode-value="@nitem.BarcodeNr" />
</td>
}
else
{
<td></td>
<td></td>
<td></td>
<td></td>
}
</tr>
}
}
</tbody>
</table>
@section scripts {
<script>
JsBarcode(".barcode").init();
</script>
}
@@ -1,87 +0,0 @@
@model LaaProductionWeb.Services.Models.OrderScanModel
@if (this.Model.OrderNr > 0)
{
<div>
<h5 class="text-smallcaps">@this.Model.ScanTitle</h5>
<hr />
</div>
<form id="scan_form" action="~/Shipments/ScanPost" method="post" autocomplete="off">
@this.Html.HiddenFor(x => x.OrderNr)
<div class="d-flex flex-wrap">
@foreach (var pallet in this.Model.Pallets)
{
var palletNr = pallet.Key;
var forPosition = pallet.Value;
var href = this.Url.Content(this.Model.PalletUrl(palletNr));
if (!forPosition && palletNr == this.Model.PalletNr)
{
<a class="btn btn-secondary opacity-25 mb-3 me-3" href="@href">@palletNr</a>
}
else if (!forPosition)
{
<a class="btn btn-outline-secondary opacity-25 mb-3 me-3" href="@href">@palletNr</a>
}
else if (forPosition && palletNr == this.Model.PalletNr)
{
<a class="btn btn-success mb-3 me-3" href="@href">@palletNr</a>
}
else
{
<a class="btn btn-outline-success mb-3 me-3" href="@href">@palletNr</a>
}
}
<a class="btn btn-outline-secondary mb-3 me-3" href="@this.Url.Content(this.Model.PrintUrl)" target="_blank">
<i class="bi bi-printer"></i> Druckvorschau
</a>
</div>
<div class="form-floating mb-3 dropdown">
<i class="bi bi-chevron-down" style="position: absolute;right: 3.5%;top: 35%;" data-bs-toggle="dropdown"></i>
<select id="@nameof(this.Model.PositionNr)"
name="@nameof(this.Model.PositionNr)"
class="form-control bg-white cursor-pointer"
onchange="this.form.submit();">
<option value=""></option>
@foreach (var positionNr in this.Model.Positions)
{
if (this.Model.PositionNr == positionNr)
{
<option value="@positionNr" selected="selected">@positionNr</option>
}
else
{
<option value="@positionNr">@positionNr</option>
}
}
</select>
@this.Html.LabelFor(x => x.PositionNr, new { @for = "pos_nr", @class = "text-smallcaps" })
</div>
<div class="input-group">
<div class="form-floating w-auto">
@this.Html.TextBoxFor(x => x.SerialNr, new { id = "serial_nr", @class = "form-control form-control-success text-center", placeholder = "0000000000" })
@this.Html.LabelFor(x => x.SerialNr, new { @for = "serial_nr", @class = "text-smallcaps" })
</div>
<div class="form-floating">
<input value="@this.Model.PalletNr" name="palletnr" id="palletnr" class="form-control form-control-success text-center" />
@this.Html.LabelFor(x => x.PalletNr, new { @class = "text-smallcaps", @for = "palletnr" })
</div>
</div>
@if (this.IsPost)
{
this.Html.ValidationMessageFor(x => x.SerialNr, string.Empty, new { @class = "small text-danger mt-0" });
}
@if (this.TempData.TryGetValue(nameof(this.Model.SerialNr), out object errorMessage))
{
<div class="text-danger small">
@($"{errorMessage}")
</div>
}
<div class="my-3">
<button class="btn btn-success py-3 w-100 text-smallcaps">
@this.Model.BtnSerialNr <i class="bi bi-chevron-right ms-2"></i>
</button>
</div>
</form>
}
@@ -1,3 +0,0 @@
@{
this.Layout = "~/Views/Shared/_Layout.cshtml";
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

@@ -1,26 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 275.27 123.65">
<defs>
<style>.cls-1{fill:#71d54c;}.cls-2{fill:#003895;}.cls-3{fill:#078ab1;}</style>
</defs>
<title>sensus_xylem_logo</title>
<g id="Layer_2" data-name="Layer 2">
<g id="Layer_1-2" data-name="Layer 1">
<rect class="cls-1" x="47.04" width="37.99" height="7.14"/>
<rect class="cls-1" x="47.04" y="11.65" width="37.99" height="7.14"/>
<rect class="cls-1" x="47.04" y="23.29" width="37.99" height="7.14"/>
<path class="cls-2" d="M124.94,35h-22.3c-7.14,0-9.31,2.08-9.31,8.9v27.5h9.14V42.71h22.64V71.36h9.14V43.86c0-6.82-2.18-8.9-9.31-8.9"/>
<path class="cls-2" d="M219.87,35V63.61H197.23V35h-9.14v27.5c0,6.82,2.18,8.9,9.31,8.9h22.3c7.14,0,9.31-2.08,9.31-8.9V35Z"/>
<path class="cls-2" d="M55.38,35c-6.82,0-8.91,2.18-8.91,9.31V62.05c0,7.14,2.08,9.31,8.91,9.31H85V63.61H55v-7H85V49.2H55v-7H85V35Z"/>
<path class="cls-2" d="M38.4,42.23V35H9.31C2.18,35,0,37,0,43.86v3.89c0,6.82,2.18,8.9,9.31,8.9H30.78v7H0v7.75H29.76c7.1,0,9.38-2.16,9.38-8.9V57.61c0-6.74-2.28-8.9-9.38-8.9H8.3V42.23Z"/>
<path class="cls-2" d="M179.92,42.23V35H150.83c-7.14,0-9.32,2.08-9.32,8.9v3.89c0,6.82,2.18,8.9,9.32,8.9h21.46v7H141.52v7.75h29.76c7.1,0,9.38-2.16,9.38-8.9V57.61c0-6.74-2.28-8.9-9.38-8.9H149.82V42.23Z"/>
<path class="cls-2" d="M274.53,42.23V35H245.44c-7.14,0-9.31,2.08-9.31,8.9v3.89c0,6.82,2.17,8.9,9.31,8.9H266.9v7H236.13v7.75h29.75c7.1,0,9.39-2.16,9.39-8.9V57.61c0-6.74-2.28-8.9-9.39-8.9H244.43V42.23Z"/>
<path class="cls-3" d="M68.21,103.11c0-3-1.66-4.54-4.69-4.54a7.49,7.49,0,0,0-5.23,2.07l-1.42-1.7a9.79,9.79,0,0,1,6.9-2.51c3.8,0,6.84,2.1,6.84,6.38v7.7a23.25,23.25,0,0,0,.3,4h-2.3a19,19,0,0,1-.26-2.86h-.06a7,7,0,0,1-6.38,3.31c-2.67,0-6.1-1.43-6.1-5.33,0-5.42,6-5.9,12.4-5.9Zm-.75,2.55c-4.16,0-9,.46-9,3.8,0,2.51,2.13,3.33,4.13,3.33A5.48,5.48,0,0,0,68.21,107v-1.31Z"/>
<path class="cls-3" d="M190.39,111.47v3h-2.55V86.07h2.55V99.92h.07a8,8,0,0,1,6.65-3.49c5.49,0,9.09,4.05,9.09,9.23s-3.6,9.24-9.09,9.24a8.08,8.08,0,0,1-6.65-3.43Zm6.47-12.91a7.09,7.09,0,0,0,0,14.16c4.22,0,6.64-3.15,6.64-7.06s-2.41-7.09-6.64-7.09"/>
<path class="cls-3" d="M209.09,96.87h2.46c.06.95.15,2.25.15,3h.07a6.25,6.25,0,0,1,5.64-3.45,6.58,6.58,0,0,1,1.68.18l-.34,2.4a6.89,6.89,0,0,0-1.8-.22c-2.7,0-5.15,2-5.15,6.65v9h-2.55V100.74c0-.94,0-2.66-.16-3.87"/>
<path class="cls-3" d="M232.09,103.11c0-3-1.66-4.54-4.69-4.54a7.46,7.46,0,0,0-5.23,2.07l-1.41-1.7a9.74,9.74,0,0,1,6.89-2.51c3.8,0,6.84,2.1,6.84,6.38v7.7a24.22,24.22,0,0,0,.31,4h-2.3a18.26,18.26,0,0,1-.26-2.86h-.07a7.05,7.05,0,0,1-6.39,3.31c-2.66,0-6.07-1.43-6.07-5.33,0-5.42,6-5.9,12.39-5.9Zm-.75,2.55c-4.18,0-9,.46-9,3.8,0,2.51,2.14,3.33,4.13,3.33a5.48,5.48,0,0,0,5.64-5.82v-1.31Z"/>
<path class="cls-3" d="M241.1,96.87c.06.95.16,2.25.16,3h.07a6.85,6.85,0,0,1,6-3.45c4.47,0,6.68,2.89,6.68,7.25v10.78h-2.55v-9.73c0-3.67-1.08-6.16-4.77-6.16-2.69,0-5.33,2.18-5.33,6.87v9h-2.55V100.74c0-.94,0-2.66-.14-3.87Z"/>
<path class="cls-3" d="M266,114.9c-5.49,0-9.09-4.06-9.09-9.24s3.59-9.23,9.09-9.23a8,8,0,0,1,6.65,3.49h.07V86.07h2.55v28.39h-2.55v-3h-.07A8.1,8.1,0,0,1,266,114.9m.27-2.18a6.71,6.71,0,0,0,6.75-7.06c0-4-2.81-7.09-6.75-7.09-4.24,0-6.64,3.19-6.64,7.09s2.4,7.06,6.64,7.06"/>
<path class="cls-3" d="M176.07,111.18v3.28h-1.85c-3.13,0-4.65-1.63-4.65-5.28v-5.72c0-1.79-.56-3.63-2.82-3.63s-3,1.84-3,3.63v11h-4v-11c0-1.79-.78-3.63-3.09-3.63s-3.06,1.84-3.06,3.63v11h-3.92V103.32c0-4.35,2.8-7,7-7a6.78,6.78,0,0,1,5.09,2.06,6.77,6.77,0,0,1,5.08-2.06c3.85,0,6.59,2.48,6.59,7v5.91c0,1.35.62,1.95,1.76,1.95Zm-30.61.47a11.42,11.42,0,0,1-7.74,3.07c-5.88,0-9.35-3.82-9.35-9.22s3.73-9.23,9-9.23c5.48,0,8.82,4.25,8.82,9.53,0,.66-.05,1.33-.05,1.33h-13.7c.51,2.59,2.1,4.22,5.28,4.22a7.37,7.37,0,0,0,5.21-2.17Zm-13-7.63h9.73c-.45-2.66-2.2-4.39-4.78-4.39s-4.39,1.79-5,4.39M120,109c0,3.83,1.58,5.42,4.83,5.42h1.78v-3.37h-.84c-1.2,0-1.87-.59-1.87-2.05V86.95H120Zm-10.95,2H109c-1,0-1.55-1.49-2.54-4.18l-1.64-4.52c-1.54-4.21-3.1-6.11-6.66-6.11-3,0-4.52,1.81-6.38,4.32L90.4,102.4,86,96.56H81.39l6.69,8.77-2.61,3.51c-1.34,1.8-2.16,2.34-3.31,2.34h-.78v3.28h1.67a4.91,4.91,0,0,0,4.41-2.27l2.86-4,4.6,6.29h4.69l-7-9.21,1.74-2.3c1.58-2.11,2.33-3.12,3.67-3.12s2.12,1.31,3.32,4.36l2,5.09c1.15,3,2.26,5.17,4.29,5.17h.26l-1,2.58c-.8,2-1.56,3.28-3.67,3.28h-.92v3.33h1.34c3.13,0,5.36-1.54,6.81-5.59l7.73-21.51H114Z"/>
</g>
</g>
</svg>
@@ -1,22 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
<PackageReference Include="nunit" Version="3.10.1" />
<PackageReference Include="NUnit3TestAdapter" Version="3.10.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" />
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.AspNetCore.Mvc.Abstractions">
<HintPath>..\..\..\..\..\..\..\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.aspnetcore.mvc.abstractions\2.1.1\lib\netstandard2.0\Microsoft.AspNetCore.Mvc.Abstractions.dll</HintPath>
</Reference>
</ItemGroup>
</Project>
@@ -1,171 +0,0 @@
namespace LaaProductionWeb.Tests.Models
{
using LaaProductionWeb.API.Models;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.ModelBinding;
using NUnit.Framework;
using System.Linq;
using System.Reflection;
public class ModelResultTests
{
[Test]
public void ModelResult_ShouldBeImplicitlyCreated_FromModelStateDictionary()
{
// Act
ModelResult<string> modelResult = default(ModelStateDictionary);
// Assert
Assert.IsNotNull(modelResult);
}
[Test]
public void ModelResult_ShouldInitializeModelErrors_WhenCreatedFrom_ModelStateDictionary()
{
// Act
ModelResult<string> modelResult = default(ModelStateDictionary);
// Assert
Assert.IsNotNull(modelResult.ModelErrors);
}
[Test]
public void ModelResult_ShouldNotSucceeded_WhenCreatedFrom_ModelStateDictionary()
{
// Act
ModelResult<string> modelResult = default(ModelStateDictionary);
// Assert
Assert.IsFalse(modelResult.Succeeded);
}
[Test]
public void ModelResult_ShouldBeImplicitlyCreated_FromOtherObjects()
{
// Act
ModelResult<dynamic> modelResult = default(object);
// Assert
Assert.IsNotNull(modelResult);
}
[Test]
public void ModelResult_ShouldSucceeded_WhenCreated_FromOtherObjects()
{
// Act
ModelResult<dynamic> modelResult = default(object);
// Assert
Assert.IsTrue(modelResult.Succeeded);
}
[Test]
public void ModelResult_ShouldHaveSameValue_WhenCreated_FromOtherObjects()
{
// Arrange
var value = nameof(ModelResult<dynamic>);
ModelResult<string> modelResult = value;
// Act
var fieldValue = typeof(ModelResult<string>)
.GetFields(BindingFlags.NonPublic | BindingFlags.Instance)
.FirstOrDefault(x => x.Name == nameof(value))
?.GetValue(modelResult);
// Assert
Assert.AreEqual(value, fieldValue);
}
[Test]
public void ModelResult_AddModelError_ShuldNotAddError_WhenKeyIsNull()
{
// Arrange
ModelResult<dynamic> modelResult = default(ModelStateDictionary);
var modelErrors = modelResult.ModelErrors;
// Act
var errorsCountBefore = modelErrors.Count;
modelResult.AddModelError(null, null);
var errorsCountAfter = modelErrors.Count;
// Assert
Assert.AreEqual(errorsCountBefore, errorsCountAfter);
}
[Test]
public void ModelResult_AddModelError_ShuldAddErrors_WhenKeyIsNotNull()
{
// Arrange
ModelResult<dynamic> modelResult = default(ModelStateDictionary);
var modelErrors = modelResult.ModelErrors;
// Act
var errorsCountBefore = modelErrors.Count;
modelResult.AddModelError(string.Empty, null);
var errorsCountAfter = modelErrors.Count;
// Assert
Assert.Greater(errorsCountAfter, errorsCountBefore);
}
[Test]
public void ModelResult_AddModelError_ShuldOverrideError_WhenKeyExists()
{
// Arrange
ModelResult<dynamic> modelResult = default(ModelStateDictionary);
var modelErrors = modelResult.ModelErrors;
// Act
modelResult.AddModelError(string.Empty, "1");
var valueBefore = modelErrors[string.Empty];
modelResult.AddModelError(string.Empty, "2");
var valueAfter = modelErrors[string.Empty];
// Assert
Assert.AreNotEqual(valueBefore, valueAfter);
}
[Test]
public void ModelResult_ReturnsNotFoundResult_WhenModelResult_IsNull()
{
// Arrange
ModelResult<dynamic> modelResult = null;
// Act
ActionResult actionResult = modelResult;
// Assert
Assert.AreEqual(actionResult.GetType(), typeof(NotFoundResult));
}
[Test]
public void ModelResult_ReturnsBadRequestObjectResult_WhenCreatedFrom_ModelStateDictionary()
{
// Arrange
ModelResult<dynamic> modelResult = default(ModelStateDictionary);
// Act
ActionResult actionResult = modelResult;
// Assert
Assert.AreEqual(actionResult.GetType(), typeof(BadRequestObjectResult));
}
[Test]
public void ModelResult_ReturnsOkObjectResult_WhenCreatedWhitValue()
{
// Arrange
ModelResult<dynamic> modelResult = default(string);
// Act
ActionResult actionResult = modelResult;
// Assert
Assert.AreEqual(actionResult.GetType(), typeof(OkObjectResult));
}
}
}
@@ -1,145 +0,0 @@
namespace LaaProductionWeb.Tests.Models
{
using LaaProductionWeb.API.Areas.Serach.Models;
using NUnit.Framework;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Reflection;
public class WildcardInputModelTests
{
private readonly WildcardInputModel model;
private readonly PropertyInfo tokenPropertyInfo;
public WildcardInputModelTests()
{
this.model = new WildcardInputModel();
this.tokenPropertyInfo = typeof(WildcardInputModel)
.GetProperty(nameof(WildcardInputModel.Token), BindingFlags.Instance | BindingFlags.Public);
}
[Test]
public void ModelValidation_ShouldNotValidate_WhenTokenIsNull()
{
// Arrange
var errorMessage = this.ValidateModelWhitValue(default(string));
// Act
var attributeMessage = this.GetAttributeMessage<RequiredAttribute>();
// Assert
Assert.AreEqual(errorMessage, attributeMessage);
}
[Test]
public void ModelValidation_ShouldNotValidate_WhenTokenIsUnder_1CharLength()
{
// Arrange
var errorMessage = this.ValidateModelWhitValue(string.Empty);
// Act
var attributeMessage = this.GetAttributeMessage<StringLengthAttribute>();
// Assert
Assert.AreEqual(errorMessage, attributeMessage);
}
[Test]
public void ModelValidation_ShouldNotValidate_WhenTokenIsOver_50CharsLength()
{
// Arrange
var errorMessage = this.ValidateModelWhitValue(new string('0', 51));
// Act
var attributeMessage = this.GetAttributeMessage<StringLengthAttribute>();
// Assert
Assert.AreEqual(errorMessage, attributeMessage);
}
[Test]
[TestCase("^")]
[TestCase("°")]
[TestCase("\"")]
[TestCase("§")]
[TestCase("$")]
[TestCase("%")]
[TestCase("&")]
[TestCase("/")]
[TestCase("(")]
[TestCase(")")]
[TestCase("=")]
[TestCase("?")]
[TestCase("`")]
[TestCase("´")]
[TestCase("'")]
[TestCase("#")]
[TestCase("*")]
[TestCase("+")]
[TestCase("|")]
[TestCase("\t")]
[TestCase("\n")]
[TestCase("<")]
[TestCase(">")]
[TestCase(".")]
[TestCase(";")]
[TestCase(":")]
[TestCase("_")]
[TestCase("ä")]
[TestCase("ö")]
[TestCase("ü")]
[TestCase("Ä")]
[TestCase("Ö")]
[TestCase("Ü")]
[TestCase("ß")]
public void ModelValidation_ShouldNotValidate_WhenTokenContains_NonWordCharachters(string token)
{
// Arrange
var errorMessage = this.ValidateModelWhitValue(token);
// Act
var attributeMessage = this.GetAttributeMessage<RegularExpressionAttribute>();
// Assert
Assert.AreEqual(errorMessage, attributeMessage);
}
[Test]
[TestCase("0123245 5575689-ARWQGVVJALR fasdkfawe irfoelvm")]
public void ModelValidation_ShouldValidate_WhenTokenIsValidNr(string token)
{
// Arrange
var nullMessage = default(string);
// Act
var errorMessage = this.ValidateModelWhitValue(token);
// Assert
Assert.AreEqual(errorMessage, nullMessage);
}
private string ValidateModelWhitValue(string value)
{
var validationResults = new List<ValidationResult>();
var validationContext = new ValidationContext(this.model);
if (Validator.TryValidateObject(this.model, validationContext, validationResults))
{
return validationResults
.Where(x => x.MemberNames.Contains(nameof(WildcardInputModel.Token)))
.FirstOrDefault(x => !string.IsNullOrWhiteSpace(x.ErrorMessage))
?.ErrorMessage ?? default(string);
}
return default(string);
}
private string GetAttributeMessage<T>() where T : ValidationAttribute
=> this.tokenPropertyInfo
.GetCustomAttribute<RequiredAttribute>()
.ErrorMessage;
}
}
@@ -1,17 +0,0 @@
namespace LaaProductionWeb.API.Areas.Account.Controllers
{
using LaaProductionWeb.Services.Interfaces;
using Microsoft.AspNetCore.Mvc;
[ApiController]
[Area("Account")]
[Route("[area]/[controller]")]
public class AccountBaseController : ControllerBase
{
protected readonly IAccountService accountService;
public AccountBaseController(IAccountService accountService)
=> this.accountService = accountService;
}
}
@@ -1,40 +0,0 @@
namespace LaaProductionWeb.API.Areas.Account.Controllers
{
using LaaProductionWeb.Standart.Interfaces;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
public class FunctionsController : AccountBaseController
{
public FunctionsController(IAccountService accountService) : base(accountService)
{
}
[HttpGet]
public ActionResult<IEnumerable<string>> Get([FromHeader(Name = "Authorization")]string bearer)
{
var values = bearer
.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)
.Select(x => Encoding.UTF8.GetString(Convert.FromBase64String(x)))
.LastOrDefault()
?.Split(new[] { ':' }, StringSplitOptions.RemoveEmptyEntries)
?? Array.Empty<string>();
if (values.Length != 3 || !short.TryParse(values[0], out short appId))
{
return this.BadRequest("Endpoint expects bearer authorization header with appId:username:password base64 encoded.");
}
var username = values[1];
var password = values[2];
var functions = this.accountService.FindUserFunctions(appId, username, password);
return this.Ok(functions);
}
}
}
@@ -1,39 +0,0 @@
namespace LaaProductionWeb.API.Areas.Account.Controllers
{
using LaaProductionWeb.Standart.Interfaces;
using Microsoft.AspNetCore.Mvc;
public class PWDController : AccountBaseController
{
public PWDController(IAccountService accountService) : base(accountService)
{
}
[HttpPost]
public IActionResult Post([FromForm(Name = "username")]string username, [FromForm(Name = "password")]string password)
{
if (string.IsNullOrWhiteSpace(password))
{
return this.BadRequest("Invalid password.");
}
else if (this.accountService.ResetPassword(username, password) == 1)
{
return this.Ok();
}
return this.BadRequest("Password was not reseted.");
}
[HttpDelete("{username}")]
public IActionResult Delete(string username)
{
if (this.accountService.ResetPassword(username) == 1)
{
return this.Ok();
}
return this.BadRequest("Password was not reseted.");
}
}
}
@@ -1,10 +0,0 @@
namespace LaaProductionWeb.API.Areas
{
using Microsoft.AspNetCore.Mvc;
[ApiController]
[Route("[area]/[controller]")]
public class AreaController : ControllerBase
{
}
}
@@ -1,23 +0,0 @@
namespace LaaProductionWeb.API.Areas.Serach.Controllers
{
using LaaProductionWeb.API.Areas.Serach.Models;
using LaaProductionWeb.API.Areas.Serach.Models.Interfaces;
using Microsoft.AspNetCore.Mvc;
public class WildcardController : SearchController
{
private readonly IWildcardModel wildcardModel;
public WildcardController(IWildcardModel wildcardModel)
=> this.wildcardModel = wildcardModel;
[HttpOptions]
public ActionResult Options()
=> this.wildcardModel.Options();
[HttpGet]
public ActionResult Get([FromQuery] WildcardInputModel model)
=> this.wildcardModel.Find(this.ModelState, model);
}
}

Some files were not shown because too many files have changed in this diff Show More