เพิ่มประเภทคำสั่ง ในบรรจุ
This commit is contained in:
parent
cba981e432
commit
08fd49a8d0
3 changed files with 10 additions and 14 deletions
|
|
@ -410,20 +410,10 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
.FirstOrDefaultAsync(x => x.Id == id);
|
||||
if (deleted == null)
|
||||
return Error(GlobalMessages.RetirementResignNotFound, 404);
|
||||
var retirementResignDocs = new List<dynamic>();
|
||||
foreach (var doc in deleted.RetirementResignDocs)
|
||||
{
|
||||
if (doc.Document != null)
|
||||
retirementResignDocs.Add(doc.Document.Id);
|
||||
}
|
||||
_context.RetirementResignDocs.RemoveRange(deleted.RetirementResignDocs);
|
||||
await _context.SaveChangesAsync();
|
||||
_context.RetirementResigns.Remove(deleted);
|
||||
foreach (var doc in retirementResignDocs)
|
||||
{
|
||||
if (doc != null)
|
||||
await _documentService.DeleteFileAsync(doc);
|
||||
}
|
||||
deleted.Status = "DELETE";
|
||||
deleted.LastUpdateFullName = FullName ?? "System Administrator";
|
||||
deleted.LastUpdateUserId = UserId ?? "";
|
||||
deleted.LastUpdatedAt = DateTime.Now;
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue