public URSAddHoursManager(int _ID, URSOverviewManager _managerOverview, Manager _manager) { InitializeComponent(); managerOverview = _managerOverview; manager = _manager; ID = _ID; }
public URSModifyHoursManager(URSOverviewManager _managerOverview, Manager _manager, int _ID) { ID = _ID; manager = _manager; managerOverview = _managerOverview; InitializeComponent(); }
//Method to activate the button to generate reports private void GenerateReportButton_Click(object sender, EventArgs e) { Report report = new Report(); URSOverviewManager managerOverview = new URSOverviewManager(ID, manager); if (reportsComboBox.Text == "Rapportage Bezettingsgraad") { report.GenerateOccupancyRate(); managerOverview.RefreshHourDataGrid(); } else if (reportsComboBox.Text == "Rapportage Maandoverzicht") { report.GenerateApprovedHours(); managerOverview.RefreshHourDataGrid(); } else { MessageBox.Show("De gewenste rapportage is niet gevonden.", "URS~Rapportage genereren", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
//Method to activitate loginbutton private void loginButton_Click(object sender, EventArgs e) { //login procedure emp.userName = userNameTextBox.Text; emp.password = passwordTextBox.Text; string loggedIn = emp.Login(emp.userName, emp.password); List <string> empData = emp.ViewData(emp.employeeID); //If loggedIn is true than open new window for correct position of employee //Else show MessageBox with error and clear textboxes if (loggedIn == "U heeft toegang") { if (emp.position == "Manager".ToLower()) { Manager manager = new Manager(emp.employeeID, empData[0], empData[1], empData[2], empData[3]); URSOverviewManager managerOverView = new URSOverviewManager(emp.employeeID, manager); managerOverView.Show(); this.Hide(); } else { Employee employee = new Employee(emp.employeeID, empData[0], empData[1], empData[2], empData[3]); URSOverviewEmployee employeeOverview = new URSOverviewEmployee(emp.employeeID, employee); employeeOverview.Show(); this.Hide(); } } else if (loggedIn == "U heeft geen toegang") { MessageBox.Show("De gebruikersnaam en-/of wachtwoord is onjuist", "URS", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); userNameTextBox.Clear(); passwordTextBox.Clear(); } else { MessageBox.Show("De database kan niet benaderd worden. Neem contact op met uw beheerder", "URS", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }