Browse Source

[WHAT] Bugfix 公司地區,國家,城市 API

Dev
berlin-tzen 2 years ago
parent
commit
a1ac4bad50
  1. 19
      EuroTran/EasyBL.WEBAPP/ShowEasy/CompanyMaintain_QryService.cs
  2. 6
      EuroTran/Entity/ViewModels/View_CRM_Company.cs

19
EuroTran/EasyBL.WEBAPP/ShowEasy/CompanyMaintain_QryService.cs

@ -53,13 +53,13 @@ namespace EasyBL.WEBAPP.SYS
foreach (var Company in rsCompanyList) { 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.RegionID = Region.RegionID;
Company.Region.RegionName = Region.RegionName; Company.Region.RegionName = Region.RegionName;
@ -70,11 +70,9 @@ namespace EasyBL.WEBAPP.SYS
if (!string.IsNullOrEmpty(Company.CountryID)) 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.CountryID = Country.CountryID;
Company.Country.CountryName = Country.CountryName; Company.Country.CountryName = Country.CountryName;
@ -84,10 +82,11 @@ namespace EasyBL.WEBAPP.SYS
if (!string.IsNullOrEmpty(Company.CityID)) 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.CityID = City.CityID;
Company.City.CityName = City.CityName; Company.City.CityName = City.CityName;

6
EuroTran/Entity/ViewModels/View_CRM_Company.cs

@ -6,11 +6,11 @@ namespace Entity.ViewModels
public class View_CRM_Company : SETB_CRM_Company 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();
} }

Loading…
Cancel
Save