Beispiel #1
0
        public void DanhSachSinhVien()
        {
            dssv = new List <DTO_SINHVIEN>();
            int i = 1;

            while (true)
            {
                Console.WriteLine("#--------Thong tin sinh vien {0}--------#", i);
                BUS_SINHVIEN t  = new BUS_SINHVIEN();
                DTO_SINHVIEN t1 = new DTO_SINHVIEN();
                t1 = t.NhapSinhVien(t1);
                dssv.Add(t1);
                i++;
                Console.Write("1 tiep tuc (-1 thoat): ");
                string temp = Console.ReadLine();

                if (float.TryParse(temp, out float n))
                {
                    float t2 = float.Parse(temp);
                    if (t2 == -1)
                    {
                        break;
                    }
                }
                else
                {
                    Console.WriteLine("Thoat danh sach nhap!!");
                    break;
                }
            }
        }
Beispiel #2
0
        public void sinhVienCoDiemLonNhat(List <DTO_SINHVIEN> dssv, DTO_LOP lp)
        {
            float maxz = -1;

            foreach (var sv in dssv)
            {
                if (sv.docghiclass == lp.docghiidClasses)
                {
                    maxz = Math.Max(maxz, sv.docghiScore);
                }
            }

            if (maxz == -1)
            {
                Console.WriteLine("Danh sach lop rong!!");
                return;
            }

            // xuat sinh vien điểm lớn nhất
            foreach (var sv in dssv)
            {
                if (sv.docghiclass == lp.docghiidClasses && sv.docghiScore == maxz)
                {
                    BUS_SINHVIEN t1 = new BUS_SINHVIEN();
                    t1.XuatSinhVien(sv);
                }
            }
        }
Beispiel #3
0
        public void thongTinLopTruong(DTO_LOP lp)
        {
            DTO_SINHVIEN t  = new DTO_SINHVIEN();
            BUS_SINHVIEN t1 = new BUS_SINHVIEN();

            t = lp.docghicap;
            t1.XuatSinhVien(t);
        }
Beispiel #4
0
 public void sinhVienThuocLop(List <DTO_SINHVIEN> dssv, DTO_LOP lp)
 {
     foreach (var sv in dssv)
     {
         if (sv.docghiclass == lp.docghiidClasses)
         {
             BUS_SINHVIEN t1 = new BUS_SINHVIEN();
             t1.XuatSinhVien(sv);
         }
     }
 }
Beispiel #5
0
 /// <summary>
 /// xuất thông tin sinh viên cùng danh sách môn học đã đăng ký
 /// </summary>
 /// <param name="sv"></param>
 /// <param name="listDK"></param>
 /// <param name="bus_sv"></param>
 public void Output(DTO_SINHVIEN sv, List <DTO_DANGKYHOCPHAN> listDK, BUS_SINHVIEN bus_sv)
 {
     foreach (var dk in listDK)
     {
         if (sv.MaSV.Equals(dk.MaSV))
         {
             bus_sv.Output_SV(sv);
             Console.WriteLine("Danh sach mon hoc da dang ky");
         }
     }
 }
Beispiel #6
0
        public void XuatDanhSachSinhVien()
        {
            int i = 1;

            foreach (var sv in dssv)
            {
                Console.WriteLine("#--------Thong tin sinh vien {0}--------#", i);
                BUS_SINHVIEN t = new BUS_SINHVIEN();
                t.XuatSinhVien(sv);
                i++;
            }
        }
Beispiel #7
0
        public void findListMaxScore()
        {
            float score = maxScore();

            foreach (var sv in dssv)
            {
                if (sv.docghiScore == score)
                {
                    BUS_SINHVIEN t = new BUS_SINHVIEN();
                    t.XuatSinhVien(sv);
                }
            }
        }
Beispiel #8
0
        public DTO_LOP NhapLop(DTO_LOP sv)
        {
            Console.Write("Nhap ID class: ");
            sv.docghiidClasses = Console.ReadLine();
            Console.Write("Nhap Loai: ");
            sv.docghiLoai = Console.ReadLine();
            Console.Write("Nhap Khoa: ");
            sv.docghiKhoa = Console.ReadLine();
            Console.Write("Nhap lop truong: ");
            DTO_SINHVIEN t  = new DTO_SINHVIEN();
            BUS_SINHVIEN t1 = new BUS_SINHVIEN();

            t            = t1.NhapSinhVien(t);
            sv.docghicap = t;

            return(sv);
        }
Beispiel #9
0
 public void xuatDS_DKHPtheoSinhVien(List <DTO_SINHVIEN> dssv)
 {
     foreach (var sv in dssv)
     {
         int          i   = 1;
         BUS_SINHVIEN svv = new BUS_SINHVIEN();
         svv.XuatSinhVien(sv);
         Console.WriteLine("Danh sach mon");
         foreach (var hp in ds_dkhp)
         {
             if (sv.docghiID == hp.docghiID_SV)
             {
                 Console.WriteLine("#--------Thong tin mon {0}--------#", i);
                 BUS_DKHP t = new BUS_DKHP();
                 t.xuatDKHP(hp);
                 i++;
             }
         }
     }
 }
Beispiel #10
0
        // in dssv theo giới tính
        public void ListStudentWithGender(string gender)
        {
            int t = checkGender(gender);

            if (t == 0)
            {
                Console.WriteLine("Gioi tinh khong hop le!!!!");
            }
            string s = "nam";

            if (t == 2)
            {
                s = "nu";
            }

            foreach (var sv in dssv)
            {
                if (sv.docghigender == s)
                {
                    BUS_SINHVIEN a = new BUS_SINHVIEN();
                    a.XuatSinhVien(sv);
                }
            }
        }