diff --git a/AMESCoreStudio.Web/Controllers/REPController.cs b/AMESCoreStudio.Web/Controllers/REPController.cs index 46ce9ccc..935b4510 100644 --- a/AMESCoreStudio.Web/Controllers/REPController.cs +++ b/AMESCoreStudio.Web/Controllers/REPController.cs @@ -1015,12 +1015,17 @@ namespace AMESCoreStudio.Web.Controllers { if (station_info[0].TypeNo != "R") { + model.ngComponent.Status = 0; + result = await _repApi.PutNgComponent((int)model.ngComponent.ComponentID, JsonConvert.SerializeObject(model.ngComponent)); //ModelState.AddModelError("error", "下一站不是維修站!"); return RedirectToAction("Refresh", "Home", new { id = model.ngComponent.NgID, msg = "下一站不是維修站!" }); } } else { + model.ngComponent.Status = 0; + result = await _repApi.PutNgComponent((int)model.ngComponent.ComponentID, JsonConvert.SerializeObject(model.ngComponent)); + return RedirectToAction("Refresh", "Home", new { id = model.ngComponent.NgID, msg = "查無下一站!" }); } @@ -1060,8 +1065,12 @@ namespace AMESCoreStudio.Web.Controllers } else { + model.ngComponent.Status = 0; + result = await _repApi.PutNgComponent((int)model.ngComponent.ComponentID, JsonConvert.SerializeObject(model.ngComponent)); + return RedirectToAction("Refresh", "Home", new { id = model.ngComponent.NgID, msg = barcode_result.Msg }); } + } if (result.Success) @@ -1080,6 +1089,9 @@ namespace AMESCoreStudio.Web.Controllers { ModelState.AddModelError("error", result.Msg); } + + model.ngComponent.Status = 0; + result = await _repApi.PutNgComponent((int)model.ngComponent.ComponentID, JsonConvert.SerializeObject(model.ngComponent)); } HttpContext.Response.Cookies.Delete("UserID4REP001");