Esempio n. 1
0
        private void NewEnity()
        {
            var entityParameters = GetEntityParameters(AdminMappingEnum.CarSegment);

            btnDelete.Visible      = false;
            ddlCountry.Visible     = true;
            lblCountryName.Visible = false;
            List <ListItem> countries;

            using (var dataAccess = new MappingSingleSelect())
            {
                countries = AdminParameterDataAccess.GetAllCountryListItems(dataAccess.DataContext, null, false);
            }

            ddlCountry.Items.Clear();
            ddlCountry.Items.AddRange(countries.ToArray());
            if (entityParameters[DictionaryParameter.LocationCountry] == string.Empty)
            {
                ddlCountry.SelectedIndex = 0;
            }
            else
            {
                ddlCountry.SelectedValue = entityParameters[DictionaryParameter.LocationCountry];
            }

            tbCarSegment.Text = string.Empty;
            cbActive.Checked  = true;
            cbActive.Enabled  = false;
        }
        private void PopulateCountryParameters(MarsDBDataContext dataContext, string activeOnly)
        {
            var d = AdminParameterDataAccess.GetAllCountryListItems(dataContext, activeOnly);

            ddlCountry.Items.Clear();
            ddlCountry.Items.AddRange(d.ToArray());
        }
Esempio n. 3
0
        private void FillCountryDropdown()
        {
            List <ListItem> countries;

            using (var dataAccess = new MappingSingleSelect())
            {
                countries = AdminParameterDataAccess.GetAllCountryListItems(dataAccess.DataContext, false.ToString());
            }
            ddlParameterCountry.Items.AddRange(countries.ToArray());
        }
Esempio n. 4
0
        private void NewEnity()
        {
            var entityParameters = GetEntityParameters(AdminMappingEnum.OpsArea);

            btnDelete.Visible      = false;
            ddlCountry.Visible     = true;
            lblCountryName.Visible = false;
            List <ListItem> countries, regions;

            var parameters = new Dictionary <DictionaryParameter, string>();
            var selectedEntityParamCountry = entityParameters[DictionaryParameter.LocationCountry];


            using (var dataAccess = new MappingSingleSelect())
            {
                countries = AdminParameterDataAccess.GetAllCountryListItems(dataAccess.DataContext, null, false);
                if (selectedEntityParamCountry == string.Empty)
                {
                    selectedEntityParamCountry = countries[0].Value;
                }
                parameters.Add(DictionaryParameter.LocationCountry, selectedEntityParamCountry);
                regions = AdminParameterDataAccess.GetAdminRegionListItems(parameters, dataAccess.DataContext, null, false);
            }

            ddlCountry.Items.Clear();
            ddlCountry.Items.AddRange(countries.ToArray());
            if (entityParameters[DictionaryParameter.LocationCountry] == string.Empty)
            {
                ddlCountry.SelectedIndex = -1;
            }
            else
            {
                ddlCountry.SelectedValue = entityParameters[DictionaryParameter.LocationCountry];
            }

            ddlRegion.Items.Clear();
            ddlRegion.Items.AddRange(regions.ToArray());

            if (entityParameters[DictionaryParameter.Region] == string.Empty)
            {
                ddlRegion.SelectedIndex = -1;
            }
            else
            {
                ddlRegion.SelectedValue = entityParameters[DictionaryParameter.Region];
            }


            tbAreaName.Text = string.Empty;

            cbActive.Checked = true;
            cbActive.Enabled = false;
        }