Ejemplo n.º 1
0
 public NewEmployeeView(LogicSystem logic)
 {
     InitializeComponent();
     _logic = logic;
     _newEmployeeViewModel     = new NewEmployeeViewModel(_logic);
     cmbSupervisors.DataSource = _newEmployeeViewModel.FillSupervisors();
     cmbPermissions.DataSource = _newEmployeeViewModel.FillPermissions(EnumPermissions.Admin);
     _newEmployeeViewModel     = new NewEmployeeViewModel(_logic);
 }
Ejemplo n.º 2
0
 public NewEmployeeView(Person person, Employee employee, LogicSystem logic, EnumPermissions permissions)
 {
     InitializeComponent();
     _logic = logic;
     _newEmployeeViewModel        = new NewEmployeeViewModel(person, employee, _logic);
     cmbSupervisors.DataSource    = _newEmployeeViewModel.FillSupervisors();
     cmbSupervisors.SelectedIndex = cmbSupervisors.FindStringExact(_newEmployeeViewModel.GetSupervisor(employee.IdSupervisor).ToString());
     textBoxFirstName.Text        = _newEmployeeViewModel.Person.FirstName;
     textBoxLastName.Text         = _newEmployeeViewModel.Person.LastName;
     textBoxPhoneNumber.Text      = _newEmployeeViewModel.Person.PhoneNumber;
     textAdress.Text             = _newEmployeeViewModel.Person.Adress;
     cmbPermissions.DataSource   = _newEmployeeViewModel.FillPermissions(permissions);
     cmbPermissions.SelectedItem = _newEmployeeViewModel.EmployeePermission(employee);
     textBoxPassword.Visible     = false;
     /// <summary>
     /// in case this form is used on updating info, we need to hide "Password" line, thats why this line is here and not in designer
     /// </summary>
     panel2.Height = 296;
 }