コード例 #1
0
 /// <summary>
 /// 绑定教师信息到GridView
 /// </summary>
 /// <param name="dGV">要绑定的GridView</param>
 /// <param name="dt">绑定的DataTable</param>
 public static void GetTeacherEntityToDataGridView(DataGridView dGV, DataTable dt)
 {
     try
     {
         CommonUIDataBindMethod.BindDataGridView(dGV, dt, ColumnHeaderTextModel.Teacher.TeacherForDataGridView.ColumnsNames(), ColumnHeaderTextModel.Teacher.TeacherForDataGridView.DisplayNames());
     }
     catch
     {
     }
 }
コード例 #2
0
 public static void BindDepartmentEntitytoCombobox(ComboBox comboBox)
 {
     try
     {
         Department_BLL D_Dal          = new Department_BLL();
         var            DepartmentList = D_Dal.GetAllEntityFromDAL();
         CommonUIDataBindMethod.BindComboBox(comboBox, DepartmentList, "DeptName", "DeptID", "--所有部门--");
         //comboBox.SelectedValue = DepartmentList.Find(d => d.DeptID == "0").DeptID;
         D_Dal = null;
     }
     catch (Exception ex)
     {
         MessageBox.Show("程序发生错误,信息: " + ex.Message);
     }
 }
コード例 #3
0
 /// <summary>
 /// 绑定全部学年信息到ComboBox
 /// </summary>
 /// <param name="comboBox"></param>
 public static void BindActiveYearEntitytoCombobox(ComboBox comboBox)
 {
     try
     {
         ActiveYear_BLL ActiveYearBLL     = new ActiveYear_BLL();
         var            AllActiveYearList = ActiveYearBLL.GetActiveYearForComboBox();
         CommonUIDataBindMethod.BindComboBox(comboBox, AllActiveYearList, "ATName", "ATID", "--所有学期--");
         comboBox.SelectedValue = AllActiveYearList.Find(d => d.State == "当前").ATID;
         ActiveYearBLL          = null;
     }
     catch (Exception ex)
     {
         MessageBox.Show("程序发生错误,信息: " + ex.Message);
     }
 }