List <VerticeEntity> DsMonThi() { List <VerticeEntity> ListVertice = new List <VerticeEntity>(); foreach (DataGridViewRow r in grwDanhSach.Rows) { if (Convert.ToString(r.Cells["NHÓM"].Value) != "") { SubjectEntity mt = new SubjectEntity(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); 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.CheckContain(nhom1, nhom2) || DuLieu.CheckContain(phong1, phong2)) { mt.AddSubjectRelated(Convert.ToString(r2.Cells[1].Value)); } } } ListVertice.Add(mt); } } return(ListVertice); }