예제 #1
0
 public URSModifyHoursEmployee(URSOverviewEmployee _employeeOverview, Employee _employee, int _ID)
 {
     ID = _ID;
     employeeOverview = _employeeOverview;
     employee         = _employee;
     InitializeComponent();
 }
예제 #2
0
 public URSAddHoursEmployee(int _ID, URSOverviewEmployee _employeeOverview, Employee _employee)
 {
     ID = _ID;
     employeeOverview = _employeeOverview;
     employee         = _employee;
     InitializeComponent();
 }
예제 #3
0
        //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);
            }
        }