// 加载 private void AdminManage_Load(object sender, EventArgs e) { radioButton1.Select(); radioButton4.Select(); String sqlLangauge = "SELECT departName FROM Department"; otherFunction.GetComboBoxValues(sqlLangauge, comboBox1, "departName"); comboBox4.Items.Add("所有部门"); comboBox3.Items.Add("所有职务"); otherFunction.GetComboBoxValues(sqlLangauge, comboBox4, "departName"); DataSet dataSet = SqlFunction.GetDs("SELECT departName FROM Department"); DataView dataView = dataSet.Tables[0].DefaultView; departArry = new String[dataView.Count]; for (int i = 0; i < dataView.Count; i++) { departArry[i] = dataView[i]["departName"].ToString(); } for (int i = 0; i < posttArry.Length; i++) { comboBox2.Items.Add(posttArry[i]); comboBox3.Items.Add(posttArry[i]); } GetNewValues(psString); comboBox3.SelectedIndex = 0; comboBox4.SelectedIndex = 0; checkBox1.Checked = true; checkBox2.Checked = true; }
private void AttendanceSearch_Load(object sender, EventArgs e)//加载各类初始化 { String sqlLangauge = "SELECT departName FROM Department"; comboBox1.Items.Add("所有科室"); otherFunction.GetComboBoxValues(sqlLangauge, comboBox1, "departName"); DataSet dataSet = SqlFunction.GetDs(sqlLangauge); DataView dataView = dataSet.Tables[0].DefaultView; departArry = new String[dataView.Count + 1]; departArry[0] = "所有科室"; for (int i = 1; i < dataView.Count + 1; i++) { departArry[i] = dataView[i - 1]["departName"].ToString(); } comboBox1.SelectedIndex = 0; }
private void AttendanceManage_Load(object sender, EventArgs e)//加载各种初始化 { GetNewStudentValues(psStudent); GetNewActivelyValues(psActivity); String sqlLangauge = "SELECT departName FROM Department"; comboBox1.Items.Add("所有科室"); otherFunction.GetComboBoxValues(sqlLangauge, comboBox1, "departName"); comboBox1.SelectedIndex = 0; DataSet dataSet = SqlFunction.GetDs(sqlLangauge); DataView dataView = dataSet.Tables[0].DefaultView; departArry = new String[dataView.Count + 1]; departArry[0] = "所有科室"; for (int i = 1; i < dataView.Count + 1; i++) { departArry[i] = dataView[i - 1]["departName"].ToString(); } checkBox2.Checked = true; GetNewValues(); }