From 847b92e56f6f16518580b2d401bf0e423bce71d9 Mon Sep 17 00:00:00 2001 From: mmrbnjd Date: Sun, 20 Oct 2024 16:46:27 +0330 Subject: [PATCH] ... --- Back/Controllers/TaxPayerController.cs | 7 ++-- Shared/Enums/CustomerType.cs | 13 ++++--- TaxPayerFull/CUSComponent/CustomerItem.razor | 37 ++++++++++++++------ TaxPayerFull/Pages/UserPanel/Customer.razor | 6 ++-- 4 files changed, 44 insertions(+), 19 deletions(-) diff --git a/Back/Controllers/TaxPayerController.cs b/Back/Controllers/TaxPayerController.cs index e491935..1fd5117 100644 --- a/Back/Controllers/TaxPayerController.cs +++ b/Back/Controllers/TaxPayerController.cs @@ -214,11 +214,12 @@ namespace Back.Controllers //شماره اقتصادی فروشنده به جاش شناسه ملی داده شد Tins = string.IsNullOrEmpty(result.tins) ? null : result.tins, //نوع شخص خریدار - Tob = level == 10 ? null : result.tob, + Tob = level == 10 ? null : result.tob==5 ? 1 : result.tob==6 ? 4 : result.tob, //شماره/شناسه ملی/شناسه مشارکت مدنی / کد فراگیر - Bid = level == 10 || string.IsNullOrEmpty(result.bid) ? null : result.bid, + Bid = level == 10 || string.IsNullOrEmpty(result.bid) || !string.IsNullOrEmpty(result.tinb) + || result.tob == 1 || result.tob == 2 || result.tob == 3 || result.tob == 4 ? null : result.bid, //شماره اقتصادی خریدار - Tinb = level == 10 || string.IsNullOrEmpty(result.tinb) ? null : result.tinb, + Tinb = level == 10 || string.IsNullOrEmpty(result.tinb) || result.tob == 5 || result.tob == 6 ? null : result.tinb, //کد شعبه فروشنده Sbc = string.IsNullOrEmpty(result.sbc) ? null : result.sbc, //کد پستی خریدار diff --git a/Shared/Enums/CustomerType.cs b/Shared/Enums/CustomerType.cs index c7cfd10..56c8fd4 100644 --- a/Shared/Enums/CustomerType.cs +++ b/Shared/Enums/CustomerType.cs @@ -1,17 +1,22 @@ using System.ComponentModel.DataAnnotations; +using System.Xml.Linq; namespace Shared.DTOs { public enum CustomerType:int { - [Display(Name = "حقیقی")] + [Display(Name = "حقیقی با کد اقتصادی")] genuine = 1, [Display(Name = "حقوقی")] legal = 2, [Display(Name = "مشارکت مدنی")] CivilPartnership = 3, - [Display(Name = "اتباع عیر ایرانی")] - NonIranianNationals = 4 - + [Display(Name = "اتباع عیر ایرانی با کد اقتصادی")] + NonIranianNationals = 4, + [Display(Name = "حقیقی با شناسه ملی")] + genuineByMeliCode = 5, + [Display(Name = "اتباع عیر ایرانی با شناسه ملی")] + NonIranianNationalsByMeliCode = 6 + } } diff --git a/TaxPayerFull/CUSComponent/CustomerItem.razor b/TaxPayerFull/CUSComponent/CustomerItem.razor index 9a1b7b3..ccee2d7 100644 --- a/TaxPayerFull/CUSComponent/CustomerItem.razor +++ b/TaxPayerFull/CUSComponent/CustomerItem.razor @@ -41,10 +41,12 @@ @@ -70,14 +72,19 @@
-
- - -
-
- - -
+ +
+ + +
+ +
+ + +
+ + +
@@ -267,6 +274,16 @@ else } public async Task OnClickAdd() { + if ((ItemSearchCustomertype == 1 || ItemSearchCustomertype == 2 || ItemSearchCustomertype == 3 || ItemSearchCustomertype == 4) && string.IsNullOrEmpty(Cus.EconomicCode)) + { + ShowDangerAlert("در این نوع خریدار کد اقتصادی الزامی می باشد"); + return; + } + if ((ItemSearchCustomertype == 5 || ItemSearchCustomertype == 6) && (string.IsNullOrEmpty(Cus.MeliCode) || string.IsNullOrEmpty(Cus.ZipCode))) + { + ShowDangerAlert("در این نوع خریدار شناسه ملی با کد پستی الزامی می باشد"); + return; + } SpinnerVisible = !SpinnerVisible; if (ItemSearchCustomertype > 0 && !string.IsNullOrEmpty(Cus.FullName)) { diff --git a/TaxPayerFull/Pages/UserPanel/Customer.razor b/TaxPayerFull/Pages/UserPanel/Customer.razor index 6272758..2813291 100644 --- a/TaxPayerFull/Pages/UserPanel/Customer.razor +++ b/TaxPayerFull/Pages/UserPanel/Customer.razor @@ -26,10 +26,12 @@