private model.Boat DoBoatForm(model.Boat a_defaultValues) { string lengthStr = ""; model.Boat.Type boatType = model.Boat.Type.BT_Motor; if (a_defaultValues != null) { boatType = a_defaultValues.GetTypeOfBoat(); lengthStr = Convert.ToString(a_defaultValues.GetLength()); } ; if (DoBoatTypeField(out boatType, boatType) != true || DoFormField(out lengthStr, lengthStr, "Längd") != true) { return(null); } double length; if (Double.TryParse(lengthStr, out length) != true) { return(null); } return(new model.Boat(boatType, length)); }
public BoatMenuChoice DoBoatMenu(model.Boat a_boat) { Console.Clear(); Console.Out.WriteLine("Båt"); Console.Out.WriteLine("Typ: {0}\tLängd:{1}", BoatTypeToString(a_boat.GetTypeOfBoat()), a_boat.GetLength()); String[] menuStrings = new String[] { "Ändra", "Ta Bort", "Tillbaka" }; return(DoMenu <BoatMenuChoice>(menuStrings, BoatMenuChoice.Invalid, "Båtmeny")); }