|
|
|
@@ -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(); |
|
|
|
} |
|
|
|
|
|
|
|
|