ปรับ condition generate file รายงานเกษียณ

This commit is contained in:
Harid Promsri (Bright) 2023-08-30 14:15:29 +07:00
parent 4e7f3f6ff4
commit 86cd829c0e

View file

@ -54,12 +54,12 @@ namespace BMA.EHR.Report.Service.Controllers
switch (retire.GetType().GetProperty("Type").GetValue(retire))
{
case "OFFICER":
if (retire.GetType().GetProperty("TypeReport").GetValue(retire) == "ADD")
if (string.IsNullOrEmpty(retire.GetType().GetProperty("TypeReport").GetValue(retire)))
{
reportfile = $"31-ประกาศเกษียณข้าราชการ-1.trdp";
returnfile = $"ประกาศเกษียณข้าราชการ.{exportType}";
}
else if (retire.GetType().GetProperty("TypeReport").GetValue(retire) == "EDIT")
else if (retire.GetType().GetProperty("TypeReport").GetValue(retire) == "ADD" || retire.GetType().GetProperty("TypeReport").GetValue(retire) == "EDIT")
{
reportfile = $"31-ประกาศเกษียณข้าราชการ-2.trdp";
returnfile = $"แก้ไขประกาศเกษียณข้าราชการ.{exportType}";
@ -71,7 +71,7 @@ namespace BMA.EHR.Report.Service.Controllers
}
else
{
return Error(retire.GetType().GetProperty("TypeReport").ToString());
return Error(retire.GetType().GetProperty("TypeReport").GetValue(retire));
}
break;
case "EMPLOYEE":
@ -79,7 +79,7 @@ namespace BMA.EHR.Report.Service.Controllers
returnfile = $"ประกาศเกษียณลูกจ้าง.{exportType}";
break;
default:
return BadRequest(retire);
return Error(retire.GetType().GetProperty("Type").GetValue(retire));
}
var rptFile = Path.Combine(_hostingEnvironment.ContentRootPath, "Reports", reportfile);