コード例 #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 BoatController(string selectedMember, MemberView memberView)
 {
     this.selectedMember = selectedMember;
     this.boatView = new BoatView(this.selectedMember);
     this.memberDAL = new MemberDALModel();
     this.memberView = memberView;
     showSelectedMenu();
 }
コード例 #3
0
        public void run()
        {
            MemberList members = new MemberList();          
            
            var serializer = new SerializerXML();
           
            var listViews = new ListViews();
            var consoleView = new ConsoleView();
            var memberview = new MemberView();
            var boatview = new BoatView();

            members = serializer.SerializerXMLIsNullOrNot(members);            
            
            do
            {
                int choise = consoleView.GetMenuChoice();

                switch (choise)
                {
                    case 0:                        
                        Environment.Exit(0);
                        break;
                    case 1:
                        memberview.CreateMember(members);
                        break;
                    case 2:
                        memberview.ShowMember(members);                        
                        break;
                    case 3: 
                        memberview.UpDateMember(members);
                        break;
                    case 4:
                        memberview.RemoveMember(members);
                        break;
                    case 5:                     
                        boatview.AddBoat(members);
                        break;
                    case 6:
                        boatview.UpDateBoat(members);
                        break;
                    case 7:
                        boatview.RemoveBoat(members);
                        break;
                    case 8:
                        listViews.CompactList(members);
                        break;
                    case 9:
                        listViews.CompleteList(members);
                        break;
                }
                serializer.SerializeToXML(members);
                Console.Clear();

            } while (true);
            
        }        
コード例 #4
0
ファイル: Program.cs プロジェクト: ad222kr/1dv607
        static void Main(string[] args)
        {
            var appView = new AppView();
            var memberView = new MemberView();
            var boatView = new BoatView();
            var memberController = new MemberController(memberView);
            var boatController = new BoatController(boatView);
            var appController = new AppController(appView, boatController, memberController);

            appController.Start();
        }
コード例 #5
0
        public MemberController(ListMembersView listMembersView)
        {
            this.memberDAL = new MemberDALModel();
            this.listMembersView = listMembersView;

            this.selectedMember = this.listMembersView.GetMenuChoice();

            this.memberView = new MemberView(this.selectedMember);
            this.memberView.showMember();
            this.menuChoice = memberView.GetMenuChoice();
            editMember();
        }
コード例 #6
0
ファイル: MemberController.cs プロジェクト: ad222kr/1dv607
 public MemberController(MemberView view)
     : base()
 {
     _view = view;
 }