static void Main() { Application.SetHighDpiMode(HighDpiMode.SystemAware); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(ProgramControl.GetInstance().LoginView); }
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; }
public static ProgramControl GetInstance() { if (instance == null) { instance = new ProgramControl(); } return(instance); }
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); }
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(); }
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); }
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; }
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(); } }
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); }
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."; } }
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(); } }
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; }
private void BeverageButton_Click(object sender, EventArgs e) { ProgramControl.GetInstance().beverageView.Show(); ProgramControl.GetInstance().menuView.Hide(); }
private void BackButton_Click(object sender, EventArgs e) { ProgramControl.GetInstance().LoginView.Show(); ProgramControl.GetInstance().TableView.Hide(); }
private void AddChocCakeBtn_Click(object sender, EventArgs e) { ProgramControl.GetInstance().TableCurrentlySelected.GetTableOrder().AddItem("Chocolate Cake", 6.00); }
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()); }
private void MenuBackButton_Click(object sender, EventArgs e) { ProgramControl.GetInstance().OrderView.Show(); ProgramControl.GetInstance().soupsaladView.Hide(); }
private void AddFountainDrinkBtn_Click(object sender, EventArgs e) { ProgramControl.GetInstance().TableCurrentlySelected.GetTableOrder().AddItem("Fountain Drink", 2.00); }
private void AddSoupBtn_Click(object sender, EventArgs e) { ProgramControl.GetInstance().TableCurrentlySelected.GetTableOrder().AddItem("French Onion Soup", 8.00); }
private void SoupSaladButton_Click(object sender, EventArgs e) { ProgramControl.GetInstance().soupsaladView.Show(); ProgramControl.GetInstance().menuView.Hide(); }
private void button4_Click(object sender, EventArgs e) { ProgramControl.GetInstance().OrderView.Show(); ProgramControl.GetInstance().menuView.Hide(); }
private void AddSaladBtn_Click(object sender, EventArgs e) { ProgramControl.GetInstance().TableCurrentlySelected.GetTableOrder().AddItem("Caesar Salad", 6.00); }
private void button4_Click_1(object sender, EventArgs e) { ProgramControl.GetInstance().TableCurrentlySelected.GetTableOrder().AddItem("Fried Pickles", 6.00); }
private void AppetizerButton_Click(object sender, EventArgs e) { ProgramControl.GetInstance().menuView.Show(); ProgramControl.GetInstance().entreeView.Hide(); }
private void DessertButton_Click(object sender, EventArgs e) { ProgramControl.GetInstance().dessertView.Show(); ProgramControl.GetInstance().menuView.Hide(); }
private void AddBurgerBtn_Click(object sender, EventArgs e) { ProgramControl.GetInstance().TableCurrentlySelected.GetTableOrder().AddItem("Bacon Cheeseburger", 13.00); }
private void AddMozzSticksBtn_Click(object sender, EventArgs e) { ProgramControl.GetInstance().TableCurrentlySelected.GetTableOrder().AddItem("Mozzeralla Sticks", 6.00); }
private void AddWaterBtn_Click(object sender, EventArgs e) { ProgramControl.GetInstance().TableCurrentlySelected.GetTableOrder().AddItem("Water", 0.00); }