ปรับให้เป็น process ที่ควรบันทึกตามลำดับ #224
This commit is contained in:
parent
2bdb8bb733
commit
5b0fcd0680
10 changed files with 260 additions and 143 deletions
|
|
@ -2861,6 +2861,10 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
var data = await _context.RetirementResigns
|
||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
// Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
|
||||
data.ForEach(profile => profile.Status = "DONE");
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
var resultData = (from p in data
|
||||
join r in req.refIds
|
||||
on p.Id.ToString() equals r.refId
|
||||
|
|
@ -2915,12 +2919,12 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
{
|
||||
data = resultData,
|
||||
});
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
if (_res.IsSuccessStatusCode)
|
||||
{
|
||||
data.ForEach(profile => profile.Status = "DONE");
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
// // var _result = await _res.Content.ReadAsStringAsync();
|
||||
// // if (_res.IsSuccessStatusCode)
|
||||
// // {
|
||||
// // data.ForEach(profile => profile.Status = "DONE");
|
||||
// // await _context.SaveChangesAsync();
|
||||
// // }
|
||||
}
|
||||
return Success();
|
||||
}
|
||||
|
|
@ -3060,6 +3064,11 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
.Include(x => x.RetirementResign)
|
||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
// Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
|
||||
data.ForEach(profile => profile.Status = "DONE");
|
||||
data.ForEach(profile => profile.RetirementResign.Status = "CANCEL");
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
string? _null = null;
|
||||
var resultData = (from p in data
|
||||
join r in req.refIds
|
||||
|
|
@ -3120,13 +3129,13 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
{
|
||||
data = resultData,
|
||||
});
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
if (_res.IsSuccessStatusCode)
|
||||
{
|
||||
data.ForEach(profile => profile.Status = "DONE");
|
||||
data.ForEach(profile => profile.RetirementResign.Status = "CANCEL");
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
// // var _result = await _res.Content.ReadAsStringAsync();
|
||||
// // if (_res.IsSuccessStatusCode)
|
||||
// // {
|
||||
// // data.ForEach(profile => profile.Status = "DONE");
|
||||
// // data.ForEach(profile => profile.RetirementResign.Status = "CANCEL");
|
||||
// // await _context.SaveChangesAsync();
|
||||
// // }
|
||||
}
|
||||
//}
|
||||
//else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue