public void BindData() { //对所属部门下拉框的绑定 //DropDownList_AgencyName.DataSource = BLLAgency.FindAgencyBySecrecyLevel(Convert.ToInt32(Session["SecrecyLevel"])); List <string> list = BLLAgency.FindAgencyBySecrecyLevel(Convert.ToInt32(Session["SecrecyLevel"])); int count = list.Count(); for (int i = 0; i < count; i++) { DropDownList_AgencyName.Items.Add(list[i], (i + 1).ToString()); } DropDownList_AgencyName.DataBind(); //对所属会议下拉框的绑定 //DropDownListMeetingName.DataSource = BLLAM.FindMeetingNameBySecrecyLevel(Convert.ToInt32(Session["SecrecyLevel"])); List <string> listAgency = BLLAM.FindMeetingNameBySecrecyLevel(Convert.ToInt32(Session["SecrecyLevel"])); count = listAgency.Count(); for (int i = 0; i < count; i++) { DropDownListMeetingName.Items.Add(listAgency[i], (i + 1).ToString()); } //等级下拉框绑定(可选等级不大于登陆等级) string[] arraySecrecyLevel = new string[5] { "四级", "三级", "二级", "一级", "管理员" }; for (int i = 0; i < Convert.ToInt32(Session["SecrecyLevel"]); i++) { DropDownList_SecrecyLevel.Items.Add(arraySecrecyLevel[i], (i + 1).ToString()); } }
//对所属部门下来框的绑定 public void BindAgencyName() { List <string> listAgencyName = BLLAgency.FindAgencyBySecrecyLevel(Convert.ToInt32(Session["SecrecyLevel"])); for (int i = 0; i < listAgencyName.Count(); i++) { DropDownList_Agency.Items.Add(listAgencyName[i].ToString(), (i + 1).ToString()); } }