Пример #1
0
 static void Main()
 {
     Application.SetHighDpiMode(HighDpiMode.SystemAware);
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Application.Run(ProgramControl.GetInstance().LoginView);
 }
Пример #2
0
 private void CheckOutButton_Click(object sender, EventArgs e)
 {
     ProgramControl.GetInstance().TableCurrentlySelected.GetTableOrder().CheckOut();
     this.CartDisplay.Text         = ProgramControl.GetInstance().TableCurrentlySelected.GetTableOrder().PrintChangeOrder();
     this.SubmittedOrderLabel.Text = ProgramControl.GetInstance().TableCurrentlySelected.GetTableOrder().PrintSubmittedOrder();
     this.TotalAmtLabel.Text       = "$" + Convert.ToString(ProgramControl.GetInstance().TableCurrentlySelected.GetTableOrder().TotalCost);
     this.AmtDueLabel.Text         = "$" + Convert.ToString(ProgramControl.GetInstance().TableCurrentlySelected.GetTableOrder().TotalCost);
 }
Пример #3
0
 public void CheckOut() ///execute when Checkout button is pressed in OrderView
 {
     paid = true;
     ProgramControl.GetInstance().TableCurrentlySelected.Status = TableStatus.Dirty;
     SubmittedTableOrder.Clear();
     ChangeTableOrder.Clear();
     totalCost = 0;
 }
Пример #4
0
 protected override void OnVisibleChanged(EventArgs e)
 {
     ///when the screen becomes visible, then change the text
     base.OnVisibleChanged(e);
     this.TableNumLabel.Text       = ProgramControl.GetInstance().TableCurrentlySelected.TableId;
     this.CartDisplay.Text         = ProgramControl.GetInstance().TableCurrentlySelected.GetTableOrder().PrintChangeOrder();
     this.SubmittedOrderLabel.Text = ProgramControl.GetInstance().TableCurrentlySelected.GetTableOrder().PrintSubmittedOrder();
     this.TotalAmtLabel.Text       = "$" + Convert.ToString(ProgramControl.GetInstance().TableCurrentlySelected.GetTableOrder().TotalCost);
     this.AmtDueLabel.Text         = "$" + Convert.ToString(ProgramControl.GetInstance().TableCurrentlySelected.GetTableOrder().TotalCost);
 }
Пример #5
0
 private void SubmitOrderChangesButton_Click(object sender, EventArgs e)
 {
     ProgramControl.GetInstance().TableCurrentlySelected.GetTableOrder().SubmitOrder();
     this.SubmittedOrderLabel.Text = ProgramControl.GetInstance().TableCurrentlySelected.GetTableOrder().PrintSubmittedOrder();
     this.CartDisplay.Text         = ProgramControl.GetInstance().TableCurrentlySelected.GetTableOrder().PrintChangeOrder();
     this.TotalAmtLabel.Text       = "$" + Convert.ToString(ProgramControl.GetInstance().TableCurrentlySelected.GetTableOrder().TotalCost);
     this.AmtDueLabel.Text         = "$" + Convert.ToString(ProgramControl.GetInstance().TableCurrentlySelected.GetTableOrder().TotalCost);
     ProgramControl.GetInstance().Restaurant.ordersToFulfil.Enqueue(ProgramControl.GetInstance().TableCurrentlySelected.GetTableOrder());
     ProgramControl.GetInstance().Restaurant.PrintOrdersToFulfil();
 }
Пример #6
0
 public void SubmitOrder() ///Execute when Submit button is pressed in OrderView
 {
     ///this would also send order to cooks screen
     foreach (OrderItem item in ChangeTableOrder)
     {
         SubmittedTableOrder.Add(item);
     }
     ChangeTableOrder.Clear();
     ProgramControl.GetInstance().TableCurrentlySelected.Status = TableStatus.Occupied;
 }
Пример #7
0
 private void DeleteItemButton_Click(object sender, EventArgs e)
 {
     if (ProgramControl.GetInstance().TableCurrentlySelected.GetTableOrder().ChangeTableOrder.Count == 0)
     {
         ///do nothing. can't delete from an empty list
     }
     else
     {
         ProgramControl.GetInstance().TableCurrentlySelected.GetTableOrder().ChangeTableOrder.RemoveAt(0);
         this.CartDisplay.Text = ProgramControl.GetInstance().TableCurrentlySelected.GetTableOrder().PrintChangeOrder();
     }
 }
Пример #8
0
        private void login_button_Click(object sender, EventArgs e)
        {
            string usernameInput = usernameBox.Text;
            string passwordInput = passwordBox.Text;


            if (ProgramControl.GetInstance().Restaurant.AuthenticateEmployee(usernameInput, passwordInput))
            {
                ProgramControl.GetInstance().TableView.Show();
                ProgramControl.GetInstance().LoginView.Hide();
            }
            else
            {
                InvalidCredentialsText.Text = "Invalid credentials. Try again.";
            }
        }
Пример #9
0
 public bool AuthenticateEmployee(string username, string password)
 {
     foreach (var employee in Employees)
     {
         if (employee.username == username)
         {
             ProgramControl.GetInstance().LoginView.Hide();
             if (employee.password == password)
             {
                 ProgramControl.GetInstance().EmployeeSignedIn = employee;
                 return(true);
             }
         }
     }
     return(false);
 }
