private void OpenProject(Project project) { ProjectForm form = new ProjectForm(project); var result = form.ShowDialog(); if (result == DialogResult.OK) { RefreshTable(); } }
private void projectsDataGridView_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e) { var id = (int)projectsDataGridView.CurrentRow.Cells["id"].Value; var project = Program.DataBase.Projects.Where(pr => pr.Id == id) .Include(pr => pr.ModernisationItems) .Include(pr => pr.ProductionsItems) .Single(); ProjectForm form = new ProjectForm(project); var result = form.ShowDialog(); if (result == DialogResult.OK) { RefreshTable(); } }