コード例 #1
0
        public void showSelectedMenu()
        {
            Console.WriteLine("ShowSelectedMenu i BoatController");
            BoatView.MenuChoice menuChoice = this.boatView.GetMenuChoice();

            if (menuChoice == BoatView.MenuChoice.AddBoat)
            {
                Console.WriteLine("Add boat");
                this.boatView.addBoat();
                BoatModel boat = new BoatModel(boatView.getBoatType(), boatView.getBoatLength());
                this.memberDAL.saveBoat(this.selectedMember, boat);
                MemberView editedMemberView = new MemberView(this.selectedMember);
                editedMemberView.showMember();
            }
            if (menuChoice == BoatView.MenuChoice.EditBoat)
            {
                this.boatView.listMemberBoats();
            }
            if (menuChoice == BoatView.MenuChoice.DeleteBoat)
            {
                this.boatView.listMemberBoats();
            }
            if (menuChoice == BoatView.MenuChoice.StartMenu)
            {
                StartMenuController startController = new StartMenuController();
            }
        }
コード例 #2
0
 public void saveBoat(string memberId, BoatModel boat)
 {
     using (StreamWriter write = File.AppendText(this.folderPath + memberId + ".txt"))
     {
         write.WriteLine(boat.getBoatType().ToString());
         write.WriteLine(boat.getBoatLength());
     }
 }
コード例 #3
0
ファイル: Boat.cs プロジェクト: jc222fi/1DV607
 public void ReadXml(XmlReader reader)
 {
     reader.MoveToContent();
     reader.ReadStartElement();
     _id = reader.ReadElementContentAsInt("Id", reader.NamespaceURI);
     _model = (BoatModel)reader.ReadElementContentAsInt("Model", reader.NamespaceURI);
     _length = reader.ReadElementContentAsDouble("Length", reader.NamespaceURI);
     reader.ReadEndElement();
 }