public StudentMarkForm(List <Student> _students, Task _task) { task = _task; students = _students; InitializeComponent(); FillStudent(); }
private void DataGridView1_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e) { string name = dataGridView1.Rows[e.RowIndex].Cells[3].Value.ToString(); int id = (int)dataGridView1.Rows[e.RowIndex].Cells[0].Value; using (AcademyEntities db = new AcademyEntities()) { Task task = db.Tasks.Where(c => c.Id == id).FirstOrDefault(); Group group = db.Groups.Where(c => c.Name == name).FirstOrDefault(); List <Student> students = db.Students.Where(c => c.GroupId == group.Id).ToList(); StudentMarkForm studentMark = new StudentMarkForm(students, task); studentMark.ShowDialog(); } }