コード例 #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     SelectJurisdictionsControl.AddCssClasses(CssClass);
     StatesPicker.AddCssClasses(InnerCssClass);
     CountiesPicker.AddCssClasses(InnerCssClass);
     LocalsPicker.AddCssClasses(InnerCssClass);
 }
コード例 #2
0
 public void Initialize(string stateCode = null, string countyCode = null,
                        string localCode = null)
 {
     if (stateCode != null)
     {
         StatesPickerSpecific.InnerText =
             StateCache.GetStateName(stateCode);
     }
     CountiesPickerAllCheckbox.Checked  = true;
     CountiesPickerAllCheckbox.Disabled = true;
     CountiesPickerListButton.Disabled  = true;
     LocalsPickerAllCheckbox.Checked    = true;
     LocalsPickerAllCheckbox.Disabled   = true;
     LocalsPickerListButton.Disabled    = true;
     if (stateCode == null)
     {
         StatesPickerAll.RemoveCssClass("hidden");
         StatesPickerAllCheckbox.Checked = true;
         StatesPickerSpecific.AddCssClasses("hidden");
         StatesPickerList.RemoveCssClass("hidden");
         BuildStatesList();
         CountiesPicker.AddCssClasses("disabled hidden");
         CountiesPickerListButtonContainer.RemoveCssClass("hidden");
         LocalsPicker.AddCssClasses("disabled hidden");
     }
     else if (countyCode == null)
     {
         CountiesPicker.AddCssClasses("hidden");
         CountiesPickerAllCheckbox.Disabled = false;
         BuildStatesList(stateCode);
         CountiesPickerList.RemoveCssClass("hidden");
         BuildCountiesList(stateCode);
         LocalsPicker.AddCssClasses("disabled hidden");
     }
     else if (localCode == null)
     {
         BuildStatesList(stateCode);
         CountiesPickerAll.AddCssClasses("hidden");
         CountiesPickerAllCheckbox.Checked = false;
         CountiesPickerSpecific.RemoveCssClass("hidden");
         CountiesPickerSpecific.InnerText =
             CountyCache.GetCountyName(stateCode, countyCode);
         BuildCountiesList(stateCode, countyCode);
         LocalsPicker.RemoveCssClass("disabled");
         LocalsPickerAllCheckbox.Disabled = false;
         LocalsPickerListButtonContainer.AddCssClasses("hidden");
         LocalsPickerList.RemoveCssClass("hidden");
         LocalsPicker.AddCssClasses("disabled hidden");
         BuildLocalsList(stateCode, countyCode);
     }
     else
     {
         BuildStatesList(stateCode);
         CountiesPickerAll.AddCssClasses("hidden");
         CountiesPickerAllCheckbox.Checked = false;
         CountiesPickerSpecific.RemoveCssClass("hidden");
         CountiesPickerSpecific.InnerText =
             CountyCache.GetCountyName(stateCode, countyCode);
         BuildCountiesList(stateCode, countyCode);
         LocalsPicker.RemoveCssClass("disabled");
         LocalsPickerAll.AddCssClasses("hidden");
         LocalsPickerAllCheckbox.Checked = false;
         LocalsPickerSpecific.RemoveCssClass("hidden");
         LocalsPickerSpecific.InnerText =
             LocalDistricts.GetLocalDistrict(stateCode, countyCode,
                                             localCode);
         LocalsPickerListButtonContainer.AddCssClasses("hidden");
         BuildLocalsList(stateCode, countyCode, localCode);
     }
 }