public void Run() { buildingsList = new BuildingsList(); clientList = new ClientsList(); find = new Find(); while (true) { Console.ForegroundColor = ConsoleColor.Green; Console.Clear(); Console.WriteLine("\t\tMenu"); Console.WriteLine("1. Buildings\n2. Client\n3. Find\n0. Exit"); string answer = Console.ReadLine(); switch (answer) { case "0": buildingsList.Save(); clientList.Save(); Environment.Exit(0); break; case "1": Console.ForegroundColor = ConsoleColor.Magenta; Building(); break; case "2": Console.ForegroundColor = ConsoleColor.DarkBlue; Client(); break; case "3": Console.ForegroundColor = ConsoleColor.Red; Find(); break; default: Console.WriteLine("Wrong input\nPress any key to continue"); Console.ReadKey(); break; } } }
private void Client() { bool run = true; while (run) { Console.Clear(); Console.WriteLine("\t\tMenu"); Console.WriteLine("1. Add Client\n2. Remove Client\n3. Edit Client\n4. Show Client info\n5. Show list with all\n6. Sort\n7. Offers\n0.Exit"); string answer = Console.ReadLine(); Console.Clear(); switch (answer) { case "0": run = false; clientList.Save(); buildingsList.Save(); break; case "1": try { } catch (Exception e) { Console.WriteLine($"{e.Message}\nPress any key to continue..."); Console.ReadKey(); } break; case "2": try { } catch (Exception e) { Console.WriteLine($"{e.Message}\nPress any key to continue..."); Console.ReadKey(); } break; case "3": try { } catch (Exception e) { Console.WriteLine($"{e.Message}\nPress any key to continue..."); Console.ReadKey(); } break; case "4": try { } catch (Exception e) { Console.WriteLine($"{e.Message}\nPress any key to continue..."); Console.ReadKey(); } break; case "5": try { } catch (Exception e) { Console.WriteLine($"{e.Message}\nPress any key to continue..."); Console.ReadKey(); } break; case "6": try { Console.WriteLine("1. Sort by Name\n2. Sort by Surname\n3. Sort by first digit BankAcc\n0.Exit"); string ans = Console.ReadLine(); Console.Clear(); switch (ans) { case "0": run = false; clientList.Save(); buildingsList.Save(); break; case "1": try { } catch (Exception e) { Console.WriteLine($"{e.Message}\nPress any key to continue..."); Console.ReadKey(); } break; case "2": try { } catch (Exception e) { Console.WriteLine($"{e.Message}\nPress any key to continue..."); Console.ReadKey(); } break; case "3": try { } catch (Exception e) { Console.WriteLine($"{e.Message}\nPress any key to continue..."); Console.ReadKey(); } break; default: Console.WriteLine("Wrong input\nPress any key to continue"); Console.ReadKey(); break; } } catch (Exception e) { Console.WriteLine($"{e.Message}\nPress any key to continue..."); Console.ReadKey(); } break; case "7": try { Console.WriteLine("1. Add to Offer's\n2. Remove from Offers\n3. Avaible\n0.Exit"); string answ = Console.ReadLine(); Console.Clear(); switch (answ) { case "0": run = false; clientList.Save(); buildingsList.Save(); break; case "1": try { } catch (Exception e) { Console.WriteLine($"{e.Message}\nPress any key to continue..."); Console.ReadKey(); } break; case "2": try { } catch (Exception e) { Console.WriteLine($"{e.Message}\nPress any key to continue..."); Console.ReadKey(); } break; case "3": try { } catch (Exception e) { Console.WriteLine($"{e.Message}\nPress any key to continue..."); Console.ReadKey(); } break; default: Console.WriteLine("Wrong input\nPress any key to continue"); Console.ReadKey(); break; } } catch (Exception e) { Console.WriteLine($"{e.Message}\nPress any key to continue..."); Console.ReadKey(); } break; default: Console.WriteLine("Wrong input\nPress any key to continue"); Console.ReadKey(); break; } } }