Example #1
0
        private static void ThongTinSinhVien()
        {
            // Cach 1
            SinhVien teo = new SinhVien();

            teo.MaSV     = "001";
            teo.TenSV    = "Teo Nguyen";
            teo.DiaChi   = "HCM";
            teo.NgaySinh = new DateTime(2000, 1, 1);
            teo.SDT      = "0123456789";
            //Console.WriteLine(teo.MaSV);
            //Console.WriteLine(teo.TenSV);
            //Console.WriteLine(teo.DiaChi);
            //Console.WriteLine(teo.NgaySinh.ToString());
            //Console.WriteLine(teo.SDT);
            Console.WriteLine(teo.ThongTin());
            //
            // Cach 2
            SinhVien ti = new SinhVien()
            {
                MaSV     = "002",
                TenSV    = "Tran Van Ti",
                DiaChi   = "HCM",
                NgaySinh = new DateTime(2000, 2, 1),
                SDT      = "0123456788"
            };

            Console.WriteLine(ti.ThongTin());
            SinhVien.GetDSSinhVien();
            teo.ThemDanhSach();
            ti.ThemDanhSach();
            SinhVien tun = new SinhVien()
            {
                MaSV     = "003",
                TenSV    = "Tran Van Tun",
                DiaChi   = "HCM",
                NgaySinh = new DateTime(2000, 3, 1),
                SDT      = "0123456777"
            };

            SinhVien.ThemDanhSachSV(tun);
            foreach (SinhVien sv in SinhVien.GetDSSinhVien())
            {
                Console.WriteLine(sv.ThongTin());
            }
        }