update order

This commit is contained in:
kittapath 2025-10-30 22:13:39 +07:00
parent 755dd9d06e
commit d65107ad40

View file

@ -900,22 +900,18 @@ namespace BMA.EHR.Retirement.Service.Controllers
.FirstOrDefaultAsync(x => x.profileId == req.ProfileId && x.RetirementPeriod.Id == retireId);
if (retireProfile != null)
return Error("บุคคลนี้ได้ทำการเลือกไว้อยู่แล้ว");
var numRaw = 1;
// var num = 1;
var numRaw = 0;
var profileRawCount = await _context.RetirementRawProfiles
.Where(x => x.RetirementPeriod.Id == retireId)
.OrderByDescending(x => x.Order)
.FirstOrDefaultAsync();
if (profileRawCount != null)
numRaw = profileRawCount.Order + 1;
// var old_retire = await _context.RetirementProfiles
// .Where(x => x.RetirementPeriod.Id == retireId)
// .OrderByDescending(x => x.Order)
// .FirstOrDefaultAsync();
// if (old_retire != null)
// num = old_retire.Order + 1;
if (retire.TypeReport != null)
{
numRaw = 1;
var profileRawCount = await _context.RetirementRawProfiles
.Where(x => x.RetirementPeriod.Id == retireId)
.OrderByDescending(x => x.Order)
.FirstOrDefaultAsync();
if (profileRawCount != null)
numRaw = profileRawCount.Order + 1;
}
if (retire.Type == "OFFICER")
{