diff --git a/Common/LaaProduction/LaaProduction.csproj b/Common/LaaProduction/LaaProduction.csproj new file mode 100644 index 00000000..77173699 --- /dev/null +++ b/Common/LaaProduction/LaaProduction.csproj @@ -0,0 +1,57 @@ + + + + + Debug + AnyCPU + {FD30EB7A-7809-4E62-9374-791D31877D6D} + Library + Properties + LaaProduction + LaaProduction + v4.8.1 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\LaaProductionHttp.1.0.0\lib\netstandard2.0\LaaProductionHttp.dll + + + ..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Common/LaaProduction/Properties/AssemblyInfo.cs b/Common/LaaProduction/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..353c87ff --- /dev/null +++ b/Common/LaaProduction/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +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("LaaProduction")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("LaaProduction")] +[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("fd30eb7a-7809-4e62-9374-791d31877d6d")] + +// 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 Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Common/LaaProduction/Pruefstation.cs b/Common/LaaProduction/Pruefstation.cs new file mode 100644 index 00000000..c0d9d3ae --- /dev/null +++ b/Common/LaaProduction/Pruefstation.cs @@ -0,0 +1,95 @@ +namespace LaaProduction +{ + using LaaProductionHttp; + using LaaProductionHttp.Interfaces; + + using System; + using System.Collections.Generic; + + public class Pruefstation + { + private readonly IHttpClient httpClient; + + private string bearer; + private int stationId; + private string stationName; + private IEnumerable equipments; + + + public Pruefstation() + => this.httpClient = HttpClient.CreateHttpClient("http://sla12iis01.emea.sensus.net", "/LaaProductionWeb/api"); + + public async void Initialize(string exe, string username, string password) + { + if (!this.TryGetAssemblyInfo(exe, out string assembly, out int majorV, out int minorV, out int buildV)) + { + return; + } + + var bearer = await this.httpClient + .Post("/Login/Local") + .WhitJsonBody(new + { + assembly, + majorV, + minorV, + buildV, + username, + password + }) + .SendAsync(); + + if (!bearer.Succeeded) + { + return; + } + } + + private bool TryGetAssemblyInfo(string exe, out string assembly, out int majorV, out int minorV, out int buildV) + { + assembly = string.Empty; + majorV = default(int); + minorV = default(int); + buildV = default(int); + + if (string.IsNullOrWhiteSpace(exe)) + { + return false; + } + + var exeTokens = exe.Split(new[] { '.' }); + + if (exeTokens.Length != 4) + { + return false; + } + + var index = 0; + assembly = exeTokens[index++]; + _ = int.TryParse(exeTokens[index++], out majorV); + _ = int.TryParse(exeTokens[index++], out minorV); + _ = int.TryParse(exeTokens[index++], out buildV); + + return true; + } + + internal class Equipment + { + public int Id { get; set; } + + public string Nr { get; set; } + + public string Name { get; set; } + + public bool Required { get; set; } + + public bool Inspected { get; set; } + + public int InspectionSpan { get; set; } + + public DateTime? LastInspection { get; set; } + + public DateTime? NextInspection { get; set; } + } + } +} diff --git a/Common/Service/ProductionService/CordonelMetersFinalCheck.cs b/Common/Service/ProductionService/CordonelMetersFinalCheck.cs index c9c411c0..a8578694 100644 --- a/Common/Service/ProductionService/CordonelMetersFinalCheck.cs +++ b/Common/Service/ProductionService/CordonelMetersFinalCheck.cs @@ -13,7 +13,6 @@ using System.Data.SqlClient; namespace ProductionService { - public partial class CordonelMetersFinalCheck : ServiceBase { private Timer timer; @@ -47,7 +46,6 @@ namespace ProductionService SqlCommand command = new SqlCommand("SELECT COUNT(*) FROM MyTable", sqlConnection); int count = (int)command.ExecuteScalar(); // Do something with the count here - } } } diff --git a/LaaProductionWeb/LaaProduction.Personalization/AccountManager.cs b/LaaProductionWeb/LaaProduction.Personalization/AccountManager.cs index c3785709..cf8920f1 100644 --- a/LaaProductionWeb/LaaProduction.Personalization/AccountManager.cs +++ b/LaaProductionWeb/LaaProduction.Personalization/AccountManager.cs @@ -14,8 +14,8 @@ public class AccountManager : IAccountManager { - private static IIdentity anonymous - => new ClaimsIdentity( + private static readonly IIdentity anonymous + = new ClaimsIdentity( claims: Array.Empty(), authenticationType: string.Empty, nameType: string.Empty, @@ -30,26 +30,6 @@ this.softwareRepository = LaaServiceProvider.GetService(); } - public string GetAuthToken(string username, string password, string software) - { - var userId = this.employeesRepository.EmployeeId(username, password); - var token = default(string); - - if (userId > 0) - { - var appId = this.softwareRepository.AppId(software); - - if (appId > 0) - { - this.employeesRepository.CreateToken(appId, userId); - - token = this.employeesRepository.GetToken(appId, userId); - } - } - - return token; - } - public IPrincipal GetClaimsPrincipal(string token) { var claimsIdentity = anonymous; @@ -137,9 +117,7 @@ return default(string); } - this.employeesRepository.CreateToken(softwareId, employeeNr); - - return this.employeesRepository.GetToken(softwareId, employeeNr); + return this.GetÓrCreateAuthToken(softwareId, employeeNr); } public string Login(UserLoginModel model) @@ -162,9 +140,7 @@ return default(string); } - this.employeesRepository.CreateToken(softwareId, employeeNr); - - return this.employeesRepository.GetToken(softwareId, employeeNr); + return this.GetÓrCreateAuthToken(softwareId, employeeNr); } public void ResetPassword(short employeeId) @@ -178,7 +154,7 @@ private short GetOrCreateSoftwareId(string assembly, int major, int minor, int build) { - var softwareId = this.softwareRepository.SoftwareId(assembly, major, minor, build); + var softwareId = this.softwareRepository.SoftwareId(assembly); if (softwareId <= 0) { @@ -187,5 +163,19 @@ return softwareId; } + + public string GetÓrCreateAuthToken(short appId, short userId) + { + var token = default(string); + + if (appId > 0 && userId > 0) + { + this.employeesRepository.CreateToken(appId, userId); + + token = this.employeesRepository.GetToken(appId, userId); + } + + return token; + } } } diff --git a/LaaProductionWeb/LaaProduction.Personalization/EmployeesRoles.cs b/LaaProductionWeb/LaaProduction.Personalization/EmployeesRoles.cs index a5490f79..20e7f561 100644 --- a/LaaProductionWeb/LaaProduction.Personalization/EmployeesRoles.cs +++ b/LaaProductionWeb/LaaProduction.Personalization/EmployeesRoles.cs @@ -1,4 +1,3 @@ - namespace LaaProduction.Personalization { public enum EmployeesRoles diff --git a/LaaProductionWeb/LaaProduction.Personalization/EquipmentsManager.cs b/LaaProductionWeb/LaaProduction.Personalization/EquipmentsManager.cs new file mode 100644 index 00000000..b542a358 --- /dev/null +++ b/LaaProductionWeb/LaaProduction.Personalization/EquipmentsManager.cs @@ -0,0 +1,8 @@ +namespace LaaProduction.Personalization +{ + using LaaProduction.Personalization.Interfaces; + + public class EquipmentsManager : IEquipmentsManager + { + } +} diff --git a/LaaProductionWeb/LaaProduction.Personalization/Interfaces/IAccountManager.cs b/LaaProductionWeb/LaaProduction.Personalization/Interfaces/IAccountManager.cs index 6eff72c8..8ad6fe94 100644 --- a/LaaProductionWeb/LaaProduction.Personalization/Interfaces/IAccountManager.cs +++ b/LaaProductionWeb/LaaProduction.Personalization/Interfaces/IAccountManager.cs @@ -6,8 +6,6 @@ public interface IAccountManager { - string GetAuthToken(string username, string password, string software); - IPrincipal GetClaimsPrincipal(string token); string Login(ADLoginModel model); diff --git a/LaaProductionWeb/LaaProduction.Personalization/Interfaces/IEquipmentsManager.cs b/LaaProductionWeb/LaaProduction.Personalization/Interfaces/IEquipmentsManager.cs new file mode 100644 index 00000000..9bae5837 --- /dev/null +++ b/LaaProductionWeb/LaaProduction.Personalization/Interfaces/IEquipmentsManager.cs @@ -0,0 +1,6 @@ +namespace LaaProduction.Personalization.Interfaces +{ + public interface IEquipmentsManager + { + } +} diff --git a/LaaProductionWeb/LaaProduction.Personalization/LaaProduction.Personalization.csproj b/LaaProductionWeb/LaaProduction.Personalization/LaaProduction.Personalization.csproj index 87671658..119652b9 100644 --- a/LaaProductionWeb/LaaProduction.Personalization/LaaProduction.Personalization.csproj +++ b/LaaProductionWeb/LaaProduction.Personalization/LaaProduction.Personalization.csproj @@ -47,7 +47,9 @@ + + @@ -62,8 +64,10 @@ + + diff --git a/LaaProductionWeb/LaaProduction.Personalization/PersonalizationExtensions.cs b/LaaProductionWeb/LaaProduction.Personalization/PersonalizationExtensions.cs index 68df9f74..16e42cba 100644 --- a/LaaProductionWeb/LaaProduction.Personalization/PersonalizationExtensions.cs +++ b/LaaProductionWeb/LaaProduction.Personalization/PersonalizationExtensions.cs @@ -10,12 +10,13 @@ public static LaaServiceCollection AddAdministration(this LaaServiceCollection services) => services .AddScoped() + .AddScoped() .AddScoped() .AddScoped() .AddScoped() .AddScoped() .AddScoped() + .AddScoped() .AddScoped(); - } } diff --git a/LaaProductionWeb/LaaProduction.Personalization/README.md b/LaaProductionWeb/LaaProduction.Personalization/README.md index ad865c47..7cf7ffd6 100644 --- a/LaaProductionWeb/LaaProduction.Personalization/README.md +++ b/LaaProductionWeb/LaaProduction.Personalization/README.md @@ -7,4 +7,36 @@ [Auftrag].[dbo].[SoftwareFunctions] [Auftrag].[dbo].[SoftwareFunctionsLog] [Auftrag].[dbo].[UsersFunctions] -[Auftrag].[dbo].[VersionSoftwareAccess] \ No newline at end of file +[Auftrag].[dbo].[VersionSoftwareAccess] + +CREATE TABLE [PruefmittelPruefung] ( -- Automatisiert die pruefmittel pruefung benachrichtigung + [PruefmittelId] INT PRIMARY KEY NOT NULL IDENTITY(1, 1), -- Pruefmittel Id + [Pruefstation] VARCHAR(100) NOT NULL, -- Pruefstation bezeichnung + [Pruefmittel] VARCHAR(100) NOT NULL, -- Pruefmittel - anlage, referenzzähler, wage etc. + [PruefmittelNr] VARCHAR(30) NOT NULL, -- Eindeutige pruefmittel nummer + [Pruefabstand] INT NOT NULL, -- Die zeit (Tagen) nach die pruefmittel sollen wieder geprueft werden + [Erforderlich] BIT NOT NULL DEFAULT(0), -- Is die pruefung staatlich erforderlich + [PruefdatumIst] DATETIME NULL, -- Letzte pruefdatumg + [PruefdatumSoll] DATETIME NULL, -- Nexte pruefdatum - automatisch generiert aus letzte pruefdatum und die zeit bis nexte pruefung + [PruefdatumWird] DATETIME NULL, -- Geplanter Prüfungstermin. Wenn Gesetz, werden keine E-Mails mehr gesendet + [Geprueft] BIT NOT NULL DEFAULT(0), -- Die pruefergebniss geprueft oder nicht + [Bezeichnung] NVARCHAR(250) NULL +); + +CREATE UNIQUE INDEX [UX_PruefmittelPruefung] + ON [PruefmittelPruefung] ( + [Pruefstation] + , [PruefmittelNr]); + +CREATE TABLE [PruefmittelPruefer] ( -- verantwortliche für prüfmittelprüfung + [PruefmittelId] INT NOT NULL, -- welche prüfmittel + [PrueferEmail] VARCHAR(250) NOT NULL, -- an welche prüefer/leiter/verantwortlicher email + [Subject] NVARCHAR(250) NOT NULL, -- nachricht bezeichnung + [Body] NVARCHAR(250) NOT NULL, -- nachricht inhalt + [Begin] INT NOT NULL DEFAULT (14) -- ab wann soll der E-Mail verschickt werden beispiel : 14-er tag than -> 7, 3, 1 vor dem prüfungs ablauf +); + +CREATE UNIQUE INDEX [UX_PruefmittelPruefer] + ON [PruefmittelPruefer] ( + [PruefmittelId] + , [PrueferEmail]); \ No newline at end of file diff --git a/LaaProductionWeb/LaaProduction.Personalization/Repositories/EquipmentsRepository.cs b/LaaProductionWeb/LaaProduction.Personalization/Repositories/EquipmentsRepository.cs new file mode 100644 index 00000000..77a4aa4a --- /dev/null +++ b/LaaProductionWeb/LaaProduction.Personalization/Repositories/EquipmentsRepository.cs @@ -0,0 +1,8 @@ +namespace LaaProduction.Personalization.Repositories +{ + using LaaProduction.Personalization.Repositories.Interfaces; + + internal class EquipmentsRepository : IEquipmentsRepository + { + } +} diff --git a/LaaProductionWeb/LaaProduction.Personalization/Repositories/Interfaces/IEquipmentsRepository.cs b/LaaProductionWeb/LaaProduction.Personalization/Repositories/Interfaces/IEquipmentsRepository.cs new file mode 100644 index 00000000..87518374 --- /dev/null +++ b/LaaProductionWeb/LaaProduction.Personalization/Repositories/Interfaces/IEquipmentsRepository.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace LaaProduction.Personalization.Repositories.Interfaces +{ + internal interface IEquipmentsRepository + { + } +} diff --git a/LaaProductionWeb/LaaProduction.Personalization/Repositories/Interfaces/ISoftwareRepository.cs b/LaaProductionWeb/LaaProduction.Personalization/Repositories/Interfaces/ISoftwareRepository.cs index 9058ae29..34bd0558 100644 --- a/LaaProductionWeb/LaaProduction.Personalization/Repositories/Interfaces/ISoftwareRepository.cs +++ b/LaaProductionWeb/LaaProduction.Personalization/Repositories/Interfaces/ISoftwareRepository.cs @@ -25,7 +25,7 @@ IEnumerable List(); - short SoftwareId(string assembly, int major, int minor, int build); + short SoftwareId(string assembly); IEnumerable Versions(short softwareId); } diff --git a/LaaProductionWeb/LaaProduction.Personalization/Repositories/SoftwareRepository.cs b/LaaProductionWeb/LaaProduction.Personalization/Repositories/SoftwareRepository.cs index 804c945a..382a0825 100644 --- a/LaaProductionWeb/LaaProduction.Personalization/Repositories/SoftwareRepository.cs +++ b/LaaProductionWeb/LaaProduction.Personalization/Repositories/SoftwareRepository.cs @@ -182,20 +182,13 @@ Description = x.GetString(), }); - public short SoftwareId(string assembly, int major, int minor, int build) + public short SoftwareId(string assembly) => this.sqlConnection .CreateCommand($@" SELECT [AppId] FROM [VersionSoftwareAccess] - WHERE [SoftwareAccess_Program] = @{nameof(assembly)} - AND [SoftwareAccess_MajorVersion] = @{nameof(major)} - AND [SoftwareAccess_MinorVersion] = @{nameof(minor)} - AND [SoftwareAccess_BuildVersion] = @{nameof(build)} - AND [SoftwareAccess_VaildTo] > GETDATE()") + WHERE [SoftwareAccess_Program] = @{nameof(assembly)}") .SetParameter(nameof(assembly), assembly) - .SetParameter(nameof(major), major) - .SetParameter(nameof(minor), minor) - .SetParameter(nameof(build), build) .FirstOrDefault(x => x.GetSmallint()); public IEnumerable Versions(short softwareId) diff --git a/LaaProductionWeb/LaaProduction.Services/Interfaces/ILoggerService.cs b/LaaProductionWeb/LaaProduction.Services/Interfaces/ILoggerService.cs deleted file mode 100644 index 8e9121f4..00000000 --- a/LaaProductionWeb/LaaProduction.Services/Interfaces/ILoggerService.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace LaaProduction.Services.Interfaces -{ - using System; - - public interface ILoggerService - { - void Log(Action logModel); - } -} diff --git a/LaaProductionWeb/LaaProduction.Services/Interfaces/ISearchService.cs b/LaaProductionWeb/LaaProduction.Services/Interfaces/ISearchService.cs deleted file mode 100644 index 20a695a6..00000000 --- a/LaaProductionWeb/LaaProduction.Services/Interfaces/ISearchService.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace LaaProduction.Services.Interfaces -{ - using LaaProduction.Services.Models; - - using System.Collections.Generic; - - public interface ISearchService - { - IEnumerable Find(WildcardInputModel model); - - IEnumerable Options(); - } -} diff --git a/LaaProductionWeb/LaaProduction.Services/Interfaces/ISoftwareService.cs b/LaaProductionWeb/LaaProduction.Services/Interfaces/ISoftwareService.cs deleted file mode 100644 index 230c703a..00000000 --- a/LaaProductionWeb/LaaProduction.Services/Interfaces/ISoftwareService.cs +++ /dev/null @@ -1,42 +0,0 @@ -namespace LaaProduction.Services.Interfaces -{ - using LaaProduction.Services.Models.Software; - using System; - using System.Collections.Generic; - - public interface ISoftwareService - { - void AddFunction(short appId, string name); - - void DeleteFunction(int funcId); - - short FindAndUpdateSoftware(string windowsUser, string software, IEnumerable functions); - - IEnumerable GetAllSoftwareFunctions(); - - IEnumerable GetSoftwareFunctions(short appId); - - IEnumerable GetSoftwareFunctions(short appId, short userId); - - SoftwareOverview GetSoftwareOverview(short appId); - - IEnumerable GetSoftwareVersions(short appId); - IEnumerable GetSoftwares(); - - IEnumerable GetUsers(string username = null); - - IEnumerable GetUsersWithFunctions(int id = -1, string username = null); - - int ResetPassword(short userId); - - int ResetPassword(short userId, string password); - - void UpdateFunction(int funcId, string name); - - void UpdateUsersFunctions(Action mapper); - - void UpdateUsersFunctions(Action mapper); - - void UpdatePasswordHashes(); - } -} diff --git a/LaaProductionWeb/LaaProduction.Services/LaaProduction.Services.csproj b/LaaProductionWeb/LaaProduction.Services/LaaProduction.Services.csproj index 88202dfa..a76dc59a 100644 --- a/LaaProductionWeb/LaaProduction.Services/LaaProduction.Services.csproj +++ b/LaaProductionWeb/LaaProduction.Services/LaaProduction.Services.csproj @@ -55,14 +55,10 @@ - - - - @@ -110,9 +106,7 @@ - - diff --git a/LaaProductionWeb/LaaProduction.Services/LoggerService.cs b/LaaProductionWeb/LaaProduction.Services/LoggerService.cs deleted file mode 100644 index f9ef601c..00000000 --- a/LaaProductionWeb/LaaProduction.Services/LoggerService.cs +++ /dev/null @@ -1,54 +0,0 @@ -namespace LaaProduction.Services -{ - using LaaProductionSQL.Interfaces; - using LaaProduction.Services.Interfaces; - - using System; - - public class LoggerService : ILoggerService - { - private readonly ISQLConnection sqlConnection; - - public LoggerService(ISQLConnection sqlConnection) - => this.sqlConnection = sqlConnection; - - public class Actions - { - public const string RUN = nameof(RUN); - } - - public class LogModel - { - public long Id { get; internal set; } - - public DateTime Date { get; internal set; } - = DateTime.Now; - - public string User { get; set; } - - public string Action { get; set; } - - public string Data { get; set; } - } - - public void Log(Action logModel) - { - var model = new LogModel(); - logModel?.Invoke(model); - - this.sqlConnection - .CreateCommand($@" - INSERT INTO [SoftwareFunctionsLog] ( - [User] - , [Action] - , [Data]) - VALUES (@{nameof(model.User)} - , @{nameof(model.Action)} - , @{nameof(model.Data)})") - .SetParameter(nameof(model.User), model.User) - .SetParameter(nameof(model.Action), model.Action) - .SetParameter(nameof(model.Data), model.Data) - .ExecuteNonQuery(); - } - } -} diff --git a/LaaProductionWeb/LaaProduction.Services/SearchService.cs b/LaaProductionWeb/LaaProduction.Services/SearchService.cs deleted file mode 100644 index e8e2e203..00000000 --- a/LaaProductionWeb/LaaProduction.Services/SearchService.cs +++ /dev/null @@ -1,129 +0,0 @@ -namespace LaaProduction.Services -{ - using LaaProductionSQL.Interfaces; - using LaaProduction.Services.Models; - using LaaProduction.Services.Interfaces; - - using System.Collections.Generic; - - public class SearchService : ISearchService - { - private readonly ISQLConnection sqlConnection; - - public SearchService(ISQLConnection sqlConnection) - => this.sqlConnection = sqlConnection; - - public IEnumerable Find(WildcardInputModel model) - { - var requiredFields = model.GetRequiredFields(this.Options()); - var ordersFound = sqlConnection - .CreateCommand($@" - DECLARE @serienNr TABLE([Nr] VARCHAR(50)); - ----------------------------------------------------------------------------- - -- 1. LOOK FOR SERIAL NUMBER ------------------------------------------------ - ----------------------------------------------------------------------------- - INSERT INTO @serienNr - SELECT [APS].[SerienNr] - FROM [AuftragPositionSerienNr] AS [APS] - WHERE [APS].[SerienNr] LIKE @{nameof(model.Token)} - OR REPLACE([APS].[KundeneigeneSerienNr], ' ', '') LIKE @{nameof(model.Token)}; - ----------------------------------------------------------------------------- - -- 2. LOOK FOR PCB NUMBER --------------------------------------------------- - ----------------------------------------------------------------------------- - INSERT INTO @serienNr - SELECT [PCBS].[MapPcbIdToSerialNumber_SerialNumber] - FROM [MapPcbIdToSerialNumber] AS [PCBS] - WHERE [PCBS].[MapPcbIdToSerialNumber_PcbId] LIKE @{nameof(model.Token)}; - ----------------------------------------------------------------------------- - -- 3. LOOK FOR FUNK ADDRESS E-REGISTER -------------------------------------- - ----------------------------------------------------------------------------- - INSERT INTO @serienNr - SELECT [ER].[Seriennummer] - FROM [eRegister] AS [ER] - WHERE [ER].[Adresse] LIKE @{nameof(model.Token)}; - ----------------------------------------------------------------------------- - -- 4. LOOK FOR FUNK ADDRESS GENESIS ----------------------------------------- - ----------------------------------------------------------------------------- - INSERT INTO @serienNr - SELECT [GM].[Seriennummer] - FROM [Genesis_Meter] AS [GM] - WHERE [GM].[Adresse] LIKE @{nameof(model.Token)}; - ----------------------------------------------------------------------------- - -- 5. TAKE ORDERS INFO ------------------------------------------------------ - ----------------------------------------------------------------------------- - SELECT DISTINCT - [KN].[KundenNr] AS [CustomerNo] - , [KN].[Name] AS [Customer] - , [AP].[FertigungsauftragNr] AS [ProductionOrderNo] - , [APS].[AuftragNr] AS [CustomerOrderNo] - , [APS].[PositionNr] AS [PosNo] - , [APS].[SerienNr] AS [SerialNo] - , [APS].[KundeneigeneSerienNr] AS [CustomerSerialNo] - , [IDN].[KurzBez] AS [KurzBez] - , [IDN].[Typ] AS [Typ] - , [IDN].[Nennweite] AS [Nennweite] - , [IDN].[Baulaenge] AS [Baulaenge] - , [AP].[Menge] AS [Quantity] - , [APS].[FabNr] AS [FabricNo] - , [IDN].[IdentNr] AS [IdentNr] - , [PCBS].[MapPcbIdToSerialNumber_PcbId] AS [PcbId] - , [ER].[Adresse] AS [ErRadioAddress] - , [GM].[Adresse] AS [GmRadioAddress] - FROM [AuftragPositionSerienNr] AS [APS] - LEFT JOIN [AuftragPosition_Gesamt] AS [AP] - ON [AP].[AuftragNr] = [APS].[AuftragNr] - AND [AP].[PositionNr] = [APS].[PositionNr] - LEFT JOIN [Auftrag_Gesamt] AS [AG] - ON [AG].[AuftragNr] = [APS].[AuftragNr] - LEFT JOIN [Kunde] AS [KN] - ON [KN].[KundenNr] = [AG].[KundenNr] - LEFT JOIN [Identnr] AS [IDN] - ON [IDN].[IdentNr] = [AP].[Identnr] - LEFT JOIN [MapPcbIdToSerialNumber] AS [PCBS] - ON [PCBS].[MapPcbIdToSerialNumber_SerialNumber] = [APS].[SerienNr] - LEFT JOIN [eRegister] AS [ER] - ON [ER].[Seriennummer] = [APS].[SerienNr] - LEFT JOIN [Genesis_Meter] AS [GM] - ON [GM].[Seriennummer] = [APS].[SerienNr] - WHERE [APS].[SerienNr] IN (SELECT [Nr] FROM @serienNr)") - .SetParameter(nameof(model.Token), $"%{model.Token}%") - .ExecuteReader(reader => this.ToWildcardResult(reader, requiredFields)); - - return ordersFound; - } - - public IEnumerable Options() - => new string[] - { - "CustomerNo", - "Customer", - "ProductionOrderNo", - "CustomerOrderNo", - "PosNo", - "SerialNo", - "CustomerSerialNo", - "KurzBez", - "Typ", - "Nennweite", - "Baulaenge", - "Quantity", - "FabricNo", - "IdentNr", - "PcbId", - "ErRadioAddress", - "GmRadioAddress", - }; - - internal WildcardResult ToWildcardResult(ISQLReader reader, IEnumerable fields) - { - var wildcardResult = new WildcardResult(); - - foreach (var field in fields) - { - wildcardResult[field] = reader.GetValue(field); - } - - return wildcardResult; - } - } -} diff --git a/LaaProductionWeb/LaaProduction.Services/SoftwareService.cs b/LaaProductionWeb/LaaProduction.Services/SoftwareService.cs deleted file mode 100644 index 30116467..00000000 --- a/LaaProductionWeb/LaaProduction.Services/SoftwareService.cs +++ /dev/null @@ -1,393 +0,0 @@ -namespace LaaProduction.Services -{ - using LaaProductionSQL.Interfaces; - using LaaProduction.Services.Interfaces; - using LaaProduction.Services.Models.Software; - - using System; - using System.Collections.Generic; - using System.Linq; - using System.Security.Cryptography; - using System.Text.RegularExpressions; - - public class SoftwareService : ISoftwareService - { - private readonly ISQLConnection sqlConnection; - - public SoftwareService(ISQLConnection sqlConnection) - => this.sqlConnection = sqlConnection; - - public void AddFunction(short appId, string name) - => this.sqlConnection - .CreateCommand($@" - INSERT INTO [SoftwareFunctions] ( - [AppId] - , [Function]) - VALUES (@{nameof(appId)} - , @{nameof(name)})") - .SetParameter(nameof(appId), appId) - .SetParameter(nameof(name), name) - .ExecuteNonQuery(); - - public int ApplicationId(string name) - => this.sqlConnection - .CreateCommand($@" - SELECT TOP 1 [AppId] - FROM [VersionSoftwareAccess] - WHERE [SoftwareAccess_Program] = @{nameof(name)}") - .SetParameter(nameof(name), name) - .FirstOrDefault(x => x.GetSmallint()); - - public void DeleteFunction(int funcId) - { - this.sqlConnection - .CreateCommand($@" - DELETE FROM [SoftwareFunctions] - WHERE [Id] = @{nameof(funcId)}") - .SetParameter(nameof(funcId), funcId) - .ExecuteNonQuery(); - - this.sqlConnection - .CreateCommand($@" - DELETE FROM [UsersFunctions] - WHERE [SoftwareFunctionId] = @{nameof(funcId)}") - .SetParameter(nameof(funcId), funcId) - .ExecuteNonQuery(); - } - - public short FindAndUpdateSoftware(string windowsUser, string name, IEnumerable functions) - { - var appId = this.sqlConnection - .CreateCommand($@" - SELECT TOP 1 [AppId] - , MAX([SoftwareAccess_VaildTo]) OVER (PARTITION BY [AppId]) - FROM [VersionSoftwareAccess] - WHERE [SoftwareAccess_Program] = @{nameof(name)} - AND [SoftwareAccess_VaildTo] > GETDATE()") - .SetParameter(nameof(name), name) - .FirstOrDefault(x => x.GetSmallint()); - - if (appId > 0) - { - if (functions != null && functions.Any()) - { - - foreach (var function in functions) - { - if (Regex.IsMatch(function, "[a-zA-Z_]+")) - { - this.AddFunction(appId, function); - } - } - } - } - - return appId; - } - - public IEnumerable GetAllSoftwareFunctions() - => this.sqlConnection - .CreateCommand($@" - SELECT [Id] - , [AppId] - , [Function] - FROM [SoftwareFunctions]") - .ExecuteReader(f => new SoftwareFunction - { - Id = f.GetInt(), - AppId = f.GetSmallint(), - Function = f.GetString() - }); - - public IEnumerable GetSoftwareFunctions(short appId) - => this.sqlConnection - .CreateCommand($@" - SELECT [Id] - , [AppId] - , [Function] - FROM [SoftwareFunctions] - WHERE [AppId] = @{nameof(appId)}") - .SetParameter(nameof(appId), appId) - .ExecuteReader(f => new SoftwareFunction - { - Id = f.GetInt(), - AppId = f.GetSmallint(), - Function = f.GetString() - }); - - public IEnumerable GetSoftwareFunctions(short appId, short userId) - => this.sqlConnection - .CreateCommand($@" - SELECT [SF].[Function] AS [Function] - FROM [UsersFunctions] AS [UF] - JOIN [SoftwareFunctions] AS [SF] - ON [SF].[Id] = [UF].[SoftwareFunctionId] - WHERE [UF].[UserId] = @{nameof(userId)} - AND [SF].[AppId] = @{nameof(appId)}") - .SetParameter(nameof(appId), appId) - .SetParameter(nameof(userId), userId) - .ExecuteReader(x => x.GetString()); - - public SoftwareOverview GetSoftwareOverview(short appId) - => this.sqlConnection - .CreateCommand($@" - SELECT [vsa].[AppID] - , [vsa].[SoftwareAccess_Program] - , COUNT([vsa].[AppID]) - , (SELECT COUNT(1) - FROM [SoftwareFunctions] - WHERE [AppId] = [vsa].[AppID]) AS [CountF] - FROM [VersionSoftwareAccess] AS [vsa] - WHERE [vsa].[AppID] = @{nameof(appId)} - GROUP BY [vsa].[AppID] - , [vsa].[SoftwareAccess_Program]") - .SetParameter(nameof(appId), appId) - .FirstOrDefault(x => new SoftwareOverview - { - AppId = x.GetSmallint(), - Name = x.GetString(), - Versions = x.GetInt(), - Functions = x.GetInt() - }); - - public IEnumerable GetSoftwareVersions(short appId) - => this.sqlConnection - .CreateCommand($@" - SELECT [SoftwareAccess_ID] - , [AppID] - , [SoftwareAccess_Program] - , [SoftwareAccess_MajorVersion] - , [SoftwareAccess_MinorVersion] - , [SoftwareAccess_BuildVersion] - , [SoftwareAccess_VaildTo] - , [SoftwareAccess_Desc] - FROM [VersionSoftwareAccess] - WHERE [AppId] = @{nameof(appId)} - ORDER BY [SoftwareAccess_VaildTo] DESC - , [SoftwareAccess_MajorVersion] DESC - , [SoftwareAccess_MinorVersion] DESC - , [SoftwareAccess_BuildVersion] DESC") - .SetParameter(nameof(appId), appId) - .ExecuteReader(x => new Software - { - Id = x.GetInt(), - AppId = x.GetSmallint(), - FullName = x.GetString(), - MajorV = x.GetInt(), - MinorV = x.GetInt(), - BuildV = x.GetInt(), - ValidTo = x.GetDate(), - Description = x.GetString() - }); - - public IEnumerable GetSoftwares() - => this.sqlConnection - .CreateCommand(@" - SELECT [VSA].[AppId] AS [AppId] - , [VSA].[SoftwareAccess_Program] AS [Program] - , COUNT([VSA].[AppId]) AS [Versions] - , (SELECT COUNT(1) - FROM [SoftwareFunctions] - WHERE [AppId] = [VSA].[AppID]) AS [Functions] - FROM [VersionSoftwareAccess] AS [VSA] - GROUP BY [VSA].[AppId] - , [VSA].[SoftwareAccess_Program]") - .ExecuteReader(x => new SoftwareOverview - { - AppId = x.GetSmallint(), - Name = x.GetString(), - Versions = x.GetInt(), - Functions = x.GetInt(), - }); - - public IEnumerable GetUsers(string username = null) - => this.sqlConnection - .CreateCommand($@" - SELECT [U].[MitarbeiterNr] - , [U].[Vorname] - , [U].[Name] - , [U].[Benutzername] - , COUNT([UF].[UserId]) - , CAST(CASE WHEN [U].[PasswordHash] IS NULL THEN 0 ELSE 1 END AS BIT) - FROM [Mitarbeiter] AS [U] - LEFT JOIN [UsersFunctions] AS [UF] - ON [UF].[UserId] = [U].[MitarbeiterNr] - WHERE [U].[Vorname] LIKE @{nameof(username)} - OR [U].[Name] LIKE @{nameof(username)} - OR [U].[Benutzername] LIKE @{nameof(username)} - GROUP BY [U].[MitarbeiterNr] - , [U].[Vorname] - , [U].[Name] - , [U].[Benutzername] - , [U].[PasswordHash] - ORDER BY [U].[Vorname] - , [U].[Name] - , [U].[Benutzername]") - .SetParameter(nameof(username), $"%{username}%") - .ExecuteReader(x => new SoftwareUser - { - Id = x.GetSmallint(), - FirstName = x.GetString(), - LastName = x.GetString(), - Username = x.GetString(), - FunctionsCount = x.GetInt(), - HasPassword = x.GetBool() - }); - - public IEnumerable GetUsersWithFunctions(int userId = -1, string username = null) - => this.sqlConnection - .CreateCommand($@" - SELECT [U].[MitarbeiterNr] - , [U].[Vorname] - , [U].[Name] - , [U].[Benutzername] - , COUNT([UF].[UserId]) - , CAST(CASE WHEN [U].[PasswordHash] IS NULL THEN 0 ELSE 1 END AS BIT) - , (SELECT CAST([SoftwareFunctionId] * -1 AS VARCHAR(MAX)) - FROM [UsersFunctions] - WHERE [UserId] = [UF].[UserId] - ORDER BY [SoftwareFunctionId] - FOR XML PATH ('')) - FROM [Mitarbeiter] AS [U] - LEFT JOIN [UsersFunctions] AS [UF] - ON [UF].[UserId] = [U].[MitarbeiterNr] - WHERE [U].[Vorname] LIKE @{nameof(username)} - OR [U].[Name] LIKE @{nameof(username)} - OR [U].[Benutzername] LIKE @{nameof(username)} - OR [U].[MitarbeiterNr] = @{nameof(userId)} - GROUP BY [U].[MitarbeiterNr] - , [U].[Vorname] - , [U].[Name] - , [U].[Benutzername] - , [U].[PasswordHash] - , [UF].[UserId] - ORDER BY [U].[Vorname] - , [U].[Name] - , [U].[Benutzername]") - .SetParameter(nameof(username), $"%{username}%") - .SetParameter(nameof(userId), userId) - .ExecuteReader(x => new SoftwareUser - { - Id = x.GetSmallint(), - FirstName = x.GetString(), - LastName = x.GetString(), - Username = x.GetString(), - FunctionsCount = x.GetInt(), - HasPassword = x.GetBool(), - Functions = x.GetString() - }); - - public void UpdateFunction(int funcId, string name) - => this.sqlConnection - .CreateCommand($@" - UPDATE [SoftwareFunctions] - SET [Function] = @{nameof(name)} - WHERE [Id] = @{nameof(funcId)}") - .SetParameter(nameof(funcId), funcId) - .SetParameter(nameof(name), name) - .ExecuteNonQuery(); - - public void UpdatePasswordHashes() - { - var pwdUsers = this.sqlConnection - .CreateCommand($@" - SELECT [MitarbeiterNr] - , [Kennwort] - FROM [Mitarbeiter] - WHERE [Kennwort] IS NOT NULL - AND [PasswordHash] IS NULL") - .ExecuteReader(x => new KeyValuePair( - key: x.GetSmallint(), - value: x.GetString())); - var sha256 = SHA256.Create(); - - foreach (var kvp in pwdUsers) - { - var userId = kvp.Key; - var password = sha256.ComputeHash(kvp.Value); - - this.sqlConnection - .CreateCommand($@" - UPDATE [Mitarbeiter] - SET [PasswordHash] = @{nameof(password)} - WHERE [MitarbeiterNr] = @{nameof(userId)}") - .SetParameter(nameof(userId), userId) - .SetParameter(nameof(password), password) - .ExecuteNonQuery(); - } - } - - public int ResetPassword(short userId) - => this.sqlConnection - .CreateCommand($@" - UPDATE [Mitarbeiter] - SET [PasswordHash] = NULL - WHERE [MitarbeiterNr] = @{nameof(userId)}") - .SetParameter(nameof(userId), userId) - .ExecuteNonQuery(); - - public int ResetPassword(short userId, string password) - { - password = SHA256.Create().ComputeHash(password); - - return this.sqlConnection - .CreateCommand($@" - UPDATE [Mitarbeiter] - SET [PasswordHash] = @{nameof(password)} - WHERE [MitarbeiterNr] = @{nameof(userId)}") - .SetParameter(nameof(userId), userId) - .SetParameter(nameof(password), password) - .ExecuteNonQuery(); - } - - public void UpdateUsersFunctions(Action mapper) - { - var model = new UserFunctions(); - mapper(model); - - var userId = model.UserId; - - this.sqlConnection - .CreateCommand($@"DELETE FROM [UsersFunctions] WHERE [UserId] = @{nameof(userId)}") - .SetParameter(nameof(userId), userId) - .ExecuteNonQuery(); - - foreach (var funcId in model.Functions ?? Array.Empty()) - { - this.sqlConnection - .CreateCommand($@" - INSERT - INTO [UsersFunctions] ([UserId] ,[SoftwareFunctionId]) - VALUES (@{nameof(userId)}, @{nameof(funcId)})") - .SetParameter(nameof(userId), userId) - .SetParameter(nameof(funcId), funcId) - .ExecuteNonQuery(); - } - } - - public void UpdateUsersFunctions(Action mapper) - { - var model = new FunctionUsers(); - mapper(model); - - var funcId = model.FunctionId; - - this.sqlConnection - .CreateCommand($@"DELETE FROM [UsersFunctions] WHERE [SoftwareFunctionId] = @{nameof(funcId)}") - .SetParameter(nameof(funcId), funcId) - .ExecuteNonQuery(); - - foreach (var userId in model.Users ?? Array.Empty()) - { - this.sqlConnection - .CreateCommand($@" - INSERT - INTO [UsersFunctions] ([UserId] ,[SoftwareFunctionId]) - VALUES (@{nameof(userId)}, @{nameof(funcId)})") - .SetParameter(nameof(userId), userId) - .SetParameter(nameof(funcId), funcId) - .ExecuteNonQuery(); - } - } - } -} diff --git a/LaaProductionWeb/LaaProduction.Web/API/LoginController.cs b/LaaProductionWeb/LaaProduction.Web/API/LoginController.cs index b7d69260..b26e8225 100644 --- a/LaaProductionWeb/LaaProduction.Web/API/LoginController.cs +++ b/LaaProductionWeb/LaaProduction.Web/API/LoginController.cs @@ -8,7 +8,7 @@ using System.Net; using System.Web.Http; - [RoutePrefix("API/Login")] + [RoutePrefix("api/Login")] public class LoginController : ApiController { private readonly IAccountManager accountManager; diff --git a/LaaProductionWeb/LaaProduction.Web/API/Personalization/SoftwareController.cs b/LaaProductionWeb/LaaProduction.Web/API/Personalization/SoftwareController.cs index 10c3b933..12c4d0d2 100644 --- a/LaaProductionWeb/LaaProduction.Web/API/Personalization/SoftwareController.cs +++ b/LaaProductionWeb/LaaProduction.Web/API/Personalization/SoftwareController.cs @@ -116,16 +116,6 @@ return this.Json(true); } - - [HttpPost] - [Route(nameof(Login))] - public IHttpActionResult Login([FromBody] SoftwareLoginModel model) - { - // TODO: Implement - //var softwareId = this.softwareManager.Login(model.Software, model.Functions); - - return this.Json(0); - } } public class EditFunctionModel diff --git a/LaaProductionWeb/LaaProduction.Web/API/Production/PruefstationController.cs b/LaaProductionWeb/LaaProduction.Web/API/Production/PruefstationController.cs new file mode 100644 index 00000000..41ad1e3d --- /dev/null +++ b/LaaProductionWeb/LaaProduction.Web/API/Production/PruefstationController.cs @@ -0,0 +1,17 @@ +namespace LaaProduction.Web.API.Production +{ + using System.Web.Http; + + [RoutePrefix("api/Personalization/Pruefstation")] + public class PruefstationController : ApiController + { + [HttpGet] + [Route("{station}/Pruefmittel")] + public IHttpActionResult Pruefmittel(string station) + { + + + return this.Json(""); + } + } +} diff --git a/LaaProductionWeb/LaaProduction.Web/App_Content/css/styles.css b/LaaProductionWeb/LaaProduction.Web/App_Content/css/styles.css index ec2c9610..02989328 100644 --- a/LaaProductionWeb/LaaProduction.Web/App_Content/css/styles.css +++ b/LaaProductionWeb/LaaProduction.Web/App_Content/css/styles.css @@ -119,6 +119,12 @@ table.table table.table { color: var(--bs-teal); } +.text-consolas { + font-family: Consolas; + font-size: 1rem; + font-weight: 500; +} + .btn.btn-link:hover { text-decoration: underline !important; } diff --git a/LaaProductionWeb/LaaProduction.Web/App_Infrastructure/HttpExtensions.cs b/LaaProductionWeb/LaaProduction.Web/App_Infrastructure/HttpExtensions.cs index 5d61e7aa..c9e9ef8b 100644 --- a/LaaProductionWeb/LaaProduction.Web/App_Infrastructure/HttpExtensions.cs +++ b/LaaProductionWeb/LaaProduction.Web/App_Infrastructure/HttpExtensions.cs @@ -79,7 +79,7 @@ .Request .Cookies .Get(URL_REFERER) - ?.Value ?? "~/LaaProductionWeb"; + ?.Value ?? "~/"; public static void SetUrlReferer(this HttpContextBase httpContext) => httpContext diff --git a/LaaProductionWeb/LaaProduction.Web/Controllers/HomeController.cs b/LaaProductionWeb/LaaProduction.Web/Controllers/HomeController.cs index d9937f96..4177dab0 100644 --- a/LaaProductionWeb/LaaProduction.Web/Controllers/HomeController.cs +++ b/LaaProductionWeb/LaaProduction.Web/Controllers/HomeController.cs @@ -2,7 +2,6 @@ { using LaaProductionHttp.Interfaces; using LaaProduction.Web.App_Infrastructure; - using LaaProduction.Services.Interfaces; using LaaProductionDI; using System.Threading.Tasks; @@ -11,12 +10,10 @@ [AllowAnonymous] public class HomeController : Controller { - private readonly IAccountService accountService; private readonly IHttpClient httpClient; public HomeController() { - this.accountService = LaaServiceProvider.GetService(); this.httpClient = LaaServiceProvider.GetService(); } @@ -78,7 +75,7 @@ { this.HttpContext.SignOut(); - return this.Redirect("/"); + return this.Redirect("~/"); } } } \ No newline at end of file diff --git a/LaaProductionWeb/LaaProduction.Web/Controllers/ProtocolController.cs b/LaaProductionWeb/LaaProduction.Web/Controllers/ProtocolController.cs index 4c80be56..e4e2d9cd 100644 --- a/LaaProductionWeb/LaaProduction.Web/Controllers/ProtocolController.cs +++ b/LaaProductionWeb/LaaProduction.Web/Controllers/ProtocolController.cs @@ -44,7 +44,9 @@ if (file.ContentType == "application/pdf") { - if (this.protocolService.OrderCompleted(model.OrderId.Value)) + var completed = this.protocolService.OrderCompleted(model.OrderId.Value); + + if (completed) { model.FileId = this.protocolService.SaveFile(file.InputStream, model.ClientId.Value, model.OrderId.Value); @@ -54,7 +56,7 @@ } else { - this.TempData[FilePDF] = $"Der PDF Datei wurde nicht hochgeladen."; + this.TempData[FilePDF] = $"Der PDF Datei könte nicht hochgeladen werden."; } } else @@ -110,7 +112,6 @@ return this.PartialView(clientsOrders); } - [HttpGet] public ActionResult Body(int orderId = 0) { var testStatus = this.protocolService.LoadTestStatus(orderId); diff --git a/LaaProductionWeb/LaaProduction.Web/Global.asax.cs b/LaaProductionWeb/LaaProduction.Web/Global.asax.cs index d946aaf1..fb35adb8 100644 --- a/LaaProductionWeb/LaaProduction.Web/Global.asax.cs +++ b/LaaProductionWeb/LaaProduction.Web/Global.asax.cs @@ -32,15 +32,11 @@ => services .AddSingleton(SQLConnection.CreateConnection(Appsettings.ConnectionString)) .AddSingleton(HttpClient.CreateHttpClient(Appsettings.APIURL, Appsettings.APIPrefix)) - .AddScoped() .AddScoped() - .AddScoped() .AddScoped() .AddScoped() .AddScoped() - .AddScoped() .AddScoped() - .AddScoped() .AddAdministration() .AddSearching(); } diff --git a/LaaProductionWeb/LaaProduction.Web/LaaProduction.Web.csproj b/LaaProductionWeb/LaaProduction.Web/LaaProduction.Web.csproj index 56d5fc20..3931e515 100644 --- a/LaaProductionWeb/LaaProduction.Web/LaaProduction.Web.csproj +++ b/LaaProductionWeb/LaaProduction.Web/LaaProduction.Web.csproj @@ -155,6 +155,7 @@ + @@ -216,7 +217,7 @@ - + @@ -235,7 +236,6 @@ - @@ -263,9 +263,10 @@ - + Designer + @@ -309,9 +310,9 @@ True 59768 / - http://localhost:59768/LaaProductionWeb + http://localhost:59768/ True - http://localhost:59768/LaaProductionWeb + http://localhost:59768/ False False diff --git a/LaaProductionWeb/LaaProduction.Web/Views/Protocol/Body.cshtml b/LaaProductionWeb/LaaProduction.Web/Views/Protocol/Body.cshtml index 0948cc84..21e9c890 100644 --- a/LaaProductionWeb/LaaProduction.Web/Views/Protocol/Body.cshtml +++ b/LaaProductionWeb/LaaProduction.Web/Views/Protocol/Body.cshtml @@ -13,7 +13,7 @@ } else if (testStatus == false) { - return new MvcHtmlString("X"); + return new MvcHtmlString("x"); } else { @@ -26,7 +26,7 @@ - + @@ -39,13 +39,13 @@ @foreach (var item in this.Model) { - + @testPassed(null, true) + @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) @@ -55,53 +55,73 @@ - diff --git a/LaaProductionWeb/LaaProduction.Web/Views/Protocol/Index.cshtml b/LaaProductionWeb/LaaProduction.Web/Views/Protocol/Index.cshtml index fe0e15ad..44032a1a 100644 --- a/LaaProductionWeb/LaaProduction.Web/Views/Protocol/Index.cshtml +++ b/LaaProductionWeb/LaaProduction.Web/Views/Protocol/Index.cshtml @@ -12,25 +12,25 @@ - + - + - + @@ -74,7 +74,7 @@ @if (this.Model.OrderId > 0) { - this.Html.RenderAction("Body", "Protocol", new { orderId = this.Model.OrderId }); + this.Html.RenderAction(nameof(ProtocolController.Body), new { orderId = this.Model.OrderId }); }
Pos. Serial No. T1
@item.PosNr @item.SerialNr
+ - - + + - - - + + - + @* + *@ - - - + + - + - - - - + + + + - - - - + + + + - - - - + + + - - - - + + + - - - - + + + + - - + + - - + + - - + + - - + +
Legend: Component & OperationQuantum of CheckAcceptance NormsQuantum of checkAcceptance norms
T1Powder coating - 1 piece per quarter
- 1 piece per h +
T1Powder coating + + + + + + + +
1 piece per quarter
1 piece per h
- Adhesion according to DIN 53151,coating faultless & corrosion free
- According drawing +
+ + + + + + + +
Adhesion according to DIN 53151, coating faultless & corrosion free
According drawing
+ 1 piece per quarter

