Пример #1
0
 private void setUser(int id)
 {
     if (role == "p")
     {
         var person = PersonelController.setPersonelById(id);
         textBoxName.Text       = person.personelName;
         textBoxSurname.Text    = person.personelSurname;
         textBoxTeam.Text       = person.personelTeam;
         textBoxEmail.Text      = person.personelMail;
         textBoxLocation.Text   = person.personelLocation;
         dateTimePickerSD.Value = person.personelStartDate;
     }
     else if (role == "pm")
     {
         var pm = ProjectManagerController.setProjectManagerByUserId(id);
         textBoxName.Text       = pm.projectManagerName;
         textBoxSurname.Text    = pm.projectManagerSurname;
         textBoxTeam.Text       = pm.projectManagerTeam;
         textBoxEmail.Text      = pm.projectManagerEmail;
         textBoxLocation.Text   = pm.projectManagerLocation;
         dateTimePickerSD.Value = pm.projectManagerStartDate;
     }
     else
     {
         var m = ManagerController.setManager(id);
         textBoxName.Text       = m.managerName;
         textBoxSurname.Text    = m.managerSurname;
         textBoxTeam.Text       = m.managerTeam;
         textBoxEmail.Text      = m.managerMail;
         textBoxLocation.Text   = m.managerLocation;
         dateTimePickerSD.Value = m.managerStartDate;
     }
 }
Пример #2
0
 private void setComboBoxPersonText(int id, string role)
 {
     if (role == "p")
     {
         var user = PersonelController.setPersonelById(id);
         comboBoxPersonel.Text = user.personelName + " " + user.personelSurname;
     }
     else
     {
         var user = ProjectManagerController.setProjectManagerByUserId(id);
         comboBoxPersonel.Text = user.projectManagerName + " " + user.projectManagerSurname;
     }
 }