Example #1
0
        private void ReturnToManagementToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Hide();
            ManagerScreen screen = new ManagerScreen();

            screen.ShowDialog();
        }
        private void managementToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ManagerScreen manager = new ManagerScreen();

            this.Hide();
            manager.ShowDialog();
        }
Example #3
0
        //Opens a different form for each type of employee.
        private void LoginAccordingtoEmployeeType(Employee employee)
        {
            Session.Instance.SetLoggedEmployee(employee);
            //We have a static logged employee in our application and now we don't have to pass in the employee for each form which makes it cleaner.
            switch (Session.Instance.LoggedEmployee.EmployeeType)
            {
            case EmployeeType.Waiter:
                TableView tableForm = new TableView();
                tableForm.ShowDialog();
                break;

            case EmployeeType.Manager:
                ManagerScreen managerForm = new ManagerScreen();
                managerForm.ShowDialog();
                break;

            case EmployeeType.Bar:
            case EmployeeType.Kitchen:
                KitchenBarScreen KitchenBarForm = new KitchenBarScreen();
                KitchenBarForm.ShowDialog();
                break;

            default:
                MessageBox.Show("Employee type is not valid or not found", "Invalid employee type", MessageBoxButtons.OK, MessageBoxIcon.Information);
                break;
            }
        }