Esempio n. 1
0
        //adding a member and saving the new members
        public void addNewBoat(model.Member member)
        {
            consoleView.clear();
            consoleView.displayBoatLenghtInstruktions();
            float length;
            float.TryParse(consoleView.getInput(), out length);

            consoleView.clear();
            consoleView.displayBoatTypeInstruktions();
            showBoatType();
            try
            {
                int value = int.Parse(consoleView.getInput());
                var boatType = Enum.ToObject(typeof(model.Boat.BoatType), value);
                model.Boat boat = new model.Boat((model.Boat.BoatType)boatType, length);
                member.addBoat(boat);
            }
            catch (Exception e)
            {
                consoleView.displayExeptions(e.ToString());
            }

            DAL.save(members);
        }