예제 #1
0
 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();
 }
예제 #2
0
        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();
        }