public void MainMenu() { View.ConsoleView c = new View.ConsoleView(); do { try { c.DisplayInfo(); int Choice; string choices = System.Console.ReadLine(); Choice = int.Parse(choices); switch (Choice) { case 0: MemberDAL.SaveToFile(); return; case 1: Console.Clear(); member = new Member(c.OnRegister(), int.Parse(c.OnRegister())); break; case 2: EditMenu(c); break; case 3: c.CompactList(MemberDAL.getMemberList()); break; case 4: c.VerboseList(MemberDAL.getMemberList()); break; } } catch (Exception e) { Console.WriteLine("nåt gick fel"); } } while (Console.ReadKey(true).Key != ConsoleKey.Escape); }
public void MainMenu() { View.ConsoleView c = new View.ConsoleView(); do { try { c.DisplayInfo(); int Choice; string choices = System.Console.ReadLine(); Choice = int.Parse(choices); switch (Choice) { case 0: MemberDAL.SaveToFile(); return; case 1: Console.Clear(); member = new Member(c.OnRegister(), int.Parse(c.OnRegister())); break; case 2: EditMenu(c); break; case 3: c.CompactList(MemberDAL.getMemberList()); break; case 4: c.VerboseList(MemberDAL.getMemberList()); break; } } catch (Exception e) { Console.WriteLine("nåt gick fel"); } }while (Console.ReadKey(true).Key != ConsoleKey.Escape); }