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; } } }
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}"); } }
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" ); }
public static void RemoveBeverageItem(FoodsMenu foodsMenu) { Console.Clear(); Console.WriteLine("Removing beverage item: "); int i = 1; foreach (string item in foodsMenu.Beverages) { Console.WriteLine($"\t{i} : {item}"); i++; } Console.WriteLine("\nChoose number you want to delete: "); int awnser = Int32.Parse(Console.ReadLine()) - 1; foodsMenu.Beverages = foodsMenu.Beverages.Where(val => val != foodsMenu.Beverages[awnser]).ToArray(); JsonManager.SaveData <FoodsMenu>(foodsMenu, "FoodsMenu", "Menu"); Console.WriteLine("Beverage removed"); }
public override void Save() { JsonManager.SaveData(this, "EscapeRooms", this.Name); }
public static string GetPath(string folderName, string fileName) => JsonManager.GetPath <string>(folderName, fileName);
public static List <T> GetAll <T>(string folderName) where T : AJsonable => JsonManager.GetAllData <T>(folderName);
public static T Get <T>(string folderName, string fileName) where T : AJsonable => JsonManager.GetData <T>(folderName, fileName);
// Deze methods kunnen vanuit elke class gebruikt worden // De implementatie is voor alle classes hetzelfde en op ieder moment te gebruiken public static bool Delete <T>(string folderName, string fileName) => JsonManager.DeleteData <T>(folderName, fileName);
public static void BookRoom(List <Calender> chosenList) { int roomIndex = 0; var list = chosenList; while (true) { var room = RoomPicker(); for (int i = 0; i < list.Count; i++) { if (list[i].RoomID == room.ID) { roomIndex = i; } } Console.Clear(); int numPlayers = NumberOfPlayers(room.MaxPlayers); Console.Clear(); int dag = MenuOptions("How many days from now will you book?", 31, 0); list[roomIndex].DayCalender[dag].ShowSchedule(); int hoeLaat = Tijd(); int endTime = room.MaxDuration + hoeLaat; int setupTime = hoeLaat - room.SetupTime; Console.Clear(); Console.WriteLine("What's your last name?"); string lastName = Console.ReadLine(); Console.Clear(); Console.WriteLine("What's your telephone number?"); string telephone = Console.ReadLine(); Console.Clear(); Console.WriteLine("Is the following info correct?\n\n" + "Name: " + lastName + "\nTelephone: " + telephone + "\nTime: " + TijdAndersom(hoeLaat) + "\nRoom: " + room.Name + "\nDays from now: " + dag + "\nHow many people: " + numPlayers); if (MenuOptions("1. Yes\n2. No", 2) == 1) { var boeking = new Booking(numPlayers, hoeLaat, room.ID, lastName, telephone, dag, endTime, setupTime); if (list[roomIndex].DayCalender[dag].AddBooking(boeking) == true) { JsonManager.SaveData <List <Calender> >(list, "Calender", "Calender"); Console.Clear(); Console.WriteLine("Booking Placed!\n"); return; } else { Console.Clear(); Console.WriteLine("There appears to be overlap. Please try again"); Thread.Sleep(3000); Console.Clear(); } } else { Console.Clear(); Console.WriteLine("Please enter the info again."); Thread.Sleep(2000); } } }