แก้การเช็คความพร้อมในการออกคำสั่ง

This commit is contained in:
Suphonchai Phoonsawat 2023-09-05 11:04:12 +07:00
parent b75c3a2c47
commit 0c1a8f29cc

View file

@ -178,16 +178,43 @@ namespace BMA.EHR.Command.Service.Controllers
var cover = command.Documents.FirstOrDefault(x => x.Category == GlobalConstants.TYPE_COVER);
var attatchment = command.Documents.FirstOrDefault(x => x.Category == GlobalConstants.TYPE_ATTACHMENT);
if (command.CommandNo != "" &&
command.CommandYear != null &&
command.CommandExcecuteDate != null &&
cover != null &&
attatchment != null)
switch (command.CommandType.CommandCode.ToUpper())
{
return Success(new { result = "Y" });
case "C-PM-10":
case "C-PM-11":
case "C-PM-12":
case "C-PM-16":
case "C-PM-18":
case "C-PM-19":
case "C-PM-20":
case "C-PM-21":
{
if (command.CommandNo != "" &&
command.CommandYear != null &&
command.CommandExcecuteDate != null &&
cover != null)
{
return Success(new { result = "Y" });
}
else
return Success(new { result = "N" });
}
default:
{
if (command.CommandNo != "" &&
command.CommandYear != null &&
command.CommandExcecuteDate != null &&
cover != null &&
attatchment != null)
{
return Success(new { result = "Y" });
}
else
return Success(new { result = "N" });
}
}
else
return Success(new { result = "N" });
}
catch
{