public ContentTraCuuDiem(VIEW_DTO.GiaoVu.TraCuuDiemSV n) { InitializeComponent(); InitSV(n); }
void InitSV(VIEW_DTO.GiaoVu.TraCuuDiemSV n) { CreateColumn(); LoadDGVSV(n); }
void LoadDGVSV(VIEW_DTO.GiaoVu.TraCuuDiemSV n) { dataGridViewTraCuuDiem.Rows.Clear(); var ds = Dao_GiaoVu.DSDangKySV(n); var dssv = Dao_GiaoVu.DSSinhVien(); var dscd = Dao_GiaoVu.DSTatCaChuyenDe(); var dscddm = Dao_GiaoVu.DSCacLopChuyenDeDuocMo(); if (ds.Count == 0) { MessageBox.Show("Không tìm thấy dữ liệu phù hợp", "Thông báo"); dataGridViewTraCuuDiem.Columns.Clear(); return; } DataGridViewRow row = null; DataGridViewCell cell = null; foreach (var tc in ds) { row = new DataGridViewRow(); row.Tag = tc; cell = new DataGridViewTextBoxCell(); cell.Value = tc.mand; row.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); foreach (var tt in dssv) { if (tt.mand == tc.mand) { cell.Value = tt.hoten; } } row.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = tc.malop; row.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); foreach (var tt in dscd) { if (tt.MaCD == n.macd) { cell.Value = tt.TenCD; break; } } row.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = tc.manhom; row.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = tc.diem; row.Cells.Add(cell); dataGridViewTraCuuDiem.Rows.Add(row); } }