diff --git a/BMA.EHR.Application/Repositories/Leaves/LeaveRequests/LeaveRequestRepository.cs b/BMA.EHR.Application/Repositories/Leaves/LeaveRequests/LeaveRequestRepository.cs index 1868516a..e15749c9 100644 --- a/BMA.EHR.Application/Repositories/Leaves/LeaveRequests/LeaveRequestRepository.cs +++ b/BMA.EHR.Application/Repositories/Leaves/LeaveRequests/LeaveRequestRepository.cs @@ -91,8 +91,15 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests if (entity.LeaveDraftDocument != null) _dbContext.Attatch(entity.LeaveDraftDocument); - // if (entity.LeaveDocument != null) - // _dbContext.Attatch(entity.LeaveDocument); + if (entity.LeaveDocument != null) + { + foreach(var d in entity.LeaveDocument) + { + _dbContext.Attatch(d); + } + + } + if (entity.Type != null) _dbContext.Attatch(entity.Type); @@ -108,8 +115,14 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests if (entity.LeaveDraftDocument != null) _dbContext.Attatch(entity.LeaveDraftDocument); - // if (entity.LeaveDocument != null) - // _dbContext.Attatch(entity.LeaveDocument); + if (entity.LeaveDocument != null) + { + foreach (var d in entity.LeaveDocument) + { + _dbContext.Attatch(d); + } + + } if (entity.Type != null) { diff --git a/BMA.EHR.Insignia/Controllers/InsigniaRequestController.cs b/BMA.EHR.Insignia/Controllers/InsigniaRequestController.cs index 7ee7cbfd..05a9ef09 100644 --- a/BMA.EHR.Insignia/Controllers/InsigniaRequestController.cs +++ b/BMA.EHR.Insignia/Controllers/InsigniaRequestController.cs @@ -177,6 +177,7 @@ namespace BMA.EHR.Insignia.Service.Controllers var rowCount = worksheet.Dimension.Rows; for (int row = 2; row <= rowCount; row++) { + if (worksheet.Cells[row, 1].ToString() == "") break; list.Add(new ImportReceiveRequest { Number = worksheet.Cells[row, 1].Value != null ? worksheet.Cells[row, 1].Value.ToString() : null, @@ -2096,6 +2097,7 @@ namespace BMA.EHR.Insignia.Service.Controllers var _insigniaNoteProfiles = new List(); foreach (var item in items) { + if (item.CitizanId == null) continue; var _profile = _userProfileRepository.GetOfficerProfileByCitizenId(item.CitizanId, AccessToken); var profile = insigniaNote.InsigniaNoteProfiles.FirstOrDefault(x => x.ProfileId == _profile.Id); if (profile == null) @@ -2150,11 +2152,12 @@ namespace BMA.EHR.Insignia.Service.Controllers new { profile.Id, - Prefix = _userProfileRepository.GetOfficerProfileById(profile.ProfileId.Value, AccessToken).Prefix, - Position = _userProfileRepository.GetOfficerProfileById(profile.ProfileId.Value, AccessToken).Position, - _userProfileRepository.GetOfficerProfileById(profile.ProfileId.Value, AccessToken).CitizenId, - _userProfileRepository.GetOfficerProfileById(profile.ProfileId.Value, AccessToken).ProfileType, - FullName = $"{_userProfileRepository.GetOfficerProfileById(profile.ProfileId.Value, AccessToken).Prefix}{_userProfileRepository.GetOfficerProfileById(profile.ProfileId.Value, AccessToken).FirstName} {_userProfileRepository.GetOfficerProfileById(profile.ProfileId.Value, AccessToken).LastName}", + Prefix = _profile.Prefix,// _userProfileRepository.GetOfficerProfileById(profile.ProfileId.Value, AccessToken).Prefix, + Position = _profile.Position,// _userProfileRepository.GetOfficerProfileById(profile.ProfileId.Value, AccessToken).Position, + CitizenId = _profile.CitizenId,// _userProfileRepository.GetOfficerProfileById(profile.ProfileId.Value, AccessToken).CitizenId, + ProfileType = _profile.ProfileType,// _userProfileRepository.GetOfficerProfileById(profile.ProfileId.Value, AccessToken).ProfileType, + FullName = $"{_profile.Prefix}{_profile.FirstName} {_profile.LastName}", + //FullName = $"{_userProfileRepository.GetOfficerProfileById(profile.ProfileId.Value, AccessToken).Prefix}{_userProfileRepository.GetOfficerProfileById(profile.ProfileId.Value, AccessToken).FirstName} {_userProfileRepository.GetOfficerProfileById(profile.ProfileId.Value, AccessToken).LastName}", RequestInsignia = profile.RequestInsignia == null ? null : profile.RequestInsignia.Name, RequestInsigniaId = profile.RequestInsignia == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : profile.RequestInsignia.Id, RequestInsigniaShortName = profile.RequestInsignia == null ? null : profile.RequestInsignia.ShortName, diff --git a/BMA.EHR.Insignia/appsettings.json b/BMA.EHR.Insignia/appsettings.json index d2887d97..fe74eff4 100644 --- a/BMA.EHR.Insignia/appsettings.json +++ b/BMA.EHR.Insignia/appsettings.json @@ -43,7 +43,7 @@ "Node": { "API": "https://bma-ehr.frappet.synology.me/api/v1/probation" }, - "API": "https://bma-ehr.frappet.synology.m/api/v1", + "API": "https://bma-ehr.frappet.synology.me/api/v1", "RabbitMQ" :{ "URL": "localhost", "UserName": "frappet", diff --git a/BMA.EHR.Leave/Controllers/LeaveRequestController.cs b/BMA.EHR.Leave/Controllers/LeaveRequestController.cs index 7602ff70..5adf66ca 100644 --- a/BMA.EHR.Leave/Controllers/LeaveRequestController.cs +++ b/BMA.EHR.Leave/Controllers/LeaveRequestController.cs @@ -191,6 +191,8 @@ namespace BMA.EHR.Leave.Service.Controllers if (doc != null) { leaveRequest.LeaveDocument.Add(new LeaveDocument { Document = doc }); + var a = leaveRequest.LeaveDocument.Last(); + _context.Entry(a).State = Microsoft.EntityFrameworkCore.EntityState.Modified; } } } @@ -418,6 +420,8 @@ namespace BMA.EHR.Leave.Service.Controllers if (doc != null) { leaveRequest.LeaveDocument.Add(new LeaveDocument { Document = doc }); + var a = leaveRequest.LeaveDocument.Last(); + _context.Entry(a).State = Microsoft.EntityFrameworkCore.EntityState.Modified; } } } diff --git a/BMA.EHR.Solution.sln b/BMA.EHR.Solution.sln index c3f78122..e87d02b9 100644 --- a/BMA.EHR.Solution.sln +++ b/BMA.EHR.Solution.sln @@ -25,12 +25,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BMA.EHR.Retirement.Service" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BMA.EHR.Report.Service", "BMA.EHR.Report.Service\BMA.EHR.Report.Service.csproj", "{26FE7B1C-771B-4940-9F40-326A7AD53F1C}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BMA.EHR.Leave.Service", "BMA.EHR.Leave.Service\BMA.EHR.Leave.Service.csproj", "{0F15B902-82D7-4878-B12D-B36C14E8EDBC}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BMA.EHR.Discipline.Service", "BMA.EHR.Discipline.Service\BMA.EHR.Discipline.Service.csproj", "{0145A11E-7780-437B-A86F-CBDDB50BC3D1}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BMA.EHR.Insignia", "BMA.EHR.Insignia\BMA.EHR.Insignia.csproj", "{03AB740F-AF31-423E-8546-198B914AF76F}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BMA.EHR.Leave", "BMA.EHR.Leave\BMA.EHR.Leave.csproj", "{B06C5612-2346-44B1-9D50-F8373885BD88}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -73,10 +73,6 @@ Global {26FE7B1C-771B-4940-9F40-326A7AD53F1C}.Debug|Any CPU.Build.0 = Debug|Any CPU {26FE7B1C-771B-4940-9F40-326A7AD53F1C}.Release|Any CPU.ActiveCfg = Release|Any CPU {26FE7B1C-771B-4940-9F40-326A7AD53F1C}.Release|Any CPU.Build.0 = Release|Any CPU - {0F15B902-82D7-4878-B12D-B36C14E8EDBC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0F15B902-82D7-4878-B12D-B36C14E8EDBC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0F15B902-82D7-4878-B12D-B36C14E8EDBC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0F15B902-82D7-4878-B12D-B36C14E8EDBC}.Release|Any CPU.Build.0 = Release|Any CPU {0145A11E-7780-437B-A86F-CBDDB50BC3D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0145A11E-7780-437B-A86F-CBDDB50BC3D1}.Debug|Any CPU.Build.0 = Debug|Any CPU {0145A11E-7780-437B-A86F-CBDDB50BC3D1}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -85,6 +81,10 @@ Global {03AB740F-AF31-423E-8546-198B914AF76F}.Debug|Any CPU.Build.0 = Debug|Any CPU {03AB740F-AF31-423E-8546-198B914AF76F}.Release|Any CPU.ActiveCfg = Release|Any CPU {03AB740F-AF31-423E-8546-198B914AF76F}.Release|Any CPU.Build.0 = Release|Any CPU + {B06C5612-2346-44B1-9D50-F8373885BD88}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B06C5612-2346-44B1-9D50-F8373885BD88}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B06C5612-2346-44B1-9D50-F8373885BD88}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B06C5612-2346-44B1-9D50-F8373885BD88}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -100,9 +100,9 @@ Global {E4E905EE-61DF-4451-B063-5C86BC7574CE} = {FA618F0C-1AF5-49AB-AE13-C020B403B64F} {3FFE378C-387F-42EA-96E2-68E63BB295F9} = {FA618F0C-1AF5-49AB-AE13-C020B403B64F} {26FE7B1C-771B-4940-9F40-326A7AD53F1C} = {FA618F0C-1AF5-49AB-AE13-C020B403B64F} - {0F15B902-82D7-4878-B12D-B36C14E8EDBC} = {FA618F0C-1AF5-49AB-AE13-C020B403B64F} {0145A11E-7780-437B-A86F-CBDDB50BC3D1} = {FA618F0C-1AF5-49AB-AE13-C020B403B64F} {03AB740F-AF31-423E-8546-198B914AF76F} = {FA618F0C-1AF5-49AB-AE13-C020B403B64F} + {B06C5612-2346-44B1-9D50-F8373885BD88} = {FA618F0C-1AF5-49AB-AE13-C020B403B64F} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {3111A492-1818-4438-B718-75199D8E779A}