DanhSachMonThi DsMonThi() { DanhSachMonThi Dsmt = new DanhSachMonThi(new List <MonThi>()); foreach (DataGridViewRow r in grwDanhSach.Rows) { if (Convert.ToString(r.Cells[3].Value) != "") { MonThi mt = new MonThi(Convert.ToString(r.Cells[1].Value)); foreach (DataGridViewRow r2 in grwDanhSach.Rows) { if (r2.Index != r.Index) { string bac1 = Convert.ToString(r.Cells[3].Value); string bac2 = Convert.ToString(r2.Cells[3].Value); bool thimay1 = Convert.ToBoolean(((DataGridViewCheckBoxCell)r.Cells[4]).Value); bool thimay2 = Convert.ToBoolean(((DataGridViewCheckBoxCell)r2.Cells[4]).Value); string phong1 = Convert.ToString(((DataGridViewComboBoxCell)r.Cells[11]).Value); string phong2 = Convert.ToString(((DataGridViewComboBoxCell)r2.Cells[11]).Value); if (bac2 != "") { if (bac1 == bac2 || (thimay1 && thimay2 && Phong.TrungPhong(phong1, phong2))) { mt.ThemMonCungNhom(Convert.ToString(r2.Cells[1].Value)); } } } } Dsmt.ds.Add(mt); } } return(Dsmt); }
DanhSachMonThi DsMonThi() { DanhSachMonThi Dsmt = new DanhSachMonThi(new List <MonThi>()); foreach (DataGridViewRow r in grwDanhSach.Rows) { if (Convert.ToString(r.Cells["NHÓM"].Value) != "") { MonThi mt = new MonThi(Convert.ToString(r.Cells["MÃ HP"].Value)); string phong1 = Convert.ToString(((DataGridViewTextBoxCell)r.Cells["PHÒNG"]).Value); string nhom1 = Convert.ToString(r.Cells["NHÓM"].Value); if (phong1 != "") { mt.MonThucHanh = true; } foreach (DataGridViewRow r2 in grwDanhSach.Rows) { if (r2.Index != r.Index) { string nhom2 = Convert.ToString(r2.Cells["NHÓM"].Value); string phong2 = Convert.ToString(((DataGridViewTextBoxCell)r2.Cells["PHÒNG"]).Value); if (DuLieu.KiemTraTrung(nhom1, nhom2) || DuLieu.KiemTraTrung(phong1, phong2)) { mt.ThemMonCungNhom(Convert.ToString(r2.Cells[1].Value)); } } } Dsmt.ds.Add(mt); } } return(Dsmt); }
void ShowData(DanhSachMonThi dsmt) { foreach (MonThi mt in dsmt.ds) { GetRow(mt.Mamh).Cells[9].Value = mt.Tiet.Ngay; GetRow(mt.Mamh).Cells[10].Value = mt.Tiet.Gio; } }