Пример #1
0
        private void dgvExams_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex >= 0 && dgvExams.Columns[e.ColumnIndex].Name == "Delete")
            {
                try
                {
                    using (PriemEntities context = new PriemEntities())
                    {
                        Guid markId = (Guid)dgvExams.Rows[e.RowIndex].Cells["Id"].Value;
                        context.AttMarks_Delete(markId);
                    }

                    UpdateDataGrid();
                }
                catch (Exception ex)
                {
                    WinFormsServ.Error("Ошибка при удалении оценки: " + ex.Message);
                }
            }
        }