public override void SetValues(int id) { hfAreaId.Value = id.ToString(CultureInfo.InvariantCulture); if (id == 0) { NewEnity(); return; } AreaEntity pe; List <ListItem> regions; var parameters = new Dictionary <DictionaryParameter, string>(); using (var dataAccess = new MappingSingleSelect()) { pe = dataAccess.GetAreaEntity(id); parameters.Add(DictionaryParameter.LocationCountry, pe.CountryId.ToString(CultureInfo.InvariantCulture)); regions = AdminParameterDataAccess.GetAdminRegionListItems( parameters, dataAccess.DataContext, string.Empty, false); } btnDelete.Visible = true; ddlCountry.Visible = false; lblCountryName.Visible = true; lblCountryName.Text = pe.CountryName; tbAreaName.Text = pe.AreaName; cbActive.Checked = pe.Active; cbActive.Enabled = true; hfAreaId.Value = id.ToString(CultureInfo.InvariantCulture); ddlRegion.Items.Clear(); ddlRegion.Items.AddRange(regions.ToArray()); ddlRegion.SelectedValue = pe.RegionId.ToString(CultureInfo.InvariantCulture); }
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()); }
public override void SetValues(int id) { hfLocationGroupId.Value = id.ToString(CultureInfo.InvariantCulture); if (id == 0) { NewEnity(); return; } LocationGroupEntity lge; List <ListItem> pools; var parameters = new Dictionary <DictionaryParameter, string>(); using (var dataAccess = new MappingSingleSelect()) { lge = dataAccess.GetLocationGroupEnitity(id); parameters.Add(DictionaryParameter.LocationCountry, lge.CountryId.ToString(CultureInfo.InvariantCulture)); pools = AdminParameterDataAccess.GetAdminPoolListItems( parameters, dataAccess.DataContext, string.Empty, false); } btnDelete.Visible = true; tbLocationGroup.Text = lge.LocationGroupName; lblCountryName.Text = lge.CountryName; cbActive.Checked = lge.Active; cbActive.Enabled = true; ddlPool.Items.Clear(); ddlPool.Items.AddRange(pools.ToArray()); ddlPool.SelectedValue = lge.PoolId.ToString(CultureInfo.InvariantCulture); }
private void PopulateCarClassParameters(MarsDBDataContext dataContext, string activeOnly) { var parameters = GetParameters(); var d = AdminParameterDataAccess.GetAdminCarClassListItems(parameters, dataContext, activeOnly); ddlCarClass.Items.Clear(); ddlCarClass.Items.AddRange(d.ToArray()); }
private void PopulateLocationGroupParameters(MarsDBDataContext dataContext, string activeOnly) { var parameters = GetParameters(); var d = AdminParameterDataAccess.GetAdminLocationGroupListItems(parameters, dataContext, activeOnly); ddlLocationGroup.Items.Clear(); ddlLocationGroup.Items.AddRange(d.ToArray()); }
private void FillCountryDropdown() { List <ListItem> countries; using (var dataAccess = new MappingSingleSelect()) { countries = AdminParameterDataAccess.GetAllCountryListItems(dataAccess.DataContext, false.ToString()); } ddlParameterCountry.Items.AddRange(countries.ToArray()); }
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; }
protected void ddlCarSegment_SelectionChanged(object sender, EventArgs e) { var parameters = new Dictionary <DictionaryParameter, string>(); List <ListItem> carClasses; parameters.Add(DictionaryParameter.CarSegment, ddlCarSegment.SelectedValue); using (var dataAccess = new MappingSingleSelect()) { carClasses = AdminParameterDataAccess.GetAdminCarClassListItems( parameters, dataAccess.DataContext, string.Empty, false); } SetDropDownList(ddlCarClass, carClasses, -1); ShowPopup(); }
protected void ddlRegion_SelectionChanged(object sender, EventArgs e) { var parameters = new Dictionary <DictionaryParameter, string>(); List <ListItem> areas; parameters.Add(DictionaryParameter.Region, ddlRegion.SelectedValue); using (var dataAccess = new MappingSingleSelect()) { areas = AdminParameterDataAccess.GetAdminAreaListItems( parameters, dataAccess.DataContext, string.Empty, false); } SetDropDownList(ddlArea, areas, -1); ShowPopup(); }
protected void ddlPool_SelectionChanged(object sender, EventArgs e) { var parameters = new Dictionary <DictionaryParameter, string>(); List <ListItem> locationGroups; parameters.Add(DictionaryParameter.Pool, ddlPool.SelectedValue); using (var dataAccess = new MappingSingleSelect()) { locationGroups = AdminParameterDataAccess.GetAdminLocationGroupListItems( parameters, dataAccess.DataContext, string.Empty, false); } SetDropDownList(ddlLocationGroup, locationGroups, -1); ShowPopup(); }
public override void SetValues(int id) { CarGroupEntity pe; List <ListItem> carClasses, carSegments, carGroupsGold; var parameters = new Dictionary <DictionaryParameter, string>(); using (var dataAccess = new MappingSingleSelect()) { pe = dataAccess.GetCarGroupEntity(id); parameters.Add(DictionaryParameter.CarSegment, pe.CarSegmentId.ToString(CultureInfo.InvariantCulture)); parameters.Add(DictionaryParameter.LocationCountry, pe.CountryId.ToString(CultureInfo.InvariantCulture)); carClasses = AdminParameterDataAccess.GetAdminCarClassListItems( parameters, dataAccess.DataContext, string.Empty, false); carSegments = AdminParameterDataAccess.GetAdminCarSegmentListItems( parameters, dataAccess.DataContext, string.Empty, false); carGroupsGold = AdminParameterDataAccess.GetAdminCarGroupsWithinSegmentListItems( parameters, dataAccess.DataContext, string.Empty, false); } //Need to clong this list as Selected is contained in the List Item and sharing it overrides Selected var carGroupsPlatinum = new List <ListItem>(carGroupsGold.Count); var fiveStar = new List <ListItem>(carGroupsGold.Count); var presidentCircle = new List <ListItem>(carGroupsGold.Count); foreach (var cg in carGroupsGold) { carGroupsPlatinum.Add(new ListItem(cg.Text, cg.Value)); fiveStar.Add(new ListItem(cg.Text, cg.Value)); presidentCircle.Add(new ListItem(cg.Text, cg.Value)); } lblCountryName.Text = pe.CountryName; lblCarGroup.Text = pe.CarGroupName; cbActive.Checked = pe.Active; hfCarGroupId.Value = id.ToString(CultureInfo.InvariantCulture); SetDropDownList(ddlCarClass, carClasses, pe.CarClassId); SetDropDownList(ddlCarSegment, carSegments, pe.CarSegmentId); SetDropDownListByText(ddlGoldUpgrade, carGroupsGold, pe.CarGroupGold); SetDropDownListByText(ddlPlatinum, carGroupsPlatinum, pe.CarGroupPlatinum); SetDropDownListByText(ddlFiveStarUpgrade, fiveStar, pe.CarGroupFiveStar); SetDropDownListByText(ddlPresidentCircle, presidentCircle, pe.CarGroupPresidentCircle); }
protected void ddlCountry_SelectionChanged(object sender, EventArgs e) { List <ListItem> regions; var parameters = new Dictionary <DictionaryParameter, string>(); var countryId = int.Parse(ddlCountry.SelectedValue); parameters.Add(DictionaryParameter.LocationCountry, countryId.ToString()); using (var dataAccess = new MappingSingleSelect()) { regions = AdminParameterDataAccess.GetAdminRegionListItems(parameters, dataAccess.DataContext, null, false); } ddlRegion.Items.Clear(); ddlRegion.Items.AddRange(regions.ToArray()); ShowPopup(); }
public override void SetValues(int id) { LocationEntity le; List <ListItem> locationGroups; List <ListItem> areas; List <ListItem> pools; List <ListItem> regions; var parameters = new Dictionary <DictionaryParameter, string>(); using (var dataAccess = new MappingSingleSelect()) { le = dataAccess.GetLocationEntity(id); parameters.Add(DictionaryParameter.Region, le.RegionId.ToString(CultureInfo.InvariantCulture)); parameters.Add(DictionaryParameter.Pool, le.PoolId.ToString(CultureInfo.InvariantCulture)); parameters.Add(DictionaryParameter.LocationCountry, le.CountryId.ToString(CultureInfo.InvariantCulture)); locationGroups = AdminParameterDataAccess.GetAdminLocationGroupListItems( parameters, dataAccess.DataContext, string.Empty, false); areas = AdminParameterDataAccess.GetAdminAreaListItems( parameters, dataAccess.DataContext, string.Empty, false); pools = AdminParameterDataAccess.GetAdminPoolListItems(parameters, dataAccess.DataContext, string.Empty, false); regions = AdminParameterDataAccess.GetAdminRegionListItems(parameters, dataAccess.DataContext, string.Empty, false); } acServedBy.ContextKey = le.CountryCode; lblCountryName.Text = le.CountryName; tbLocation.Text = le.LocationCode; ddlTurnaroundHours.SelectedValue = le.TurnaroundHours.ToString(); cbActive.Checked = le.Active; hfLocationId.Value = id.ToString(CultureInfo.InvariantCulture); SetDropDownList(ddlLocationGroup, locationGroups, le.LocationGroupId); SetDropDownList(ddlArea, areas, le.AreaId); SetDropDownList(ddlPool, pools, le.PoolId); SetDropDownList(ddlRegion, regions, le.RegionId); ddlLocationType.SelectedValue = le.AirportDowntownRailroad; tbLocationName.Text = le.LocationFullName; tbServedBy.Text = le.ServedBy; AddCompanyDropDownItems(le.CountryId, 0, ddlCompany); SetCompanyTypeDropdown(le.CompanyId ?? -1, le.CorporateAgencyLicencee); ddlCompany.SelectedValue = le.CompanyId.HasValue ? le.CompanyId.Value.ToString(CultureInfo.InvariantCulture) : "-1"; }