public static void PrintAllVehicles() { int option = MainMenus.ExecuteMenu(PrintSortingOptions, 4); List <Vehicle> copyList = new List <Vehicle>(allVehicles); if (option == 1) { copyList.Sort(ByNameAscending); } else if (option == 2) { copyList.Sort(ByNameDescending); } else if (option == 3) { copyList.Sort(ByPriceAscending); } else if (option == 4) { copyList.Sort(ByPriceDescending); } Console.WriteLine("List of vehicles in the system:"); foreach (Vehicle v in copyList) { Console.WriteLine(v); } }
public static void Menu() { int optionOperation = MainMenus.ExecuteMenu(PrintMenu, 4); if (optionOperation == 4) { return; } int optionEntity = MainMenus.SelectEntity(); if (optionEntity == 1 && optionOperation == 1) { VehicleUI.AddVehicle(); } else if (optionEntity == 1 && optionOperation == 2) { VehicleUI.DeleteVehicle(); } else if (optionEntity == 1 && optionOperation == 3) { Console.WriteLine("Change is not possible!"); } else if (optionEntity == 2 && optionOperation == 3) { Console.WriteLine("Change is not possible!"); } }
static void Main(string[] args) { LoadData(); while (true) { int option = MainMenus.ExecuteMenu(BasicMenuPrint, 2); if (option == 1) { BasicMenu.Menu(); } else if (option == 2) { SaveData(); break; } } }
public static void Menu() { int optionOperation = MainMenus.ExecuteMenu(PrintMenu, 6); if (optionOperation == 6) { return; } int optionEntity = MainMenus.SelectEntity(); if (optionOperation == 1 && optionEntity == 1) { VehicleUI.PrintAllVehicles(); } else if (optionOperation == 2 && optionEntity == 1) { VehicleUI.PrintExistingVehicles(); } else if (optionOperation == 3 && optionEntity == 1) { VehicleUI.PrintDeletedVehicles(); } else if (optionOperation == 4 && optionEntity == 1) { VehicleUI.PrintSoldVehicles(); } else if (optionOperation == 4 && optionEntity == 2) { Console.WriteLine("Options 4 and 5 are only possible for vehicles!"); } else if (optionOperation == 5 && optionEntity == 1) { VehicleUI.PrintUnsoldVehicles(); } else if (optionOperation == 5 && optionEntity == 2) { Console.WriteLine("Options 4 and 5 are only possible for vehicles!"); } }
public static void FirstMenu() { while (true) { int opcija = MainMenus.ExecuteMenu(MenuPrint, 6); if (opcija == 1) { EntryDeleteEditUI.Menu(); } else if (opcija == 2) { OverviewUI.Menu(); } else if (opcija == 3) { Console.WriteLine("In Progress"); } else if (opcija == 4) { Console.WriteLine("In Progress"); } else if (opcija == 5) { Console.WriteLine("In Progress"); } else if (opcija == 6) { break; } } }