private void BindProvince() { Dictionary <int, AreaEntity> dic = new AreaDac().GetProvinces(); if (dic != null && dic.Count != 0) { for (int i = 0; i < dic.Count; i++) { ddlProvince.Items.Add(new ListItem(dic.Values.ElementAt(i).ProvinceName, dic.Values.ElementAt(i).SysNo.ToString())); } } }
public ArrayList GetCityList(int provinceSysNo) { Dictionary <int, AreaEntity> dic = new AreaDac().GetCitiesByProvinceSysNo(provinceSysNo); ArrayList reAL = new ArrayList(); if (dic != null && dic.Count > 0) { for (int i = 0; i < dic.Count; i++) { string[] itemArr = new string[2]; itemArr[0] = dic.Values.ElementAt(i).SysNo.ToString(); itemArr[1] = dic.Values.ElementAt(i).CityName.ToString(); reAL.Insert(i, itemArr); } } return(reAL); }
private void BindDistrict(int citySysNo, int districtSysNo) { if (Convert.ToInt32(hidAreaLevelSysNo.Value) <= 2 && hidAreaLevelSysNo.Value != "-9999") { return; } ddlDistrict.Enabled = (Enable && DistrictEnable); Dictionary <int, AreaEntity> dic = new AreaDac().GetDistrictsByCitySysNo(citySysNo); if (dic != null && dic.Count != 0) { for (int i = 0; i < dic.Count; i++) { ddlDistrict.Items.Add(new ListItem(dic.Values.ElementAt(i).DistrictName, dic.Values.ElementAt(i).SysNo.ToString())); } } ddlDistrict.SelectedValue = districtSysNo.ToString(); hidDistrictSysNo.Value = districtSysNo.ToString(); }
private void BindCity(int provinceSysNo, int citySysNo) { if (Convert.ToInt32(hidAreaLevelSysNo.Value) <= 1 && hidAreaLevelSysNo.Value != "-9999") { return; } ddlCity.Enabled = (Enable && CityEnable); Dictionary <int, AreaEntity> dic = new AreaDac().GetCitiesByProvinceSysNo(provinceSysNo); if (dic != null && dic.Count != 0) { for (int i = 0; i < dic.Count; i++) { ddlCity.Items.Add(new ListItem(dic.Values.ElementAt(i).CityName, dic.Values.ElementAt(i).SysNo.ToString())); } } ddlCity.SelectedValue = citySysNo.ToString(); hidCitySysNo.Value = citySysNo.ToString(); }
private void BindZone(int districtSysNo, int zoneSysNo) { if (Convert.ToInt32(hidAreaLevelSysNo.Value) <= 3 && hidAreaLevelSysNo.Value != "-9999") { return; } ddlZone.Enabled = Enable; Dictionary <int, AreaEntity> dic = new AreaDac().GetZonesByDistrictSysNo(districtSysNo); if (dic != null && dic.Count != 0) { for (int i = 0; i < dic.Count; i++) { ddlZone.Items.Add(new ListItem(dic.Values.ElementAt(i).ZoneName, dic.Values.ElementAt(i).SysNo.ToString())); } } ddlZone.SelectedValue = zoneSysNo.ToString(); hidZoneSysNo.Value = zoneSysNo.ToString(); }