private void gridViewNhanVien_DoubleClick(object sender, EventArgs e) { try { if (gridViewNhanVien.SelectedRowsCount > 0) { int index = gridViewNhanVien.FocusedRowHandle; int KmTra = 0, ID = 0; int.TryParse(gridViewNhanVien.GetRowCellValue(index, "KmTra").ToString(), out KmTra); int.TryParse(gridViewNhanVien.GetRowCellValue(index, "ID").ToString(), out ID); if (KmTra > 0) { if (ThongTinDangNhap.HasPermission(DanhSachQuyen.UpdateThueBaoTuyen)) { frmNhapNhatKyThueBao frmNhapNhatKyThueBaocontrol = new frmNhapNhatKyThueBao(ID, true); frmNhapNhatKyThueBaocontrol.ShowDialog(); } else { new MessageBox.MessageBoxBA().Show("Bạn chỉ sửa thông tin trong vòng 4 giờ khi đã nhập."); } } else { frmNhapNhatKyThueBao frmNhapNhatKyThueBaocontrol = new frmNhapNhatKyThueBao(ID); frmNhapNhatKyThueBaocontrol.ShowDialog(); } this.LoadDSThueBao(); } } catch (Exception ex) { LogError.WriteLogError("gridViewNhanVien_DoubleClick: ", ex); } }
private void gridViewNhanVien_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyData == Keys.Enter) { if (gridViewNhanVien.SelectedRowsCount > 0) { int index = gridViewNhanVien.FocusedRowHandle; int KmTra = 0; int ID = 0; int.TryParse(gridViewNhanVien.GetRowCellValue(index, "KmTra").ToString(), out KmTra); int.TryParse(gridViewNhanVien.GetRowCellValue(index, "ID").ToString(), out ID); if (KmTra > 0) { frmNhapNhatKyThueBao frmNhapNhatKyThueBaocontrol = new frmNhapNhatKyThueBao(ID, true); frmNhapNhatKyThueBaocontrol.Show(); } else { frmNhapNhatKyThueBao frmNhapNhatKyThueBaocontrol = new frmNhapNhatKyThueBao(ID); frmNhapNhatKyThueBaocontrol.Show(); } this.LoadDSThueBao(); } } } catch (Exception ex) { LogError.WriteLogError("gridViewNhanVien_KeyDown: ", ex); } }
private void btnAdd_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { try { frmNhapNhatKyThueBao frmNhapNhatKyThueBaocontrol = new frmNhapNhatKyThueBao(); frmNhapNhatKyThueBaocontrol.ShowDialog(); LoadDSThueBao(); } catch (Exception ex) { LogError.WriteLogError("btnAdd_ItemClick: ", ex); } }