Ejemplo n.º 1
0
Archivo: Shop.cs Proyecto: blinea/Oreo
        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);
        }
Ejemplo n.º 2
0
        public static void InitializeApp()
        {
            bool start = true;

            do
            {
                int option = (int)Options.Default;
                Console.Clear();
                Alert.Welcome();
                Banner.ShowMainMenu();
                try
                {
                    option = int.Parse(Console.ReadLine());
                }
                catch (Exception)
                {
                    Alert.ShowAlert("Invalid Option", ConsoleColor.Red);
                    Alert.Confirmation();
                }
                switch (option)
                {
                case (int)Options.Products:
                    ProductMenu.LaunchProductMenu();
                    break;

                case (int)Options.Employees:
                    EmployeeMenu.LaunchEmployeeMenu();
                    break;

                case (int)Options.Shop:
                    UtilityMenu.Login();
                    break;

                case (int)Options.Print:
                    UtilityMenu.LaunchPrintMenu();
                    break;

                case (int)Options.Exit:
                    start = false;
                    Alert.Bye();
                    break;
                }
            } while (start);
        }