Ejemplo n.º 1
0
        static void Main()
        {
            /*定义教师、本科生、研究生、交换生;*/
            Faculty msYang = new Faculty("2002010", "杨雪梅", Gender.FEMALE, "人文与管理学院")
            {
                BirthDate  = new DateTime(1975, 12, 1),
                Speciality = "数据仓库与数据挖掘、医学统计"
            };
            Undergraduate boy = new Undergraduate("3210707000", "张三", Gender.MALE, "21信管")
            {
                BirthDate   = new DateTime(2003, 1, 2),
                PhoneNumber = "18900001111",
            };
            Postgraduate girl = new Postgraduate("2190757001", "李四", Gender.FEMALE, msYang);

            girl.AssignDirection("数据可视化");
            ExchangeStudent newGuy = new ExchangeStudent("20200531001", "王五", Gender.MALE, "20信管", "江西中医药大学")
            {
                Instructor = msYang
            };

            /*显示;介绍所有用户;批量注册;*/
            UserUi.Display(boy);
            StudentUi.Display(boy);
            UndergraduateUi.Display(newGuy);
            UserService.IntroduceAll(new User[] { msYang, boy, girl, newGuy });
            WriteLine();
            StudentService.RegisterAll(boy, girl, newGuy);
            Read();
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 显示研究生;
 /// </summary>
 /// <param name="postgraduate">研究生</param>
 public static void Display(Postgraduate postgraduate)
 {
     WriteLine
         ($"研究生信息:\n" +
         $"学号:{postgraduate.Number,-15}姓名:{postgraduate.Name}\n" +
         $"性别:{ postgraduate.Gender,-14} 生日:{ postgraduate.BirthDate:D}\n" +
         $"手机号:{postgraduate.PhoneNumber}\n" +
         $"导师:{postgraduate.Supervisor.Name,-12}方向:{postgraduate.Direction}");
     postgraduate.Intro();
     WriteLine("\n");
 }
Ejemplo n.º 3
0
        static void Main()
        {
            Undergraduate   boy    = new Undergraduate("3210707000", "张三", Gender.MALE, "21信管");
            Postgraduate    girl   = new Postgraduate("2190757001", "李四", Gender.FEMALE, "杨雪梅");
            ExchangeStudent newGuy = new ExchangeStudent("20200531001", "王五", Gender.MALE, "20信管", "江西中医药大学");

            boy.Register();
            girl.Register();
            newGuy.Register();
            Read();
        }
Ejemplo n.º 4
0
        static void Main()
        {
            Undergraduate boy = new Undergraduate("3210707000", "张三", Gender.MALE)
            {
                Class      = "21信管",
                Instructor = "林立"                                                                                     //派生类访问自身的属性;
            };
            Postgraduate girl = new Postgraduate("2190757001", "李四", Gender.FEMALE);

            boy.Intro();                                                                            //派生类调用顶层基类的方法;
            girl.Intro();
            boy.Register();                                                                         //派生类调用基类的方法;
            girl.Register();
            girl.AssignDirection("数据可视化");                                                          //派生类调用自身的方法;
            Read();
        }
Ejemplo n.º 5
0
        static void Main()
        {
            Faculty       msYang = new Faculty("2002010", "杨雪梅", Gender.FEMALE, "人文与管理学院");
            Undergraduate boy    = new Undergraduate("3210707000", "张三", Gender.MALE, "21信管");
            Postgraduate  girl   = new Postgraduate("2190757001", "李四", Gender.FEMALE, msYang);

            girl.AssignDirection("数据可视化");
            ExchangeStudent newGuy = new ExchangeStudent("20200531001", "王五", Gender.MALE, "20信管", "江西中医药大学");

            boy.Intro();
            WriteLine();
            girl.Intro();
            WriteLine();
            newGuy.Intro();
            Read();
        }