Beispiel #1
0
        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);
        }
Beispiel #2
0
        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;
            }
        }
Beispiel #3
0
 public bool SaveCity(CityUIDto dto)
 {
     return(new CountryLogic().SaveCity(dto));
 }