Пример #10
0
        private void tableButtonClicked(object sender, System.EventArgs e)
        {
            string tableId = (sender as Button).Text;

            ///Set the table instance to the ProgramControl.
            ProgramControl.GetInstance().TableCurrentlySelected =
                ProgramControl.GetInstance().Restaurant.GetTableById(tableId);

            if (ProgramControl.GetInstance().TableCurrentlySelected.Status == TableStatus.Dirty)
            {
                ProgramControl.GetInstance().TableCurrentlySelected.Status = TableStatus.Open;
                ProgramControl.GetInstance().TableView.Hide();
                ProgramControl.GetInstance().TableView.Show();
            }
            else
            {
                ProgramControl.GetInstance().TableView.Hide();
                ProgramControl.GetInstance().OrderView.Show();
            }
        }
Пример #11
0
        protected override void OnVisibleChanged(EventArgs e)
        {
            ///when the screen becomes visible, then change the text
            base.OnVisibleChanged(e);

            foreach (Button tableButton in tableButtons)
            {
                tableButton.BackColor =
                    GetColorFromStatus(ProgramControl.GetInstance().Restaurant.GetTableById(tableButton.Text).Status);
            }

            if (ProgramControl.GetInstance().EmployeeSignedIn.Role == EmployeeRole.Server)
            {
                foreach (Button tableButton in tableButtons)
                {
                    if (!tableButton.Text.Contains("F"))
                    {
                        tableButton.Enabled = false;
                        Color tableButtonPreviousColor = tableButton.BackColor;
                        tableButton.BackColor = Color.FromArgb(70, tableButtonPreviousColor);
                    }
                }
            }
            else
            {
                foreach (Button tableButton in tableButtons)
                {
                    tableButton.Enabled = true;
                }
            }

            foreach (Button tableButton in tableButtons)
            {
                tableButton.Click += tableButtonClicked;
            }

            BackButton.Click += BackButton_Click;
        }
Пример #12
0
 private void BackButton_Click(object sender, EventArgs e)
 {
     ProgramControl.GetInstance().LoginView.Show();
     ProgramControl.GetInstance().TableView.Hide();
 }
Пример #13
0
 private void AddBurgerBtn_Click(object sender, EventArgs e)
 {
     ProgramControl.GetInstance().TableCurrentlySelected.GetTableOrder().AddItem("Bacon Cheeseburger", 13.00);
 }
Пример #14
0
 private void AddChocCakeBtn_Click(object sender, EventArgs e)
 {
     ProgramControl.GetInstance().TableCurrentlySelected.GetTableOrder().AddItem("Chocolate Cake", 6.00);
 }
Пример #15
0
 private void AddSpaghettiBtn_Click(object sender, EventArgs e)
 {
     ProgramControl.GetInstance().TableCurrentlySelected.GetTableOrder().AddItem("Spaghetti and Meatballs", 12.00);
     Debug.WriteLine(ProgramControl.GetInstance().TableCurrentlySelected.GetTableOrder().PrintChangeOrder());
 }
Пример #16
0
 private void BeverageButton_Click(object sender, EventArgs e)
 {
     ProgramControl.GetInstance().beverageView.Show();
     ProgramControl.GetInstance().menuView.Hide();
 }
Пример #17
0
 private void SoupSaladButton_Click(object sender, EventArgs e)
 {
     ProgramControl.GetInstance().soupsaladView.Show();
     ProgramControl.GetInstance().menuView.Hide();
 }
Пример #18
0
 private void AddSaladBtn_Click(object sender, EventArgs e)
 {
     ProgramControl.GetInstance().TableCurrentlySelected.GetTableOrder().AddItem("Caesar Salad", 6.00);
 }
Пример #19
0
 private void AddSoupBtn_Click(object sender, EventArgs e)
 {
     ProgramControl.GetInstance().TableCurrentlySelected.GetTableOrder().AddItem("French Onion Soup", 8.00);
 }
Пример #20
0
 private void MenuBackButton_Click(object sender, EventArgs e)
 {
     ProgramControl.GetInstance().OrderView.Show();
     ProgramControl.GetInstance().soupsaladView.Hide();
 }
Пример #21
0
 private void button4_Click(object sender, EventArgs e)
 {
     ProgramControl.GetInstance().OrderView.Show();
     ProgramControl.GetInstance().menuView.Hide();
 }
Пример #22
0
 private void button4_Click_1(object sender, EventArgs e)
 {
     ProgramControl.GetInstance().TableCurrentlySelected.GetTableOrder().AddItem("Fried Pickles", 6.00);
 }
Пример #23
0
 private void AddFountainDrinkBtn_Click(object sender, EventArgs e)
 {
     ProgramControl.GetInstance().TableCurrentlySelected.GetTableOrder().AddItem("Fountain Drink", 2.00);
 }
Пример #24
0
 private void DessertButton_Click(object sender, EventArgs e)
 {
     ProgramControl.GetInstance().dessertView.Show();
     ProgramControl.GetInstance().menuView.Hide();
 }
Пример #25
0
 private void AddWaterBtn_Click(object sender, EventArgs e)
 {
     ProgramControl.GetInstance().TableCurrentlySelected.GetTableOrder().AddItem("Water", 0.00);
 }
Пример #26
0
 private void AddMozzSticksBtn_Click(object sender, EventArgs e)
 {
     ProgramControl.GetInstance().TableCurrentlySelected.GetTableOrder().AddItem("Mozzeralla Sticks", 6.00);
 }
Пример #27
0
 private void AppetizerButton_Click(object sender, EventArgs e)
 {
     ProgramControl.GetInstance().menuView.Show();
     ProgramControl.GetInstance().entreeView.Hide();
 }