private void userCheck(string role) { if (role == "p") { var x = PersonelController.setPersonelById(userId); setUser(x.personelId, x.personelName, x.personelSurname, x.personelMail, x.personelTeam, x.personelStartDate, x.personelLocation); setPersonProjects(userId); setPersonTasks(userId); } else if (role == "pm") { var x = ProjectManagerController.setProjectManagerByUserId(userId); setUser(x.projectManagerId, x.projectManagerName, x.projectManagerSurname , x.projectManagerEmail, x.projectManagerTeam, x.projectManagerStartDate, x.projectManagerLocation); setProjectManagerProjects(userId); setProjectManagerTasks(userId); } else { var x = ManagerController.setManager(userId); setUser(x.managerId, x.managerName, x.managerSurname, x.managerMail, x.managerTeam, x.managerStartDate, x.managerLocation); setProjects(); tabControl1.TabPages.Remove(tabPage2); } }
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; } }
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; } }