当前位置: 首页>>代码示例>>C#>>正文


C# model.SelectMember方法代码示例

本文整理汇总了C#中model.SelectMember方法的典型用法代码示例。如果您正苦于以下问题:C# model.SelectMember方法的具体用法?C# model.SelectMember怎么用?C# model.SelectMember使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在model的用法示例。


在下文中一共展示了model.SelectMember方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Start

        public bool Start(view.MainView a_view, model.Registry a_model)
        {
            model.Member selectedMember = null;
            model.Boat selectedBoat = null;

            a_view.ShowStartMenu();

            switch (a_view.userInput())
            {
                case 1:   //exit
                    return false;

                case 2:     //add member
                    model.Member memberToAdd = a_view.m_memberView.AddMember();
                    a_model.AddMember(memberToAdd);
                    a_view.ShowGoBackMenu();
                    break;

                case 3: //select member
                    a_view.ShowCompactList(a_model.m_members);
                    int memberToBeselected = a_view.m_memberView.SelectMember();
                    selectedMember =  a_model.SelectMember(memberToBeselected);

                    if (selectedMember != null)
                    {
                        switch (a_view.m_memberView.MemberMenu(selectedMember))
                        {
                            case 1:             //delete
                                model.Member memberToDel = a_view.m_memberView.DeleteMember(selectedMember);
                                a_model.DeleteMember(memberToDel);
                                break;

                            case 2:     //update
                                model.Member memberToUpdate = a_view.m_memberView.UpdateMember(selectedMember);
                                a_model.UpdateMember(selectedMember, memberToUpdate);
                                a_view.ShowGoBackMenu();
                                break;

                            case 3:     //add boat
                                model.Boat boatToAdd = a_view.m_boatView.addBoat();
                                selectedMember.AddBoat(boatToAdd);
                                a_view.ShowGoBackMenu();
                                break;

                            case 4:     //select boat of member
                                int boatToBeSelected = a_view.m_boatView.SelectBoat(selectedMember);
                                selectedBoat = selectedMember.SelectBoat(boatToBeSelected);

                                if(selectedBoat != null)
                                {
                                    switch(a_view.m_boatView.BoatMenu(selectedBoat))
                                    {
                                        case 1:     //delete boat
                                            model.Boat boatToDel = a_view.m_boatView.DeleteBoat(selectedBoat, selectedMember);
                                            selectedMember.DeleteBoat(boatToDel);
                                            break;

                                        case 2:     //update boat
                                            model.Boat boatToUpdate = a_view.m_boatView.UpdateBoat(selectedBoat);
                                            selectedMember.UpdateBoat(selectedBoat, boatToUpdate);
                                            a_view.ShowGoBackMenu();
                                            break;
                                    }
                                }

                                break;
                        }
                    }

                    break;

                case 4: //compact list
                    a_view.ShowCompactList(a_model.m_members);
                    a_view.ShowGoBackMenu();
                    break;

                case 5: //verbose list
                    a_view.ShowVerboseList(a_model.m_members);
                    a_view.ShowGoBackMenu();
                    break;

            }

            return true;
        }
开发者ID:fh222dt,项目名称:OOAD,代码行数:85,代码来源:Controller.cs


注:本文中的model.SelectMember方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。