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

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

View file

@ -178,6 +178,29 @@ namespace BMA.EHR.Command.Service.Controllers
var cover = command.Documents.FirstOrDefault(x => x.Category == GlobalConstants.TYPE_COVER); var cover = command.Documents.FirstOrDefault(x => x.Category == GlobalConstants.TYPE_COVER);
var attatchment = command.Documents.FirstOrDefault(x => x.Category == GlobalConstants.TYPE_ATTACHMENT); var attatchment = command.Documents.FirstOrDefault(x => x.Category == GlobalConstants.TYPE_ATTACHMENT);
switch (command.CommandType.CommandCode.ToUpper())
{
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 != "" && if (command.CommandNo != "" &&
command.CommandYear != null && command.CommandYear != null &&
command.CommandExcecuteDate != null && command.CommandExcecuteDate != null &&
@ -189,6 +212,10 @@ namespace BMA.EHR.Command.Service.Controllers
else else
return Success(new { result = "N" }); return Success(new { result = "N" });
} }
}
}
catch catch
{ {
throw; throw;