Exemplo n.º 1
0
        public ResponseDto <List <AddressCityDto> > GetCityList(AddressGetCityListCriteriaDto criteriaDto)
        {
            AddressGetCityListCriteriaBo criteriaBo = new AddressGetCityListCriteriaBo()
            {
                CountryId = criteriaDto.CountryId,
                StateId   = criteriaDto.StateId,

                Session = Session
            };

            ResponseBo <List <AddressCityBo> > responseBo = addressBusiness.GetCityList(criteriaBo);

            ResponseDto <List <AddressCityDto> > responseDto = responseBo.ToResponseDto <List <AddressCityDto>, List <AddressCityBo> >();

            if (responseBo.IsSuccess && responseBo.Bo != null)
            {
                responseDto.Dto = new List <AddressCityDto>();
                foreach (AddressCityBo itemBo in responseBo.Bo)
                {
                    responseDto.Dto.Add(new AddressCityDto()
                    {
                        Id    = itemBo.Id,
                        Name  = itemBo.Name,
                        Plate = itemBo.Plate,

                        StatedId  = itemBo.StatedId,
                        CountryId = itemBo.CountryId
                    });
                }
            }

            return(responseDto);
        }