+ 1 piece per h +
+ Adhesion according to DIN 53151, coating faultless & corrosion free

+ According drawing +
T2Pressure and burst test composit transducer + T2Pressure and burst test composite transducer First part / batch
500 th part / batch
Last part / batch
Rejected in case of leakage or breakageRejected in case of leakage or breakage
T3Tightness Test100%Rejected in case of leakageT3Tightness (Helium) test100%Rejected in case of leakage
T4Pressure and tightness test100% at start of productionRejected in case of leakage or breakageT4Pressure and tightness test100% - Statistical test according test planRejected in case of leakage or breakage
T5Metrological testing100% + T5Metrological testing100% Maximum Permissible Error at
Q1 < ± 5%
Q2 < ± 2%
@@ -109,35 +129,35 @@
T6Config comparison and radio test100% + T6Config comparison and radio test100% Main functions, LCD display, LED, Radio functions according to specs
Parameter readable and according to customer specification
T7100%Packaging of meterSENSUS-1-924T7Packaging of meter100% - Final check and visual inspectionSENSUS-1-924
n/aNot applicablen/aNot applicable
OkTest passedOKTest passed
Ok*Test passed according to the Quantum of CheckOK*Test passed according to the Quantum of Check
XTest not passedxTest not passed
Test Protocol
- -
PositionsPositions
@if (string.IsNullOrWhiteSpace(this.Model.Positions)) @@ -39,7 +39,7 @@ } else { - @this.Model.Positions + @this.Model.Positions }
diff --git a/LaaProductionWeb/LaaProduction.Web/Views/Protocol/Print.cshtml b/LaaProductionWeb/LaaProduction.Web/Views/Protocol/Print.cshtml index 1b0a75ab..82420967 100644 --- a/LaaProductionWeb/LaaProduction.Web/Views/Protocol/Print.cshtml +++ b/LaaProductionWeb/LaaProduction.Web/Views/Protocol/Print.cshtml @@ -1,4 +1,4 @@ -s@model OrderClientModel +@model OrderClientModel @using LaaProduction.Web.Controllers @using LaaProduction.Services.Models @@ -16,7 +16,7 @@ Test Protocol - +
@if (string.IsNullOrWhiteSpace(this.Model.ClientName)) @@ -31,7 +31,7 @@ - +
@if (this.Model.OrderId is null) @@ -40,13 +40,13 @@ } else { - @this.Model.OrderId + @this.Model.OrderId }
- Positions + Positions
@if (string.IsNullOrWhiteSpace(this.Model.Positions)) @@ -55,7 +55,7 @@ } else { - @this.Model.Positions + @this.Model.Positions }
@@ -74,20 +74,22 @@
-
+
- +
+ @($"{DateTime.Now:dd.MM.yyyy}") +

- +

- +
diff --git a/LaaProductionWeb/LaaProduction.Web/Views/Shared/_Layout.cshtml b/LaaProductionWeb/LaaProduction.Web/Views/Shared/_Layout.cshtml index 14ed66f1..c35b2a8b 100644 --- a/LaaProductionWeb/LaaProduction.Web/Views/Shared/_Layout.cshtml +++ b/LaaProductionWeb/LaaProduction.Web/Views/Shared/_Layout.cshtml @@ -70,8 +70,11 @@ } else { - }