public void run() { MemberList members = new MemberList(); var serializer = new SerializerXML(); var listViews = new ListViews(); var consoleView = new ConsoleView(); var memberview = new MemberView(); var boatview = new BoatView(); members = serializer.SerializerXMLIsNullOrNot(members); do { int choise = consoleView.GetMenuChoice(); switch (choise) { case 0: Environment.Exit(0); break; case 1: memberview.CreateMember(members); break; case 2: memberview.ShowMember(members); break; case 3: memberview.UpDateMember(members); break; case 4: memberview.RemoveMember(members); break; case 5: boatview.AddBoat(members); break; case 6: boatview.UpDateBoat(members); break; case 7: boatview.RemoveBoat(members); break; case 8: listViews.CompactList(members); break; case 9: listViews.CompleteList(members); break; } serializer.SerializeToXML(members); Console.Clear(); } while (true); }
public void ShowBoats(Member mObject) { var consoleView = new ConsoleView(); int counter = 1; try { if (mObject.BoatList.Boats == null) { } foreach (Boat bObject in mObject.BoatList.Boats) { Console.WriteLine("-------{0}--------", counter); Console.WriteLine(bObject.BoatType); Console.WriteLine("{0}m", bObject.BoatLength); counter++; } } catch (Exception) { Console.WriteLine("\nDet finns ingen båt på denna medlem."); ContinueOnKeyPressed(); consoleView.GetMenuChoice(); } }