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


C# model.GetPersonalNumber方法代码示例

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


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

示例1: MemberMenu

        public int MemberMenu(model.Member a_member)
        {
            Console.Clear();
            Console.WriteLine("");
            Console.WriteLine("-----Member specifics-----");
            Console.WriteLine("Name: {0} {1}", a_member.GetFirstName(), a_member.GetLastName());
            Console.WriteLine("Personal number: {0}", a_member.GetPersonalNumber());
            Console.WriteLine("Member id: {0}", a_member.GetMemberId());

            if (a_member.GetBoats().Count() > 0)
            {
                Console.WriteLine("");
                Console.WriteLine("Members registred boats:");
                foreach (model.Boat b in a_member.GetBoats())
                {
                    Console.WriteLine("Type: {0}", b.GetBoatType().ToString());
                    Console.WriteLine("Length: {0}", b.GetLength());
                    Console.WriteLine("");
                }
            }
            else
            {
                Console.WriteLine("");
                Console.WriteLine("Member has no boats yet");
                Console.WriteLine("");
            }

            Console.WriteLine("");
            Console.WriteLine("---------------");
            Console.WriteLine("");
            Console.WriteLine("(D) to Delete member (U) to Update member (A) to Add boat (B) to list all Boats of member");
            ConsoleKeyInfo input = Console.ReadKey();
            if (input.Key == ConsoleKey.D)
            {
                return 1;
            }

            else if (input.Key == ConsoleKey.U)
            {
                return 2;
            }

            else if (input.Key == ConsoleKey.A)
            {
                return 3;
            }

            else if (input.Key == ConsoleKey.B)
            {
                return 4;
            }

            else return 0;          //returnera nåt annat
        }
开发者ID:fh222dt,项目名称:OOAD,代码行数:54,代码来源:MemberView.cs

示例2: UpdateMember

        public model.Member UpdateMember(model.Member a_selectedMember)
        {
            string firstName;
            string lastName;
            string personalNumber;

            Console.Clear();
            Console.WriteLine("");
            Console.WriteLine("-----Update member information-----");
            Console.WriteLine("");
            Console.WriteLine("Name: {0} {1}", a_selectedMember.GetFirstName(), a_selectedMember.GetLastName());
            Console.WriteLine("Personal number: {0}", a_selectedMember.GetPersonalNumber());
            Console.WriteLine("**********");
            Console.WriteLine("Please change the information by entering below:");
            Console.WriteLine("");
            Console.WriteLine("First name: ");
            firstName = Console.ReadLine();
            Console.WriteLine("Last name: ");
            lastName = Console.ReadLine();
            Console.WriteLine("Personal number: ");
            personalNumber = Console.ReadLine();
            Console.WriteLine("");
            Console.WriteLine("Member information updated!");

            return new model.Member(firstName, lastName, personalNumber, a_selectedMember.GetMemberId());
        }
开发者ID:fh222dt,项目名称:OOAD,代码行数:26,代码来源:MemberView.cs


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