public static void LaunchFinishMenu(string userDocument) { Random random = new Random(); Order newOrder = new Order(random.Next(10000, 99999), userDocument); Alert.ShowAlert(newOrder.ToString(), ConsoleColor.DarkBlue); Console.WriteLine("\n"); ShopCtrl.ShowShoppingCart(); //OrderCtrl.CreateOrder(newOrder); OrderCtrl.ReadAllOrders(); }
public static void LaunchShopMenu(string user) { bool start = true; int option = (int)Options.Default; do { ShowMenu(user); try { option = int.Parse(Console.ReadLine()); } catch (Exception) { Alert.ShowAlert("Invalid Option", ConsoleColor.Red); } switch (option) { case (int)Options.Add: Banner.ShowBanner("Add to Shopping Cart"); ProductCtrl.ReadAllProducts(); ShopCtrl.GetProduct(Product.GetId().Id, user); Alert.Confirmation(); break; case (int)Options.Remove: Banner.ShowBanner("Remove from Shopping Cart"); ShopCtrl.ShowShoppingCart(); ShopCtrl.RemoveProduct(Product.GetId().Id); Alert.Confirmation(); break; case (int)Options.Cart: Banner.ShowBanner(" Your Shopping Cart "); ShopCtrl.ShowShoppingCart(); Alert.Confirmation(); break; case (int)Options.Finish: Banner.ShowBanner(" Your Order is Finished "); UtilityMenu.LaunchFinishMenu(user); Alert.Confirmation(); break; case (int)Options.Exit: start = false; break; } } while (start); }