public override void Eliminar()
        {
            base.Eliminar();
            try
            {
                Cursor.Current = Cursors.WaitCursor;
                CargaDatosActuales();
                if (XtraMessageBox.Show("Desea eliminar el registro?", Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.No)
                {
                    return;
                }

                PerfilUsuario.DeletePerfilUsuario(_PerfilUsuario.ID);
                Buscar();
            }
            catch (DataPortalException ex)
            {
                XtraMessageBox.Show(ex.BusinessException.Message,
                                    "Eliminar",
                                    MessageBoxButtons.OK,
                                    MessageBoxIcon.Exclamation);
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message,
                                    "Eliminar",
                                    MessageBoxButtons.OK,
                                    MessageBoxIcon.Exclamation);
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }
Example #2
0
 private void eliminarPerfilToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         Cursor.Current = Cursors.WaitCursor;
         var current = perfilUsuarioInfoListBindingSource.Current as PerfilUsuarioInfo;
         if (current == null)
         {
             return;
         }
         if (XtraMessageBox.Show("Desea eliminar el registro?", Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.No)
         {
             return;
         }
         PerfilUsuario.DeletePerfilUsuario(current.ID);
         CargarPerfiles(tvwAplicaciones.SelectedNode.Name);
     }
     catch (DataPortalException ex)
     {
         XtraMessageBox.Show(ex.BusinessException.Message,
                             "Eliminar Perfil de Usuario",
                             MessageBoxButtons.OK,
                             MessageBoxIcon.Exclamation);
     }
     catch (Exception ex)
     {
         XtraMessageBox.Show(ex.Message,
                             "Eliminar Perfil de Usuario",
                             MessageBoxButtons.OK,
                             MessageBoxIcon.Exclamation);
     }
     finally
     {
         Cursor.Current = Cursors.Default;
     }
 }