Exemple #1
0
        private async void frmCityRequest_Load(object sender, EventArgs e)
        {
            if (cbxCountryId.Items.Count == 0)
            {
                cbxCountryId = await cbxHelper.GetCountries(cbxCountryId);
            }
            if (_id.HasValue)
            {
                var model = await _cityAPIService.GetById <CityDTO>(_id.Value);

                ControlsHelper.MapPropsToControls(model, gbxCityData);
                cbxCountryId.SelectedValue = model.CountryId;
            }
        }
Exemple #2
0
        private async void SetCityTab()
        {
            if (cbxCountryId.Items.Count == 0)
            {
                cbxCountryId = await cbxHelper.GetCountries(cbxCountryId);
            }

            var searchObject = ControlsHelper.MapControlsToProps(new CitySearchRequest(), gbxCityFilters);

            searchObject.Country = new CountryDTO();

            var data = await _cityAPIService.Get <List <CityDTO> >(searchObject);

            dgvCity.DataSource = data.Select(x => new
            {
                x.Id,
                x.Name,
                Country = x.Country.Name
            }).ToList();
        }