From c3a9bd3a80c9938be4b942a671e53b9effe4f5a0 Mon Sep 17 00:00:00 2001 From: Marvin Date: Mon, 11 Apr 2022 21:36:11 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E7=BB=B4=E4=BF=AE=E8=B5=84?= =?UTF-8?q?=E6=96=99=E8=BE=93=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AMESCoreStudio.Web/Controllers/REPController.cs | 17 ++++++++++++++--- .../Controllers/AMES/NgInfoController.cs | 2 ++ 2 files changed, 16 insertions(+), 3 deletions(-) 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 {