private void GetSelectionArea(FormType formType, SubStateReportType subStateType) { if ((subStateType == SubStateReportType.Agency || subStateType == SubStateReportType.AgencyPam) && (formType == FormType.ClientContact || formType == FormType.PublicMediaActivity)) { Agencies = AgencyLogic.GetAgencies(DefaultState.Code); var _agencies = new List <KeyValuePair <string, string> >(); _agencies.AddRange(Agencies.Select((pair => (new KeyValuePair <string, string>(pair.Key.ToString(), pair.Value))))); DynamicSubStateRegions = _agencies; } else if ((subStateType == SubStateReportType.CountycodeOfClientRes || subStateType == SubStateReportType.CountyOfCounselorLocation || subStateType == SubStateReportType.CountycodeOfEvent) && (formType == FormType.ClientContact || formType == FormType.PublicMediaActivity)) { DynamicSubStateRegions = AgencyLogic.GetCounties(DefaultState.Code); } else if ((subStateType == SubStateReportType.ZIPCodeOfClientRes || subStateType == SubStateReportType.ZIPCodeOfCounselorLocation) && (formType == FormType.ClientContact)) { IEnumerable <ZipCountyView> zipCode = LookupBLL.GetZipCodesAndCountyFIPSForState(DefaultState.Code); var _zips = new List <KeyValuePair <string, string> >(); _zips.AddRange(zipCode.Select((pair => (new KeyValuePair <string, string>(pair.Zipcode.ToString(), pair.Zipcode))))); DynamicSubStateRegions = _zips; } }
protected void BindFormData() { //OLD logic //Counselors = AgencyLogic.GetAgencyUsers(ViewData.AgencyId, Descriptor.Counselor, true).OrderBy(p => p.Value); Counselors = GetCounselors(ViewData.AgencyId); CMSSpecialFields = Logic.GetCMSSpecialFields(); StateSpecialFields = Logic.GetStateSpecialFields(ViewData.AgencyState); CounselorCounties = AgencyLogic.GetCounties(ViewData.AgencyState.Code); ClientCounties = LookupBLL.GetCountiesForZipCode(ViewData.ClientZIPCode); CounselorCounties = CounselorCounties; CounselorZipCodes = LookupBLL.GetZipCodeForCountyFips2(ViewData.CounselorCountyCode); }
protected void dropDownListCounselor_SelectedIndexChanged(object sender, EventArgs e) { var dropDownListCounselor = (DropDownList)sender; var counselorIdSelected = (!string.IsNullOrEmpty(dropDownListCounselor.SelectedValue)) ? Convert.ToInt32(dropDownListCounselor.SelectedValue) : 0; if (counselorIdSelected == 0) { return; } var counselor = UserBLL.GetUserAccount(counselorIdSelected); if (counselor == null) { return; } var dropDownListCounselorCounty = formViewEditClientContact.FindControl("dropDownListCounselorCounty") as DropDownList; dropDownListCounselorCounty.DataSource = AgencyLogic.GetCounties(ViewData.AgencyState.Code); dropDownListCounselorCounty.DataBind(); dropDownListCounselorCounty.Items.Insert(0, new ListItem("-- Select a County --", "")); var county = dropDownListCounselorCounty.Items.FindByValue(counselor.CounselingCounty); if (county != null) { county.Selected = true; } var dropDownListCounselorZipCode = formViewEditClientContact.FindControl("dropDownListCounselorZipCode") as DropDownList; dropDownListCounselorZipCode.DataSource = LookupBLL.GetZipCodeForCountyFips(counselor.CounselingCounty); dropDownListCounselorZipCode.DataBind(); dropDownListCounselorZipCode.Items.Insert(0, new ListItem("-- Select a Zip Code --", "")); var zip = dropDownListCounselorZipCode.Items.FindByText(counselor.CounselingLocation); if (zip != null) { zip.Selected = true; } dropDownListCounselorCounty.Focus(); }
/// <summary> /// Binds the dependent data for the form. /// </summary> protected void BindDependentData() { DynamicSubStateRegions = null; States = AgencyLogic.GetStates(); DropDownList ctrlForm = (DropDownList)formViewSubStateRegionForReport.FindControl("dropDownListFormType"); int _formType = Convert.ToInt32(ctrlForm.SelectedValue); DropDownList ctrlGroup = (DropDownList)formViewSubStateRegionForReport.FindControl("dropDownListGroupype"); int _groupType = Convert.ToInt32(ctrlGroup.SelectedValue); if (_groupType > 0 && _formType > 0) { FormType formType = (FormType)_formType; SubStateReportType subStateType = (SubStateReportType)_groupType; if ((subStateType == SubStateReportType.Agency || subStateType == SubStateReportType.AgencyPam) && (formType == FormType.ClientContact || formType == FormType.PublicMediaActivity)) { Agencies = AgencyLogic.GetAgencies(DefaultState.Code); var _agencies = new List <KeyValuePair <string, string> >(); _agencies.AddRange(Agencies.Select((pair => (new KeyValuePair <string, string>(pair.Key.ToString(), pair.Value))))); DynamicSubStateRegions = _agencies; } else if ((subStateType == SubStateReportType.CountycodeOfClientRes || subStateType == SubStateReportType.CountyOfCounselorLocation || subStateType == SubStateReportType.CountycodeOfEvent) && (formType == FormType.ClientContact || formType == FormType.PublicMediaActivity)) { DynamicSubStateRegions = AgencyLogic.GetCounties(DefaultState.Code); } else if ((subStateType == SubStateReportType.ZIPCodeOfClientRes || subStateType == SubStateReportType.ZIPCodeOfCounselorLocation) && (formType == FormType.ClientContact)) { IEnumerable <ZipCountyView> zipCode = LookupBLL.GetZipCodesAndCountyFIPSForState(DefaultState.Code); var _zips = new List <KeyValuePair <string, string> >(); _zips.AddRange(zipCode.Select((pair => (new KeyValuePair <string, string>(pair.Zipcode.ToString(), pair.Zipcode))))); DynamicSubStateRegions = _zips; } } }