Beispiel #1
0
        private void gridView1_RowUpdated(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e)
        {
            try
            {
                var dc = new ClassSRMDataContext(Config.connection);

                int id    = (int)gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "Id");
                int idStu = (int)gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "StudentId");
                int score = (int)gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "Score");
                var date  = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "Date").ToString();
                var desc  = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "Descr").ToString();

                dc.UpdateActBook(id, idStu, score, date, desc);
                tblActPointBindingSource.EndEdit();
                dc = new ClassSRMDataContext(Config.connection);
                XtraMessageBox.Show("امتیاز موردنظر با موفقیت ویرایش شد", "حطا", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception)
            {
            }
        }