internal async void RegisterNameAsync() { bool loop = true; string loc = ""; string input = ""; var SearchingRef = new Searching(); Console.WriteLine("Enter your information below: "); Console.WriteLine("FirstName: "); String fn = Console.ReadLine(); Console.WriteLine("LastName: "); String LN = Console.ReadLine(); Console.WriteLine("Choose your Location:\n" + "1. Reston\n2. Florida\n3. Washington \n press the number or write the city you would like to choose"); string Choose = Console.ReadLine(); while (loop) { if (Choose == "1" || Choose == "Reston") { loc = "Reston"; loop = false; } else if (Choose == "2" || Choose == "Florida") { loc = "Florida"; loop = false; } else if (Choose == "3" || Choose == "Washington") { loc = "Washington"; loop = false; } else { Console.WriteLine("Try Agian or press X to Exit"); input = Console.ReadLine(); if (input.ToUpper() == "X") { Exit(); } } } // LocationsInventoryStartingLoader(); List <Location> AllLocations = (await des.DesLocation("LocationDate.XML")).ToList(); List <Location> FoundLoc = SearchingRef.SearchingByLocation(AllLocations, loc); List <User> AllUser = new List <User>(); try { AllUser = (await des.DesUser("UserDate.XML")).ToList(); }catch (Exception e) { Console.WriteLine("CongratsNewUser"); } finally { AllUser.Add(new User { firstName = fn, LastName = LN, location = (FoundLoc.ToArray())[0], }); ser.SerilizerUser("UserDate.XML", AllUser); AllUser = new List <User>(); } }
private void OrderingPizzaPiesAsync() { List <Order> NewOrder = new List <Order>(); Console.WriteLine("Please insert The location where you want to order from:\n" + "1. Reston \n" + "2. Florida \n" + "3. Washington \n" + "4. X to exit \n " + "5. R to Return"); var input = Console.ReadLine(); string loc = ""; if (input == "1" || input == "Reston") { loc = "Reston"; } else if (input == "2" || input == "Florida") { loc = "Florida"; } else if (input == "3" || input == "Washington") { loc = "Washington"; } else if (input.ToUpper() == "R") { SecondMenuAsync(); } else if (input.ToUpper() == "X") { Exit(); } else { Console.WriteLine("Wrong Input Try Again"); OrderingPizzaPiesAsync(); } int n; bool isNumeric = false; do { Console.WriteLine("How many Pizzas do you want (Max is 12) press R to return and X to Exit"); string pizzaCount = Console.ReadLine(); isNumeric = int.TryParse(pizzaCount, out n); Console.WriteLine(n); Console.WriteLine(isNumeric); if (n < 12) { isNumeric = true; } else if (n > 0) { isNumeric = true; } else if (pizzaCount.ToUpper() == "R") { SecondMenuAsync(); } else if (pizzaCount.ToUpper() == "X") { Exit(); } } while (!isNumeric); decimal cost = Convert.ToDecimal(6 * n * 0.6); DateTime today = DateTime.Now; List <Location> AllLocations = new List <Location>(); AllLocations.AddRange(GetAllLocaitonFromFile()); List <Location> FoundLoc = search.SearchingByLocation(AllLocations, loc); NewOrder.Add(new Order { DateOrder = today, price = cost, PizzaCount = n, location = (Location)((FoundLoc.ToArray())[0]), user = (User)((Session.ToArray())[0]) }); ser.SerilizerOrder("OrderDate.XML", NewOrder); Console.ReadLine(); List <Pizza> pizzas = new List <Pizza>(); Console.WriteLine("Please Enter your"); for (int i = 0; i > n; i++) { } }