예제 #1
0
        //Options User Interface
        //Allows user to Place an order at set location
        //Allows user to view its full order history
        //Allows user to select another location
        //Allows user to sign out
        public static void optionsUI()
        {
            while (true)
            {
                Console.Clear();
                string select;

                Console.WriteLine("1. Place an Order");
                Console.WriteLine("2. View Order History");
                Console.WriteLine("3. Select Another Location");
                Console.WriteLine("4. Sign Out");
                Console.Write("Please select an option: ");

                select = (Console.ReadLine());

                switch (select)
                {
                case "1":
                    if (DateTimeCheck.checkDT())     // will check if user has odered from this location in the last 24 hours
                                                     // or last 2 hours in any location
                    {
                        orderUI();
                    }
                    else
                    {
                        Console.WriteLine();
                        Console.WriteLine("Press any key to return to other options");
                        Console.ReadKey();
                    }
                    break;

                case "2":
                    historyUI();     // send to order history user interface
                    break;

                case "3":
                    locationUI();     // send to reselect a location user interface
                    break;

                case "4":
                    MainUI.startupUI();     // send to Main Menu
                    break;

                default:
                    Console.WriteLine("Invalid Choice");
                    Console.WriteLine("Press any key to try again");
                    Console.ReadKey();
                    break;
                }
            }
        }
        public ActionResult Options()
        {
            if (DateTimeCheck.checkDT() == false)
            {
                ViewBag.Message = String.Format("Must Wait 24 hours before next purchace at this location!");
                return(View());
            }
            else if (DateTimeCheck.check2hour() == false)
            {
                ViewBag.Message = String.Format("Must Wait 2 hours before next purchace at any store!");
                return(View());
            }

            return(View());
        }
예제 #3
0
        public ActionResult Order()
        {
            if (DateTimeCheck.checkDT() == false)
            {
                return(RedirectToAction("Options", "Options"));
            }
            else if (DateTimeCheck.check2hour() == false)
            {
                return(RedirectToAction("Options", "Options"));
            }

            Entity db    = new Entity();
            var    pizza = Repository.GetPizza(db);

            ViewData["Pizza"] = pizza.ToList();

            return(View());
        }