private void tlbMenu_DeleteClick() { try { Cursor = Cursors.WaitCursor; if (XtraMessageBox.Show("Be sure to delete the record?", this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { if (!ValidarIngreso()) { VendorBE objE_Vendor = new VendorBE(); objE_Vendor.IdVendor = int.Parse(gvVendor.GetFocusedRowCellValue("IdVendor").ToString()); objE_Vendor.Login = Parametros.strUsuarioLogin; objE_Vendor.Machine = WindowsIdentity.GetCurrent().Name.ToString(); objE_Vendor.IdCompany = Parametros.intEmpresaId; VendorBL objBL_Vendor = new VendorBL(); objBL_Vendor.Elimina(objE_Vendor); XtraMessageBox.Show("The record was successfully deleted.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); Cargar(); } } Cursor = Cursors.Default; } catch (Exception ex) { Cursor = Cursors.Default; XtraMessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); } }