// Display views, get inputs to create/save boat to a member private void AddBoat(model.Member member) // Which member to add the boat to { try { _memberView.DisplayMember(member); model.Boat.BoatType type = _boatView.GetTypeFromUser(); double length = _boatView.GetLengthFromUser(); DateTime registrationDate = _boatView.GetRegistrationDate(); model.Boat boat = new model.Boat(type, length, registrationDate); member.AddBoat(boat); _list.SaveMemberList(); DoMemberView(member); } catch (Exception ex) { _memberView.DisplayMember(member); _boatView.DisplayErrorMessage(ex.Message); if (_boatView.DoesUserWantsToQuit() == true) { DoMemberView(member); } else { AddBoat(member); } } }
private void DoAddBoat(view.MainView a_view, model.Member selectedMember) { model.Boat b = a_view.m_memberView.m_boatView.DoAddBoatForm(); if (b != null) { selectedMember.AddBoat(b); a_view.SetSelectedBoat(selectedMember, b); } }