private void tlbMenu_DeleteClick() { try { Cursor = Cursors.WaitCursor; if (XtraMessageBox.Show("Esta seguro de eliminar el registro?", this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { if (!ValidarIngreso()) { RiesgoBE objE_Riesgo = new RiesgoBE(); objE_Riesgo.IdRiesgo = int.Parse(gvRiesgo.GetFocusedRowCellValue("IdRiesgo").ToString()); objE_Riesgo.Usuario = Parametros.strUsuarioLogin; objE_Riesgo.Maquina = WindowsIdentity.GetCurrent().Name.ToString(); objE_Riesgo.IdEmpresa = Parametros.intEmpresaId; RiesgoBL objBL_Riesgo = new RiesgoBL(); objBL_Riesgo.Elimina(objE_Riesgo); XtraMessageBox.Show("El registro se eliminó correctamente", 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); } }