public static void Menu()
        {
            List <Calender> listOfCalenders = new List <Calender>();

            //Kijkt of het bestand 'calender' bestaat, als dat niet zo is maakt hij deze aan
            if (!File.Exists(AJsonable.GetPath("Calender", "Calender")))
            {
                for (int i = 0; i < AJsonable.GetAll <EscapeRoom>("EscapeRooms").Count; i++)
                {
                    var rooms = AJsonable.GetAll <EscapeRoom>("EscapeRooms");
                    var cal   = new Calender(rooms[i].ID);
                    listOfCalenders.Add(cal);
                }
                JsonManager.SaveData <List <Calender> >(listOfCalenders, "Calender", "Calender");
            }
            else
            {
                listOfCalenders = JsonManager.GetData <List <Calender> >("Calender", "Calender");
            }

            Console.WriteLine("1. Book room\n2. Check bookings");
            string option = Console.ReadLine();

            if (option == "1")
            {
                BookRoom(listOfCalenders);
            }
            else if (option == "2")
            {
                CheckBookings(listOfCalenders);
            }
        }
Exemplo n.º 2
0
        public static void EditInfo()
        {
            var information = JsonManager.GetData <Information>("InfoPage", "information");

            Console.Clear();
            Console.Write(
                "Choose what you want to edit:\n" +
                "\t1 - Company Name\n" +
                "\t2 - Company Info\n" +
                "\t3 - Twitter\n" +
                "\t4 - Facebook\n" +
                "\t5 - Email\n" +
                "\t6 - Phone Number\n" +
                "\t7 - Location\n" +
                "\t= - Cancel\n" +
                "\nPlease choose one of the following options:\n"
                );

            while (true)
            {
                switch (Console.ReadLine())
                {
                case "1":
                    EditInfoJson(information, "CompanyName");
                    return;

                case "2":
                    EditInfoJson(information, "CompanyInfo");
                    return;

                case "3":
                    EditInfoJson(information, "TwitterInfo");
                    return;

                case "4":
                    EditInfoJson(information, "FacebookInfo");
                    return;

                case "5":
                    EditInfoJson(information, "EmailInfo");
                    return;

                case "6":
                    EditInfoJson(information, "PhoneNum");
                    return;

                case "7":
                    EditInfoJson(information, "Location");
                    return;

                case "=":
                    return;

                default:
                    Console.WriteLine("Please enter a valid option");
                    break;
                }
            }
        }
Exemplo n.º 3
0
        public static void MenuForFoodsMenu()
        {
            var foodsMenu = JsonManager.GetData <FoodsMenu>("FoodsMenu", "Menu");

            Console.Clear();
            Console.Write(
                "Managing Foods and Beverages:\n" +
                "\t1 - Add Food\n" +
                "\t2 - Remove Food\n" +
                "\t3 - Add Drink\n" +
                "\t4 - Remove Drink\n" +
                "\t= - Cancel\n" +
                "\nPlease choose one of the following options:\n"
                );

            while (true)
            {
                switch (Console.ReadLine())
                {
                case "1":
                    AddFoodItem(foodsMenu);
                    Program.PressEnterToContinueInConsole();
                    return;

                case "2":
                    RemoveFoodItem(foodsMenu);
                    Program.PressEnterToContinueInConsole();
                    return;

                case "3":
                    AddBeverageItem(foodsMenu);
                    Program.PressEnterToContinueInConsole();
                    return;

                case "4":
                    RemoveBeverageItem(foodsMenu);
                    Program.PressEnterToContinueInConsole();
                    return;

                case "=":
                    return;

                default:
                    Console.WriteLine("Please enter a valid option");
                    break;
                }
            }
        }
Exemplo n.º 4
0
        public static void DisplayMenu()
        {
            var FoodsMenu = JsonManager.GetData <FoodsMenu>("FoodsMenu", "Menu");

            Console.WriteLine("Foods: ");
            foreach (string item in FoodsMenu.Foods)
            {
                Console.WriteLine($"\t{item}");
            }

            Console.WriteLine("\nBeverages: ");
            foreach (string item in FoodsMenu.Beverages)
            {
                Console.WriteLine($"\t{item}");
            }
        }
Exemplo n.º 5
0
        public static void ShowInfo()
        {
            var information = JsonManager.GetData <Information>("InfoPage", "information");

            // hier wordt alles geprint naar console
            Console.WriteLine("======================================" +
                              "\nAlle informatie over het bedrijf: \n\n" +
                              $"{information.CompanyName}\n" +
                              $"{information.CompanyInfo}\n\n" +
                              "if you have a question, you can always contact us through:\n" +
                              $"Twitter: {information.TwitterInfo}\n" +
                              $"Facebook: {information.FacebookInfo}\n" +
                              $"E-mail: {information.EmailInfo}\n" +
                              $"Phone number: {information.PhoneNum}\n" +
                              $"Location: {information.Location}\n" +
                              "======================================\n"
                              );
        }
Exemplo n.º 6
0
 public static T Get <T>(string folderName, string fileName) where T : AJsonable =>
 JsonManager.GetData <T>(folderName, fileName);