diff --git a/BMA.EHR.Insignia.Service/Controllers/InsigniaRequestController.cs b/BMA.EHR.Insignia.Service/Controllers/InsigniaRequestController.cs index 34b490f8..c4d1d41d 100644 --- a/BMA.EHR.Insignia.Service/Controllers/InsigniaRequestController.cs +++ b/BMA.EHR.Insignia.Service/Controllers/InsigniaRequestController.cs @@ -1687,31 +1687,53 @@ namespace BMA.EHR.Insignia.Service.Controllers if (req.DateReceive != null && req.Date != null) { insigniaNoteProfile.Status = "DONE"; - await _context.ProfileInsignias.AddAsync(new ProfileInsignia + + var profileInsigniaBody = new PostProfileInsigniaDto { - Year = insigniaNote.Year, - No = req.No, - Issue = req.VolumeNo, - VolumeNo = req.VolumeNo, - // Volume = req.Volume, - Section = req.Section, - Page = req.Page, - DateAnnounce = req.Date, - ReceiveDate = req.DateReceive, - InsigniaType = insignia.InsigniaType == null ? null : insignia.InsigniaType.Name, - Insignia = insignia, - // RefCommandNo = req.RefCommandNo, - // RefCommandDate = req.RefCommandDate, - ProfileId = profile.Id, - CreatedFullName = FullName ?? "System Administrator", - CreatedUserId = UserId ?? "", - CreatedAt = DateTime.Now, - LastUpdateFullName = FullName ?? "System Administrator", - LastUpdateUserId = UserId ?? "", - LastUpdatedAt = DateTime.Now, - }); + profileId = insigniaNoteProfile.ProfileId.Value, + year = insigniaNote.Year, + no = insigniaNoteProfile.No, + volumeNo = insigniaNoteProfile.VolumeNo, + section = insigniaNoteProfile.Section, + page = insigniaNoteProfile.Page, + receiveDate = insigniaNoteProfile.DateReceive.Value, + dateAnnounce = insigniaNoteProfile.Date.Value, + insigniaId = insigniaNoteProfile.RequestInsignia.Id, + issue = insigniaNoteProfile.Issue, + note = "", + refCommandDate = null, + refCommandNo = "", + volume = "", + + }; + await _userProfileRepository.PostProfileInsigniaAsync(profileInsigniaBody, AccessToken); } - await _context.InsigniaNoteProfiles.AddAsync(insigniaNoteProfile); + + // await _context.ProfileInsignias.AddAsync(new ProfileInsignia + // { + // Year = insigniaNote.Year, + // No = req.No, + // Issue = req.VolumeNo, + // VolumeNo = req.VolumeNo, + // // Volume = req.Volume, + // Section = req.Section, + // Page = req.Page, + // DateAnnounce = req.Date, + // ReceiveDate = req.DateReceive, + // InsigniaType = insignia.InsigniaType == null ? null : insignia.InsigniaType.Name, + // Insignia = insignia, + // // RefCommandNo = req.RefCommandNo, + // // RefCommandDate = req.RefCommandDate, + // ProfileId = profile.Id, + // CreatedFullName = FullName ?? "System Administrator", + // CreatedUserId = UserId ?? "", + // CreatedAt = DateTime.Now, + // LastUpdateFullName = FullName ?? "System Administrator", + // LastUpdateUserId = UserId ?? "", + // LastUpdatedAt = DateTime.Now, + // }); + //} + //await _context.InsigniaNoteProfiles.AddAsync(insigniaNoteProfile); } else { @@ -1750,7 +1772,7 @@ namespace BMA.EHR.Insignia.Service.Controllers receiveDate = profileInsignia.DateReceive.Value, dateAnnounce = profileInsignia.Date.Value, insigniaId = profileInsignia.RequestInsignia.Id, - issue = "", + issue = profileInsignia.Issue, note = "", refCommandDate = null, refCommandNo = "",