Ejemplo n.º 1
0
        private void FillCountryDropdowns()
        {
            //List<ListItem> owningCountries, rentingCountries;
            List <ListItem> countries, countriesWithoutAllItem;

            using (var dataAccess = new BaseDataAccess())
            {
                //owningCountries = dataAccess.GetOwningCounries();
                //rentingCountries = dataAccess.GetOwningCounries();
                countries = dataAccess.GetOwningCounries();
                countriesWithoutAllItem = dataAccess.GetOwningCounries();
            }
            countries.RemoveAll(d => d.Value == string.Empty);

            countries.Insert(0, ParameterDataAccess.EmptyItem);
            ddlOwningCountry.Items.AddRange(countries.ToArray());
            ddlRentingCountry.Items.AddRange(countries.ToArray());

            countriesWithoutAllItem.RemoveAll(d => d.Value == string.Empty);
            ddlEditRentingCountry.Items.AddRange(countriesWithoutAllItem.ToArray());
        }