//初始化所属机构下拉框 public void InitDropDownList_Agency() { try { List <Common.Entities.Agency> list = BLLAgency.FindAll(Convert.ToInt32(Session["SecrecyLevel"])); for (int i = 0; i < list.Count(); i++) { DropDownList_Agency.Items.Add(list[i].AgencyName.ToString(), (i + 1).ToString()); } } catch (Exception ex) { publicmethod.SaveError(ex, this.Request); } }
//搜索框变化 protected void DropDownStudentType_SelectedIndexChanged(object sender, EventArgs e) { if (DropDownStudentType.SelectedItem.Text == "在读" || DropDownStudentType.SelectedItem.Text == "毕业") { TriggerBox.Text = ""; TriggerBox.Enabled = true; DropDownList.Enabled = true; DropDownList.Items.Clear(); StudentType(); DropDownList.EnableEdit = false; } else if (DropDownStudentType.SelectedItem.Text == "全部") { TriggerBox.Enabled = false; DropDownList.Enabled = false; DropDownList.EnableEdit = false; } else if (DropDownStudentType.SelectedItem.Text == "所属部门") { TriggerBox.Enabled = false; DropDownList.Enabled = true; DropDownList.Items.Clear(); DropDownList.EnableEdit = false; try { List <Common.Entities.Agency> list = BLLAgency.FindAll(Convert.ToInt32(Session["SecrecyLevel"])); for (int i = 0; i < list.Count(); i++) { DropDownList.Items.Add(list[i].AgencyName.ToString(), (i + 1).ToString()); } } catch (Exception ex) { publicmethod.SaveError(ex, this.Request); } } else if (DropDownStudentType.SelectedItem.Text == "学生类型") { TriggerBox.Enabled = false; DropDownList.Enabled = true; DropDownList.Items.Clear(); DropDownList.EnableEdit = false; try { List <BasicCode> list = bllBasicCode.FindALLName("学生类型"); for (int i = 0; i < list.Count(); i++) { DropDownList.Items.Add(list[i].CategoryContent.ToString(), list[i].CategoryContent.ToString()); } } catch (Exception ex) { publicmethod.SaveError(ex, this.Request); } } else { TriggerBox.Enabled = true; DropDownList.Enabled = false; DropDownList.EnableEdit = false; } }