public void Start(ClientConsole console) { console.PrintCustomersList(CustomerSingleton.Instance.Customers); int userMenuChoice = console.ChooseMenu(); bool validUser = false; if (userMenuChoice > CustomerSingleton.Instance.Customers.Count) { curCust = new Customer(console.GetString("Enter name: ")); CustomerSingleton.Instance.Customers.Add(curCust); validUser = true; } else { curCust = CustomerSingleton.Instance.Customers[userMenuChoice - 1]; if (curCust.PasswordCheck(console.GetString("Enter password: "******"Invalid password."); } }
private void PrintUserOrders(ClientConsole console) { bool foundOne = false; string userName = console.GetString("Enter name to search: "); for (int i = 0; i < curStore.Orders.Count; i++) { if (curStore.Orders[i].Name == userName) { console.PrintCurrentOrder(curStore.Orders[i]); foundOne = true; } } if (!foundOne) { console.GenericPrint("Could not find any orders placed by " + userName); } }
private void DoPizzaOption(ClientConsole client, int menuChoice, AStore store, Order o) { if (menuChoice != store.PresetPizza.Count + 1) //Preset option { o.StartPresetPizza(store.PresetPizza[menuChoice - 1]); client.PrintSizes(store); int sizeChoice = client.ChooseMenu(); o.CurrentPizza.AddSize(store.SizeList[sizeChoice - 1]); o.FinishPizza(); } else { o.StartCustomPizza(); o.CurrentPizza.AddDefaults(); client.PrintSizes(store); //client.PrintCompInfo(store.SizeList); o.CurrentPizza.AddSize(store.SizeList[client.ChooseMenu() - 1]); client.PrintCrusts(store); o.CurrentPizza.AddCrust(store.CrustList[client.ChooseMenu() - 1]); string yesno = client.GetString("Do you want stuffed crust (y/n)?: "); if (yesno.ToLower() == "y") { o.CurrentPizza.Crust.ChangeStuffedCrust(); } do { client.PrintToppings(store); menuChoice = client.ChooseMenu(); if (menuChoice > store.ToppingsList.Count || o.CurrentPizza.Toppings.Count >= o.CurrentPizza.MaxToppings) { break; } else { o.CurrentPizza.AddTopping(store.ToppingsList[menuChoice - 1]); } }while(menuChoice <= store.ToppingsList.Count); o.FinishPizza(); } }