From 834ee7f2e09dbddde209b82aea61970b19814da2 Mon Sep 17 00:00:00 2001 From: "Joanne.Chuang" Date: Wed, 14 Jan 2026 20:24:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=9B=E9=81=B8=E4=B8=80=E5=A1=AB=E5=AF=AB?= =?UTF-8?q?=E9=A9=97=E8=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Altob.NtuInvoiceGateway/Pages/Invoice.cshtml | 4 ++-- Altob.NtuInvoiceGateway/Pages/Invoice.cshtml.cs | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Altob.NtuInvoiceGateway/Pages/Invoice.cshtml b/Altob.NtuInvoiceGateway/Pages/Invoice.cshtml index c6a3a17..46be77f 100644 --- a/Altob.NtuInvoiceGateway/Pages/Invoice.cshtml +++ b/Altob.NtuInvoiceGateway/Pages/Invoice.cshtml @@ -58,12 +58,12 @@
- 注意:以下四個選項至少需填寫一個 + 注意:以下四個選項僅能擇一填寫
- +
diff --git a/Altob.NtuInvoiceGateway/Pages/Invoice.cshtml.cs b/Altob.NtuInvoiceGateway/Pages/Invoice.cshtml.cs index 0fddc12..7975d0c 100644 --- a/Altob.NtuInvoiceGateway/Pages/Invoice.cshtml.cs +++ b/Altob.NtuInvoiceGateway/Pages/Invoice.cshtml.cs @@ -216,7 +216,7 @@ public class InvoiceModel : PageModel return Page(); } - // 驗證 Email, CarrierID, BuyerIdentifier 至少填寫一個 + // 驗證 Email, CarrierID, BuyerIdentifier, LoveCode 僅能擇一填寫 int filledCount = 0; if (!string.IsNullOrEmpty(InvoiceData.Email)) filledCount++; if (!string.IsNullOrEmpty(InvoiceData.CarrierID)) filledCount++; @@ -225,7 +225,13 @@ public class InvoiceModel : PageModel if (filledCount == 0) { - ErrorMessage = "Email、手機條碼、購買者統編至少需填寫一個"; + ErrorMessage = "Email、手機條碼、購買者統編、捐贈碼僅能擇一填寫,請填寫任一項"; + return Page(); + } + + if (filledCount > 1) + { + ErrorMessage = "Email、手機條碼、購買者統編、捐贈碼僅能擇一填寫,請刪除多餘輸入"; return Page(); }