From 5e94586a75695a8eaee31e803113a8300adf6ae8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Szab=C3=B3?= Date: Tue, 10 Jun 2025 12:14:52 +0200 Subject: [PATCH] =?UTF-8?q?J=C3=B3v=C3=A1hagy=C3=A1si=20BUGFIX?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../appsettings.Development.json | 2 +- src/WorkFlowCheck.BL/Services/CheckListService.cs | 15 ++++++++++----- src/WorkFlowCheck.sln | 6 ++++++ 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/WorkFlowCheck.API/appsettings.Development.json b/src/WorkFlowCheck.API/appsettings.Development.json index 8526c55..22833e7 100644 --- a/src/WorkFlowCheck.API/appsettings.Development.json +++ b/src/WorkFlowCheck.API/appsettings.Development.json @@ -1,6 +1,6 @@ { "ConnectionStrings": { - "DefaultConnection": "Data Source=WS2016DC\\SQLEXPRESS;Initial Catalog=WFC;Integrated Security=True;Connect Timeout=30;Encrypt=False;Trust Server Certificate=False;Application Intent=ReadWrite;Multi Subnet Failover=False" + "DefaultConnection": "Data Source=NSINB-37\\WFC;Initial Catalog=WFC;Integrated Security=True;Connect Timeout=30;Encrypt=False;Trust Server Certificate=False;Application Intent=ReadWrite;Multi Subnet Failover=False" }, "Logging": { "LogLevel": { diff --git a/src/WorkFlowCheck.BL/Services/CheckListService.cs b/src/WorkFlowCheck.BL/Services/CheckListService.cs index 3e810c0..e26e1f2 100644 --- a/src/WorkFlowCheck.BL/Services/CheckListService.cs +++ b/src/WorkFlowCheck.BL/Services/CheckListService.cs @@ -130,7 +130,7 @@ namespace WorkFlowCheck.BL.Services if (checkListHeader != null) { checkListHeader.Description = checkListHeaderDTO.Description; - checkListHeader.ShortName= checkListHeaderDTO.ShortName; + checkListHeader.ShortName = checkListHeaderDTO.ShortName; await _dbContext.SaveChangesAsync(); retVal = _mapper.Map(checkListHeader); @@ -218,9 +218,14 @@ namespace WorkFlowCheck.BL.Services try { + var user = await _dbContext.Users + .Where(w => w.Id == userid) + .FirstOrDefaultAsync(); + if (user == null) return false; + var checkListHeader = await _dbContext.CheckListHeaders - .Where(w => w.Id == id && w.CheckStatus == CheckStatus.Sent) - .FirstOrDefaultAsync(); + .Where(w => w.Id == id && w.CheckStatus == CheckStatus.Sent) + .FirstOrDefaultAsync(); if (checkListHeader != null) { @@ -230,7 +235,7 @@ namespace WorkFlowCheck.BL.Services checkListHeader.DateExecution = DateTime.Now; - Log.ForContext("TAG", "BusinessFlow").Warning($"Ellenőrzési lap státuszváltozása, jóváhagyás: Ellenőrzés:{checkListHeader.DocumentNumber}, Felhasználó: {checkListHeader.AcceptUser.LastName} {checkListHeader.AcceptUser.FirstName}"); + Log.ForContext("TAG", "BusinessFlow").Warning($"Ellenőrzési lap státuszváltozása, jóváhagyás: Ellenőrzés:{checkListHeader.DocumentNumber}, Felhasználó: {user.LastName} {user.FirstName}"); await _dbContext.SaveChangesAsync(); var pdf = await CreateCheckListHeaderPDFAsync(id); @@ -310,7 +315,7 @@ namespace WorkFlowCheck.BL.Services gen.SimpleReplace("#DocumentNumber#", checkListHeader.DocumentNumber); gen.SimpleReplace("#DateExecution#", checkListHeader.DateExecution.ToString("yyyy.MM.dd HH:mm")); - + gen.SimpleReplace("#WorkUser#", $"{checkListHeader.UserDTO?.LastName} {checkListHeader.UserDTO?.FirstName}"); gen.SimpleReplace("#AcceptUser#", $"{checkListHeader.AcceptUserDTO?.LastName} {checkListHeader.AcceptUserDTO?.FirstName}"); gen.SimpleReplace("#Guid#", checkListHeader.GuidNumber.ToString()); diff --git a/src/WorkFlowCheck.sln b/src/WorkFlowCheck.sln index 81304f8..a95b223 100644 --- a/src/WorkFlowCheck.sln +++ b/src/WorkFlowCheck.sln @@ -15,6 +15,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WorkFlowCheck.BL", "WorkFlo EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WorkFlowCheck.Common", "WorkFlowCheck.Common\WorkFlowCheck.Common.csproj", "{CBB000AD-E96B-4A4E-A037-4650EFECBB11}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WorkFlowCheck.Web", "WorkFlowCheck.Web\WorkFlowCheck.Web.csproj", "{F4D05A26-A90F-6E65-8C1F-24D98D6F3AA0}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -47,6 +49,10 @@ Global {CBB000AD-E96B-4A4E-A037-4650EFECBB11}.Debug|Any CPU.Build.0 = Debug|Any CPU {CBB000AD-E96B-4A4E-A037-4650EFECBB11}.Release|Any CPU.ActiveCfg = Release|Any CPU {CBB000AD-E96B-4A4E-A037-4650EFECBB11}.Release|Any CPU.Build.0 = Release|Any CPU + {F4D05A26-A90F-6E65-8C1F-24D98D6F3AA0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F4D05A26-A90F-6E65-8C1F-24D98D6F3AA0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F4D05A26-A90F-6E65-8C1F-24D98D6F3AA0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F4D05A26-A90F-6E65-8C1F-24D98D6F3AA0}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE