Beispiel #1
0
        public void SelectRegion(string country, string province, string city, string area)
        {
            string selectedValue = this.DropCountry.SelectedValue;
            string str2          = this.DropProvince.SelectedValue;
            string str3          = this.DropCity.SelectedValue;

            if (this.DropCountry.Items.Count == 0)
            {
                this.DropCountry.DataSource = Region.GetCountryList();
                this.DropCountry.DataBind();
                this.DropCountry.Items.Insert(0, new ListItem("请选择所属国家", "-1"));
            }
            if (selectedValue != country)
            {
                BaseUserControl.SetSelectedIndexByValue(this.DropCountry, country);
                this.DropProvince.DataSource = Region.GetProvinceListByCountry(country);
                this.DropProvince.DataBind();
            }
            if (str2 != province)
            {
                BaseUserControl.SetSelectedIndexByValue(this.DropProvince, province);
                this.DropCity.DataSource = Region.GetCityListByProvince(province);
                this.DropCity.DataBind();
            }
            if (str3 != city)
            {
                BaseUserControl.SetSelectedIndexByValue(this.DropCity, city);
                this.DropArea.DataSource = Region.GetAreaListByCity(this.DropCity.SelectedValue);
                this.DropArea.DataBind();
            }
            BaseUserControl.SetSelectedIndexByValue(this.DropArea, area);
        }
Beispiel #2
0
        protected void SetSelectedValue(string value)
        {
            string str = base.Settings[1];

            if (str != null)
            {
                if (!(str == "1"))
                {
                    if (!(str == "2"))
                    {
                        if (!(str == "3"))
                        {
                            if (str == "4")
                            {
                                this.SetListControlValue(this.ChkList, value);
                            }
                            return;
                        }
                        BaseUserControl.SetSelectedIndexByValue(this.RadlList, value);
                        return;
                    }
                }
                else
                {
                    BaseUserControl.SetSelectedIndexByValue(this.DrpList, value);
                    return;
                }
                this.SetListControlValue(this.LstListBox, value);
            }
        }
Beispiel #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         string    tableName;
         int       id            = DataConverter.CLng(base.Settings[0]);
         ModelInfo modelInfoById = ModelManager.GetModelInfoById(id);
         if (Field.GetFieldInfoByFieldName(id, base.Settings[1]).FieldLevel == 0)
         {
             tableName = "PE_CommonModel";
         }
         else
         {
             tableName = modelInfoById.TableName;
         }
         if (Field.FieldExists(id, base.Settings[1]))
         {
             ArrayList list = ModelManager.GetLookupField(tableName, base.Settings[1], id);
             this.DropSelectItem.DataSource = list;
             this.DropSelectItem.DataBind();
         }
         BaseUserControl.SetSelectedIndexByValue(this.DropSelectItem, this.FieldValue);
     }
     else
     {
         this.FieldValue = this.DropSelectItem.SelectedValue;
     }
 }
 private void DropCountryDataBind(string country)
 {
     this.DropCountry.DataSource = Region.GetCountryList();
     this.DropCountry.DataBind();
     if (string.IsNullOrEmpty(country))
     {
         ListItem item = new ListItem("请选择", "");
         this.DropCountry.Items.Insert(0, item);
         this.DropCountry.SelectedIndex = this.DropCountry.Items.IndexOf(item);
     }
     else
     {
         BaseUserControl.SetSelectedIndexByValue(this.DropCountry, country);
     }
 }
 private void DropProvinceDataBind(string country, string province)
 {
     if (string.IsNullOrEmpty(country))
     {
         this.DropProvince.Enabled = false;
         ListItem item = new ListItem("请选择国家", "");
         this.DropProvince.Items.Insert(0, item);
         this.DropProvince.SelectedIndex = this.DropProvince.Items.IndexOf(item);
     }
     else
     {
         this.DropProvince.Enabled    = true;
         this.DropProvince.DataSource = Region.GetProvinceListByCountry(country);
         this.DropProvince.DataBind();
         ListItem item2 = new ListItem("请选择", "");
         this.DropProvince.Items.Insert(0, item2);
         BaseUserControl.SetSelectedIndexByValue(this.DropProvince, province);
     }
 }
 private void DropCityDataBind(string province, string city)
 {
     if (string.IsNullOrEmpty(province))
     {
         this.DropCity.Enabled = false;
         ListItem item = new ListItem("请选择省份", "");
         this.DropCity.Items.Insert(0, item);
         this.DropCity.SelectedIndex = this.DropCity.Items.IndexOf(item);
     }
     else
     {
         this.DropCity.Enabled    = true;
         this.DropCity.DataSource = Region.GetCityListByProvince(province);
         this.DropCity.DataBind();
         ListItem item2 = new ListItem("请选择", "");
         this.DropCity.Items.Insert(0, item2);
         BaseUserControl.SetSelectedIndexByValue(this.DropCity, city);
     }
 }