diff --git a/Altob.NtuInvoiceGateway/Models/InvoiceRequest.cs b/Altob.NtuInvoiceGateway/Models/InvoiceRequest.cs index f7c0341..0fb9e2e 100644 --- a/Altob.NtuInvoiceGateway/Models/InvoiceRequest.cs +++ b/Altob.NtuInvoiceGateway/Models/InvoiceRequest.cs @@ -22,11 +22,11 @@ public class InvoiceRequest [StringLength(64, ErrorMessage = "Email長度不能超過64個字元")] [EmailAddress(ErrorMessage = "Email格式不正確")] - public string? Email { get; set; } + public string? Email { get; set; } = string.Empty; [StringLength(8, ErrorMessage = "手機條碼長度不能超過8個字元")] [RegularExpression(@"^\/[A-Z0-9.+\-]{7}$", ErrorMessage = "手機條碼格式不正確,必須為8碼,第一碼為/,其餘為大寫英數字、點、加號或減號")] - public string? CarrierID { get; set; } + public string? CarrierID { get; set; } = string.Empty; [Required(ErrorMessage = "停車場站代號為必填")] [StringLength(1, ErrorMessage = "停車場站代號長度不能超過1個字元")] @@ -42,10 +42,11 @@ public class InvoiceRequest [StringLength(8, ErrorMessage = "購買者統編長度不能超過8個字元")] [RegularExpression(@"^\d{8}$", ErrorMessage = "統編格式不正確,必須為8位數字")] - public string? BuyerIdentifier { get; set; } + public string? BuyerIdentifier { get; set; } = string.Empty; - // [StringLength(7, ErrorMessage = "愛心碼長度不能超過7個字元")] - // public string? LoveCode { get; set; } + [StringLength(6, ErrorMessage = "愛心碼長度不能超過6碼")] + [RegularExpression(@"^$|^\d{6}$", ErrorMessage = "愛心碼須為空值或6位數字")] + public string LoveCode { get; set; } = string.Empty; [Required(ErrorMessage = "稅別為必填")] [StringLength(1, ErrorMessage = "稅別長度不能超過1個字元")] diff --git a/Altob.NtuInvoiceGateway/Pages/Index.cshtml b/Altob.NtuInvoiceGateway/Pages/Index.cshtml deleted file mode 100644 index 2aaa9ee..0000000 --- a/Altob.NtuInvoiceGateway/Pages/Index.cshtml +++ /dev/null @@ -1,10 +0,0 @@ -@page -@model IndexModel -@{ - ViewData["Title"] = "Home page"; -} - -
-

Welcome

-

Learn about building Web apps with ASP.NET Core.

-
\ No newline at end of file diff --git a/Altob.NtuInvoiceGateway/Pages/Index.cshtml.cs b/Altob.NtuInvoiceGateway/Pages/Index.cshtml.cs deleted file mode 100644 index 6a416cf..0000000 --- a/Altob.NtuInvoiceGateway/Pages/Index.cshtml.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.RazorPages; - -namespace Altob.NtuInvoiceGateway.Pages; - -public class IndexModel : PageModel -{ - private readonly ILogger _logger; - - public IndexModel(ILogger logger) - { - _logger = logger; - } - - public void OnGet() - { - } -} \ No newline at end of file diff --git a/Altob.NtuInvoiceGateway/Pages/Invoice.cshtml b/Altob.NtuInvoiceGateway/Pages/Invoice.cshtml index 04c6fb7..6816924 100644 --- a/Altob.NtuInvoiceGateway/Pages/Invoice.cshtml +++ b/Altob.NtuInvoiceGateway/Pages/Invoice.cshtml @@ -45,15 +45,16 @@ @if (!string.IsNullOrEmpty(Model.SuccessMessage)) { } -
-
+ +
+ @@ -62,23 +63,8 @@ - @{ - if (string.IsNullOrWhiteSpace(Model.InvoiceData.Identifier)) - { - Model.InvoiceData.Identifier = Model.CompanyTaxId; - } - } - -
- - - -
-
- 注意:以下三個選項只能填寫其中一個 + 注意:以下三個選項至少需填寫一個
@@ -123,26 +109,23 @@ @section Scripts { @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} @@ -39,7 +39,7 @@
- © 2026 - Altob.NtuInvoiceGateway - Privacy + © 2026 - Altob 歐特儀
diff --git a/Altob.NtuInvoiceGateway/Pages/Shared/_SimpleLayout.cshtml b/Altob.NtuInvoiceGateway/Pages/Shared/_SimpleLayout.cshtml index cec1d1d..7f55558 100644 --- a/Altob.NtuInvoiceGateway/Pages/Shared/_SimpleLayout.cshtml +++ b/Altob.NtuInvoiceGateway/Pages/Shared/_SimpleLayout.cshtml @@ -3,7 +3,7 @@ - @ViewData["Title"] - Altob.NtuInvoiceGateway + @ViewData["Title"] @@ -18,7 +18,7 @@
- © 2026 - Altob.NtuInvoiceGateway + © 2026 - Altob گS
diff --git a/Altob.NtuInvoiceGateway/Pages/TestPostInvoice.cshtml b/Altob.NtuInvoiceGateway/Pages/TestPostInvoice.cshtml index dabe75c..a217292 100644 --- a/Altob.NtuInvoiceGateway/Pages/TestPostInvoice.cshtml +++ b/Altob.NtuInvoiceGateway/Pages/TestPostInvoice.cshtml @@ -51,7 +51,7 @@
- +
diff --git a/Altob.NtuInvoiceGateway/Pages/TestPostInvoice.cshtml.cs b/Altob.NtuInvoiceGateway/Pages/TestPostInvoice.cshtml.cs index c7ee67e..f48f0bb 100644 --- a/Altob.NtuInvoiceGateway/Pages/TestPostInvoice.cshtml.cs +++ b/Altob.NtuInvoiceGateway/Pages/TestPostInvoice.cshtml.cs @@ -15,7 +15,7 @@ public class TestPostInvoiceModel : PageModel { CompanyTaxId = companyInfo.Value.TaxId; CurrentTransDateTime = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"); - CurrentOrderNo = DateTime.Now.ToString("ORDERyyyyMMddHHmmssfff"); + CurrentOrderNo = string.Format($"Order{DateTime.Now:yyyyMMddHHmmss}"); } public void OnGet() diff --git a/Altob.NtuInvoiceGateway/appsettings.Development.json b/Altob.NtuInvoiceGateway/appsettings.Development.json deleted file mode 100644 index 8a08e7c..0000000 --- a/Altob.NtuInvoiceGateway/appsettings.Development.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "DetailedErrors": true, - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - }, - "InvoiceApi": { - "Endpoint": "http://192.168.110.72:22055/api/Intella/invoiceInfo" - } -} diff --git a/Altob.NtuInvoiceGateway/appsettings.json b/Altob.NtuInvoiceGateway/appsettings.json index 6dd2c9f..532d850 100644 --- a/Altob.NtuInvoiceGateway/appsettings.json +++ b/Altob.NtuInvoiceGateway/appsettings.json @@ -1,8 +1,8 @@ { "Logging": { "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" + "Default": "Debug", + "Microsoft.AspNetCore": "Information" } }, "AllowedHosts": "*",