Esempio n. 1
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;
            }
        }
Esempio n. 2
0
        private void btnKitchen_Click(object sender, EventArgs e)
        {
            KitchenBarScreen kitchenBar = new KitchenBarScreen();

            this.Hide();
            kitchenBar.ShowDialog();
        }