From a1ac4bad504c6525a352adcaf2f56498f812d47e Mon Sep 17 00:00:00 2001 From: berlin-tzen Date: Thu, 2 Feb 2023 17:50:13 +0800 Subject: [PATCH] =?UTF-8?q?[WHAT]=20Bugfix=20=E5=85=AC=E5=8F=B8=E5=9C=B0?= =?UTF-8?q?=E5=8D=80=EF=BC=8C=E5=9C=8B=E5=AE=B6=EF=BC=8C=E5=9F=8E=E5=B8=82?= =?UTF-8?q?=20API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ShowEasy/CompanyMaintain_QryService.cs | 19 +++++++++---------- .../Entity/ViewModels/View_CRM_Company.cs | 6 +++--- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/EuroTran/EasyBL.WEBAPP/ShowEasy/CompanyMaintain_QryService.cs b/EuroTran/EasyBL.WEBAPP/ShowEasy/CompanyMaintain_QryService.cs index 0fe8918..4ce9d47 100644 --- a/EuroTran/EasyBL.WEBAPP/ShowEasy/CompanyMaintain_QryService.cs +++ b/EuroTran/EasyBL.WEBAPP/ShowEasy/CompanyMaintain_QryService.cs @@ -53,13 +53,13 @@ namespace EasyBL.WEBAPP.SYS foreach (var Company in rsCompanyList) { - if (!string.IsNullOrEmpty(Company.RegionID)) { - - var Region = new SETB_SYS_Region(); + if (!string.IsNullOrEmpty(Company.RegionID)) + { - if (RegionMap.TryGetValue(Company.RegionID, out Region)) + if (RegionMap.ContainsKey(Company.RegionID)) { + var Region = RegionMap[Company.RegionID]; Company.Region.RegionID = Region.RegionID; Company.Region.RegionName = Region.RegionName; @@ -70,11 +70,9 @@ namespace EasyBL.WEBAPP.SYS if (!string.IsNullOrEmpty(Company.CountryID)) { - var Country = new SETB_SYS_Country(); - - if (CountryMap.TryGetValue(Company.CountryID, out Country)) + if (CountryMap.ContainsKey(Company.CountryID)) { - + var Country = CountryMap[Company.CountryID]; Company.Country.CountryID = Country.CountryID; Company.Country.CountryName = Country.CountryName; @@ -84,10 +82,11 @@ namespace EasyBL.WEBAPP.SYS if (!string.IsNullOrEmpty(Company.CityID)) { - var City = new SETB_UTL_City(); - if (CityMap.TryGetValue(Company.CityID, out City)) { + if (CityMap.ContainsKey(Company.CityID)) + { + var City = CityMap[Company.CityID]; Company.City.CityID = City.CityID; Company.City.CityName = City.CityName; diff --git a/EuroTran/Entity/ViewModels/View_CRM_Company.cs b/EuroTran/Entity/ViewModels/View_CRM_Company.cs index 777e5f5..9400792 100644 --- a/EuroTran/Entity/ViewModels/View_CRM_Company.cs +++ b/EuroTran/Entity/ViewModels/View_CRM_Company.cs @@ -6,11 +6,11 @@ namespace Entity.ViewModels public class View_CRM_Company : SETB_CRM_Company { - public RegionDTO Region { get; set; } + public RegionDTO Region = new RegionDTO(); - public CountryDTO Country { get; set; } + public CountryDTO Country = new CountryDTO(); - public CityDTO City { get; set; } + public CityDTO City = new CityDTO(); }