Esempio n. 1
0
        public void selectBoat(Member member)
        {
            Boat boaten;
            IReadOnlyCollection<Member> newlist = MemberDAL.getMemberList(); ;
            ConsoleView test2 = new ConsoleView();
            //test2.bild();
            int choices = int.Parse(Console.ReadLine());
            if (choices == 0)
            {
                return;
            }
            choices--;

            test2.boatChoices();
            int boatchoice = int.Parse(Console.ReadLine());
            boaten = member.BoatList.ElementAt(choices);
            switch(boatchoice)
            {
                case 1:
                    member.RemoveBoatList(choices);
                    break;

                case 2:
                    test2.ViewBoattype();
                    choices = int.Parse(Console.ReadLine());
                test2.Boatchanges();
                    double newLength = double.Parse(Console.ReadLine());
                    //Boat FullBoat = new Boat(choices, newLength);
                    boaten.GetLength = newLength;                                  // egenskap == nya värdet
                    boaten.GetCategory = (Model.Boat.BoatCategory)choices;    // kan inte skicka in i egenskaper eftersom de inte har parameteer
                                                                          // hämtade objektet från båten
                                                                              // ändra värden via parse
                    break;

            }
        }
        public void selectBoat(Member member)
        {
            Boat boaten;
            IReadOnlyCollection<Member> newlist = MemberDAL.getMemberList(); ;
            ConsoleView newview = new ConsoleView();
            //test2.bild();
            int choices = int.Parse(Console.ReadLine());
            if (choices == 0)
            {
                return;
            }
            choices--;

            newview.boatChoices();
            int boatchoice = int.Parse(Console.ReadLine());
            boaten = member.BoatList.ElementAt(choices);
            switch (boatchoice)
            {
                case 1:
                    member.RemoveBoatList(choices);
                    break;

                case 2:
                    newview.ViewBoattype();
                    choices = int.Parse(Console.ReadLine());
                    newview.Boatchanges();
                    double newLength = double.Parse(Console.ReadLine());

                    boaten.GetLength = newLength;
                    boaten.GetCategory = (Model.Boat.BoatCategory)choices;

                    break;

            }
        }