diff --git a/AMESCoreStudio.Web/Controllers/REPController.cs b/AMESCoreStudio.Web/Controllers/REPController.cs index 4a77fb16..2ad71ff6 100644 --- a/AMESCoreStudio.Web/Controllers/REPController.cs +++ b/AMESCoreStudio.Web/Controllers/REPController.cs @@ -416,7 +416,12 @@ namespace AMESCoreStudio.Web.Controllers } else { - ModelState.AddModelError("error", "請選擇要上傳檔案"); + var ng_repiar_blob = await _repApi.GetNgRepairBlob(model.ngRepair.RepairID); + + if (ng_repiar_blob.Count == 0) + { + ModelState.AddModelError("error", "請選擇要上傳檔案"); + } } if (model.ngRepair.Missing == "Y") @@ -751,7 +756,13 @@ namespace AMESCoreStudio.Web.Controllers } else { - ModelState.AddModelError("error", "請選擇要上傳檔案"); + //ModelState.AddModelError("error", "請選擇要上傳檔案"); + var ng_repiar_blob = await _repApi.GetNgRepairBlob(model.ngRepair.RepairID); + + if (ng_repiar_blob.Count == 0) + { + ModelState.AddModelError("error", "請選擇要上傳檔案"); + } } if (model.ngRepair.Missing == "Y") @@ -895,7 +906,7 @@ namespace AMESCoreStudio.Web.Controllers } else { - if (result.Errors.Count > 0) + if (result.Errors != null) { ModelState.AddModelError(result.Errors[0].Id, result.Errors[0].Msg); } diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/NgInfoController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/NgInfoController.cs index 2069492f..a1fd0c7e 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/NgInfoController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/NgInfoController.cs @@ -141,10 +141,12 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES public async Task> PutNgInfo([FromBody] NgInfo ngInfo) { ResultModel result = new ResultModel(); + ngInfo.Status = 1; _context.Attach(ngInfo); // 指定更新某個欄位 _context.Entry(ngInfo).Property(p => p.CreateUserID).IsModified = true; + _context.Entry(ngInfo).Property(p => p.Status).IsModified = true; try {