diff --git a/AMESCoreStudio.Web/Controllers/PCSController.cs b/AMESCoreStudio.Web/Controllers/PCSController.cs index cf6e00b8..48d65116 100644 --- a/AMESCoreStudio.Web/Controllers/PCSController.cs +++ b/AMESCoreStudio.Web/Controllers/PCSController.cs @@ -3482,9 +3482,9 @@ namespace AMESCoreStudio.Web.Controllers model.MaterialStationsItems = await _pcsApi.GetMaterialStationsItemByItemID(model.MaterialItem.ItemID); model.MaterialStationsItems = model.MaterialStationsItems.Where(w => w.StationID == model.Station).OrderBy(o => o.StationsItemSeq).ToList(); - if (model.MaterialStationsItems.Count() == 0) + if (model.MaterialStationsItems.Count() != 0) { - //ModelState.AddModelError("error", "找不到該站別作業工項"); + ModelState.AddModelError("error", "該站別有設定作業工項"); } // 治具 diff --git a/AMESCoreStudio.Web/Views/PCS/PCS021.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS021.cshtml index c705d192..e12b51d8 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS021.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS021.cshtml @@ -317,7 +317,7 @@ $(document).ready(function () { var error = '@Html.ValidationMessage("error")'; if ($(error).text() != '') { - parent.hg.msg(error); + ShowInputError(error); } if ($("#StationTypeNo").val() == "U" || $("#StationTypeNo").val() == "A") { @@ -388,12 +388,12 @@ $("#inputNo").val(''); // 錯誤訊息 if (!result.success) { - parent.hg.msg(result.msg); + ShowInputError(result.msg); } else { if (result.msg.length != 0) - { parent.hg.msghide(result.msg); } + { ShowInputOK(result.msg); } if (result.data.length != 0) { // 新增資料