/// <summary> /// 绑定区域 /// </summary> void BindArea() { //List<Area> list = new List<Area>(); //list.Add(new Area(-1, "请选择区域")); //for (int i = 1; i < 10; i++) //{ // list.Add(new Area(i, "线路" + i.ToString())); //} //ddl_area.DataSource = list; //ddl_area.DataTextField = "AreaName"; //ddl_area.DataValueField = "AreaId"; //ddl_area.DataBind(); //ddl_area.Items.FindByValue("-1").Selected = true; //list = null; EyouSoft.BLL.CompanyStructure.Area area = new EyouSoft.BLL.CompanyStructure.Area(SiteUserInfo); int userid = SiteUserInfo.ID; IList <EyouSoft.Model.CompanyStructure.Area> list = new List <EyouSoft.Model.CompanyStructure.Area>(); if (Request.QueryString["act"] == "update") { list = area.GetAreas(); } else { list = area.GetAreaList(userid); } ddl_area.Items.Add(new ListItem("-请选择-", "-1")); ddl_area.Items.FindByValue("-1").Selected = true; foreach (var v in list) { ddl_area.Items.Add(new ListItem(v.AreaName, v.Id.ToString())); } }
/// <summary> /// 绑定区域 /// </summary> void BindArea() { EyouSoft.BLL.CompanyStructure.Area area = new EyouSoft.BLL.CompanyStructure.Area(SiteUserInfo); int userid = SiteUserInfo.ID; IList <EyouSoft.Model.CompanyStructure.Area> list = new List <EyouSoft.Model.CompanyStructure.Area>(); if (Request.QueryString["act"] == "update") { list = area.GetAreas(); } else { list = area.GetAreaList(userid); } ddl_area.Items.Add(new ListItem("-请选择-", "-1")); ddl_area.Items.FindByValue("-1").Selected = true; foreach (var v in list) { ddl_area.Items.Add(new ListItem(v.AreaName, v.Id.ToString())); } }