private void btnDelete_ItemClick(object sender, ItemClickEventArgs e) { if (DGvTransView.FocusedRowHandle < 0) { return; } if (BsfGlobal.FindPermission("Bank-Delete") == false) { MessageBox.Show("You don't have Rights to Bank-Delete"); return; } int iBranchId = Convert.ToInt32(DGvTransView.GetFocusedRowCellValue("BranchId")); if (BankBL.BankFound(iBranchId) == false) { if (MessageBox.Show("Do You want to Delete?", "Information", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { BankBL.DeleteBankBranch(iBranchId); DGvTransView.DeleteRow(DGvTransView.FocusedRowHandle); //CommFun.InsertLog(DateTime.Now, "Bank Master-Delete", "D", "Delete Bank Master", BsfGlobal.g_lUserId, 0, 0, 0, BsfGlobal.g_sCRMDBName); BsfGlobal.InsertLog(DateTime.Now, "Bank Master-Delete", "D", "Delete Bank Master", iBranchId, 0, 0, BsfGlobal.g_sCRMDBName, "", BsfGlobal.g_lUserId); } } else { MessageBox.Show("Bank Details Used, Can't Delete Row", "Information", MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } }