public ProfessorUpdate(IProfessorViewModel professorViewModel, Professor professor) { InitializeComponent(); _professorViewModel = professorViewModel; professorToBeUpdated = professor; _departments = _professorViewModel.GetDepartments(); _departments.Insert(0, new Department() { ID = 0, DepartmentCode = "", DepartmentDescription = "Please Select" }); ucProfessor.cboDepartment.DataSource = _departments; ucProfessor.cboDepartment.DisplayMember = "DepartmentDescription"; ucProfessor.cboDepartment.ValueMember = "DepartmentCode"; InitializeProfessorUserControl(); }
public ProfessorCreate(IProfessorViewModel professorViewModel) { _professorViewModel = professorViewModel; InitializeComponent(); _departments = _professorViewModel.GetDepartments(); _departments.Insert(0, new Department() { ID = 0, DepartmentCode = "", DepartmentDescription = "Please Select" }); ucProfessor.cboDepartment.DataSource = _departments; ucProfessor.cboDepartment.DisplayMember = "DepartmentDescription"; ucProfessor.cboDepartment.ValueMember = "DepartmentCode"; ucProfessor.lblID.Hide(); ucProfessor.txtID.Hide(); }
public Index(IDepartmentViewModel departmentViewModel, ICourseViewModel courseViewModel, IProfessorViewModel professorViewModel, IStudentViewModel studentViewModel) { _departmentViewModel = departmentViewModel; _courseViewModel = courseViewModel; _professorViewModel = professorViewModel; _studentViewModel = studentViewModel; InitializeComponent(); //1. Instantiate the Department user control. DepartmentSearchUserControl departmentSearchUserControl = new DepartmentSearchUserControl(_departmentViewModel); //2. Add it to Tab page with name tabDepartments tabIndex.TabPages["pageDepartments"].Controls.Add(departmentSearchUserControl); //3. Dock the department user control as fill. departmentSearchUserControl.Dock = DockStyle.Fill; //4. Instantiate user control for courses. CourseSearchUserControl courseSearchUserControl = new CourseSearchUserControl(_courseViewModel); //5. Add it to tab page pageCourses. tabIndex.TabPages["pageCourses"].Controls.Add(courseSearchUserControl); //6. Dock user control for courses as fill. courseSearchUserControl.Dock = DockStyle.Fill; //7. Instantiate user control for courses. ProfessorSearchUserControl professorSearchUserControl = new ProfessorSearchUserControl(_professorViewModel); //8. Add it to tab page pageCourses. tabIndex.TabPages["pageProfessors"].Controls.Add(professorSearchUserControl); //9. Dock user control for courses as fill. professorSearchUserControl.Dock = DockStyle.Fill; //10. Instantiate user control for students. StudentSearchUserControl studentSearchUserControl = new StudentSearchUserControl(_studentViewModel); //11. Add it to tab page pageStudents. tabIndex.TabPages["pageStudents"].Controls.Add(studentSearchUserControl); //12. Dock user control for courses as fill. studentSearchUserControl.Dock = DockStyle.Fill; }
public ProfessorSearchUserControl(IProfessorViewModel professorViewModel) { InitializeComponent(); _professorViewModel = professorViewModel; LoadData(); }