diff --git a/AMESCoreStudio.Web/Controllers/FQCController.cs b/AMESCoreStudio.Web/Controllers/FQCController.cs
index 8b4ae22c..fea10ed0 100644
--- a/AMESCoreStudio.Web/Controllers/FQCController.cs
+++ b/AMESCoreStudio.Web/Controllers/FQCController.cs
@@ -934,8 +934,9 @@ namespace AMESCoreStudio.Web.Controllers
if (result_detail.Success)
{
- var _msg = "新增成功!";
- return RedirectToAction("WindowReload", "Home", new { msg = _msg });
+ ModelState.AddModelError("error", "新增成功!");
+ //return RedirectToAction("WindowReload", "Home", new { msg = _msg });
+ return View("FQC007C", model);
}
else
{
diff --git a/AMESCoreStudio.Web/Controllers/PCSController.cs b/AMESCoreStudio.Web/Controllers/PCSController.cs
index ec93ba78..ae72f63c 100644
--- a/AMESCoreStudio.Web/Controllers/PCSController.cs
+++ b/AMESCoreStudio.Web/Controllers/PCSController.cs
@@ -3493,7 +3493,8 @@ namespace AMESCoreStudio.Web.Controllers
string ct1 = "";
if (standardWorkTimes.Count > 0)
{
- ct1 = standardWorkTimes.Where(w => w.LineID == line_id).FirstOrDefault().CT.ToString();
+ if (standardWorkTimes.Where(w => w.LineID == line_id).FirstOrDefault() != null)
+ ct1 = standardWorkTimes.Where(w => w.LineID == line_id).FirstOrDefault().CT.ToString();
}
wipDataList = wipDataList + "" + unit_name + " - " + line_desc + "" + " - " + "" + wip_no + "" + "" + "(" + item_no + ")" + "" + " - " + "" + plan_qty + " / " + input_qty + " / " + output_qty + "" + " | " + "" + "標準工時: " + "" + ct1 + "
";
@@ -3551,6 +3552,11 @@ namespace AMESCoreStudio.Web.Controllers
double rate = ((okQty * 1.0) / (okQty + ngQty)) * 100;
+ if (okQty + ngQty == 0)
+ {
+ rate = 100;
+ }
+
if (j == rule_sation.Count - 2)
{
if (rate <= 90)
diff --git a/AMESCoreStudio.Web/Views/FQC/FQC007.cshtml b/AMESCoreStudio.Web/Views/FQC/FQC007.cshtml
index caa9d066..7472871e 100644
--- a/AMESCoreStudio.Web/Views/FQC/FQC007.cshtml
+++ b/AMESCoreStudio.Web/Views/FQC/FQC007.cshtml
@@ -222,10 +222,10 @@