示例#1
0
        private void btnTeachers_Click(object sender, EventArgs e)
        {
            ucAddStudent1.Hide();
            ucAddCourse1.Hide();
            ucAddProgram1.Hide();
            ucAddDepartment1.Hide();

            //adding departments in cb
            ucAddTeacher1.cbDepartment.DataSource = null;
            var departments = departmentCRUD.GetAllDepartments();

            ucAddTeacher1.cbDepartment.DataSource    = departments;
            ucAddTeacher1.cbDepartment.ValueMember   = "DepartmentId";
            ucAddTeacher1.cbDepartment.DisplayMember = "Name";

            ucAddTeacher1.BringToFront();
            ucAddTeacher1.Show();
        }
 private void btnLoadRecords_Click(object sender, EventArgs e)
 {
     try
     {
         dgvDepartments.DataSource = departmentCRUD.GetAllDepartments();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
示例#3
0
 public List <Department> GetAllDepartments(string sortOrder, string searchString)
 {
     return(departmentTableActions.GetAllDepartments(sortOrder, searchString));
 }