From 0995364bf7d59f091994e61c3cd5d6998daf0c0e Mon Sep 17 00:00:00 2001 From: Marvin Date: Sun, 21 Jan 2024 16:41:40 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E5=89=8D=E5=88=A4=E7=BB=B4?= =?UTF-8?q?=E4=BF=AE=E8=B5=84=E6=96=99=E8=BE=93=E5=85=A5=EF=BC=8C=E6=96=B0?= =?UTF-8?q?=E6=97=A7=E7=BB=84=E4=BB=B6=E5=BA=8F=E5=8F=B7=E4=B8=8D=E5=8F=AF?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AMESCoreStudio.Web/Controllers/REPController.cs | 4 ++-- AMESCoreStudio.Web/Views/REP/REP001R.cshtml | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/AMESCoreStudio.Web/Controllers/REPController.cs b/AMESCoreStudio.Web/Controllers/REPController.cs index b4a54040..f41385dd 100644 --- a/AMESCoreStudio.Web/Controllers/REPController.cs +++ b/AMESCoreStudio.Web/Controllers/REPController.cs @@ -533,12 +533,12 @@ namespace AMESCoreStudio.Web.Controllers } } - if (old_part_no == "") + if (old_part_no == "" || old_part_no == null) { return Json(new { _msg = "舊組件序號不可為空" }); } - if (new_part_no == "") + if (new_part_no == "" || new_part_no == null) { return Json(new { _msg = "新組件序號不可為空" }); } diff --git a/AMESCoreStudio.Web/Views/REP/REP001R.cshtml b/AMESCoreStudio.Web/Views/REP/REP001R.cshtml index 15ecd3fc..5f297747 100644 --- a/AMESCoreStudio.Web/Views/REP/REP001R.cshtml +++ b/AMESCoreStudio.Web/Views/REP/REP001R.cshtml @@ -658,6 +658,16 @@ var old_part_no = $('#txtOldPartNo').val(); var new_part_no = $('#txtNewPartNo').val(); + if (old_part_no == "" || old_part_no == null) { + alert("舊組件序號不可為空"); + return; + } + + if (new_part_no == "" || new_part_no == null) { + alert("新組件序號不可為空"); + return; + } + $.ajax({ url: '@Url.Action("SaveNgKeypart", "REP")', dataType: 'json',