void XL_Chon() { if (flag == true) { DiemBUS adapterDiem = new DiemBUS(); MonHocBUS adapterMH = new MonHocBUS(); if (combHocKi.Text != "" && combHocKi.SelectedIndex >= 0) { int chi_soHK = combHocKi.SelectedIndex; HocKi KQHK; if (chi_soHK >= 0 ) { HocKi[] HK = (HocKi[])combHocKi.Tag; KQHK = HK[chi_soHK]; MonHoc []Danh_sach_MH = adapterMH.getAllMH_BUS(); HocSinhBUS adater = new HocSinhBUS(); HocSinh HS = new HocSinh(); HS = adater.getStudentIf_BUS2(BienToanCuc.CurrentUser.MaTaiKhoan); diem = adapterDiem.getMarkIf_BUS(HS.MaHocSinh,KQHK.MaHocKi); DataTable dt = new DataTable(); dt.Columns.Add("tenMonHoc"); dt.Columns.Add("diem15Phut"); dt.Columns.Add("diem1Tiet"); dt.Columns.Add("diemHocKi"); for (int i = 0; i < Danh_sach_MH.Length; i++) { DataRow Dong = dt.NewRow(); dt.Rows.Add(Dong); Dong["tenMonHoc"] = Danh_sach_MH[i].TenMonHoc; Dong["diem15Phut"] = diem[i].Diem15Phut; Dong["diem1Tiet"] = diem[i].Diem1Tiet; Dong["diemHocKi"] = diem[i].DiemHocKi; } dgvBangDiem.DataSource = dt; } } } }
private void frmXemThongTinCaNhan_Load(object sender, EventArgs e) { HocSinhBUS adater = new HocSinhBUS(); HocSinh HS = new HocSinh(); HS = adater.getStudentIf_BUS2(BienToanCuc.CurrentUser.MaTaiKhoan); lbDiaChi.Text = HS.Diachi; lbEmail.Text = HS.Email; if (HS.GioiTinh == true) { lbGioiTinh.Text = "Nam"; } else { lbGioiTinh.Text = "Nữ"; } lbHoTen.Text = HS.HoTen; lbMaHS.Text = HS.MaHocSinh.ToString(); lbNgaySinh.Text = HS.NgaySinh.Day.ToString() + "/" + HS.NgaySinh.Month.ToString() + "/" + HS.NgaySinh.Year.ToString(); }