Exemplo n.º 1
0
        public OrderForm(Employee LoggedUser, LoginForm loginForm, TableViewForm tableView, DiningTable diningTable)
        {
            InitializeComponent();

            //Saving the user that is logged in and passing the login form, have it's reference
            LoggedInEmployee = LoggedUser;
            this.loginForm   = loginForm;
            this.tableView   = tableView;

            table = diningTable;
            DisplayMainCatagories();
        }
Exemplo n.º 2
0
        public PaymentForm(Employee LoggedUser, LoginForm loginForm, Order order, TableViewForm tableView)
        {
            InitializeComponent();

            //Saving the user that is logged in and passing the login form, have it's reference
            LoggedInEmployee = LoggedUser;
            this.loginForm   = loginForm;
            this.tableView   = tableView;

            //Passing the order along that will be payed
            this.order = order;
        }
Exemplo n.º 3
0
        private void btn_Login_Click(object sender, EventArgs e)
        {
            if (EmployeeDB.CheckUsername(txt_LoginUsername.Text))
            {
                if (EmployeeDB.CheckPassword(txt_LoginUsername.Text, txt_LoginPassword.Text))
                {
                    LoggedInEmployee = EmployeeDB.GetEmployee(txt_LoginUsername.Text);

                    switch (LoggedInEmployee.Position)
                    {
                    case EmployeePosition.Bartender:
                    case EmployeePosition.Chef:
                        OrdersListForm orderlistForm = new OrdersListForm(LoggedInEmployee, this);
                        orderlistForm.Show();
                        break;

                    case EmployeePosition.Waiter:
                        TableViewForm tableViewForm = new TableViewForm(LoggedInEmployee, this);
                        tableViewForm.Show();
                        break;

                    case EmployeePosition.Manager:
                        MessageBox.Show("NO MANAGER FUNCTIONS AVAILABLE", "", MessageBoxButtons.OK);
                        break;

                    default:
                        break;
                    }

                    //Hide this form
                    Hide();
                }
                else
                {
                    MessageBox.Show("Incorrect Password", "", MessageBoxButtons.OK);
                }
            }
            else
            {
                MessageBox.Show($"User {txt_LoginUsername.Text} does not exist.", "", MessageBoxButtons.OK);
            }
        }