public void RegisterBoat() { _view.Output("Register boat"); _view.Output("-----------------------"); _view.Output("Enter member name: "); string memberName = _view.Input(); Member member = _memberHandler.getMember(memberName); if (member == null) { _view.Error("No member with that name found."); RegisterBoat(); } _view.Output("Enter boat type (Sailboat, Motorsailer, Kayak, Canoe, Other): "); string boatType = _view.Input(); if (boatType == "Sailboat" || boatType == "Motorsailer" || boatType == "Kayak" || boatType == "Canoe" || boatType == "Other") { _view.Output("Enter boat length: "); int boatLength = Convert.ToInt32(_view.Input()); Boat boat = new Boat(boatType, boatLength); _boatHandler.addBoat(member, boat); _view.Output("Boat added!"); } else { _view.Error("Wrong boat type."); RegisterBoat(); } }
public void DeleteMember() { _view.Output("Delete member"); _view.Output("-----------------------"); _view.Output("Enter name of member: "); string memberName = _view.Input(); // Remove boats along the removed member Member member = _memberHandler.getMember(memberName); _boatHandler.deleteBoats(member); // Remove member _memberHandler.deleteMember(memberName); _view.Output("Member deleted."); }