示例#1
0
        private void btnActive_Click(object sender, EventArgs e)
        {
            var dc = new ClassSRMDataContext(Config.connection);

            dc.InsertCheck((int)gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "Id"), true, strDate);
            gridView1.DeleteSelectedRows();
            gridView1.SelectRow(0);
            lblCount.Text = gridView1.DataRowCount + " نفر بررسی نشده اند";
            if (gridView1.DataRowCount == 0)
            {
                Close();
            }
        }
示例#2
0
        private void gridView1_KeyDown(object sender, KeyEventArgs e)
        {
            //ثبت غیبت با کلید اسپیس
            if (e.KeyCode == Keys.Space)
            {
                var dc = new ClassSRMDataContext(Config.connection);
                dc.InsertCheck((int)gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "Id"), false, strDate);
                gridView1.DeleteSelectedRows();
                gridView1.SelectRow(0);
                lblCount.Text = gridView1.DataRowCount + " نفر بررسی نشده اند";

                if (gridView1.DataRowCount == 0)
                {
                    Close();
                }
            }
        }