public static CityUIDto ToUIDto(this DataAccess.Models.City item) { CityUIDto dto = null; if (item != null) { dto = new CityUIDto { Id = item.Id, CityName = item.Name, CountryId = item.CountryId, CountryName = item.Country.Name }; } return(dto); }
public bool SaveCity(CityUIDto dto) { try { if (dto.CountryId.Equals(0)) { dto.CountryId = this.dal.GetCountyByName(dto.CountryName).Id; } var retVal = this.dal.SaveCity(dto.Id, dto.CountryId, dto.CityName); return(retVal); } catch (Exception ex) { throw ex; } }
public bool SaveCity(CityUIDto dto) { return(new CountryLogic().SaveCity(dto)); }