Esempio n. 1
0
 private void lnkCambiarClave_OpenLink(object sender, DevExpress.XtraEditors.Controls.OpenLinkEventArgs e)
 {
     try
     {
         Cursor.Current = Cursors.WaitCursor;
         using (var frm = new CambioClave(CambiarClave.GetCambiarClave(
                                              new FiltroUsuarios
         {
             Usuario = txtUser.Text,
             Dominio = cboDominio.Text
         })))
         {
             if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
                 XtraMessageBox.Show(
                     "Contraseña cambiada con éxito!",
                     Text,
                     MessageBoxButtons.OK,
                     MessageBoxIcon.Information);
                 txtPass.Focus();
             }
         }
     }
     catch (DataPortalException ex)
     {
         XtraMessageBox.Show(
             ex.BusinessException.Message,
             Text,
             MessageBoxButtons.OK,
             MessageBoxIcon.Information);
     }
     catch (Exception ex)
     {
         XtraMessageBox.Show(
             ex.Message,
             Text,
             MessageBoxButtons.OK,
             MessageBoxIcon.Information);
     }
     finally
     {
         Cursor.Current = Cursors.Default;
     }
 }
 private void lnkCambiarClave_OpenLink(object sender, DevExpress.XtraEditors.Controls.OpenLinkEventArgs e)
 {
     try
     {
         Cursor.Current = Cursors.WaitCursor;
         using (var frm = new CambioClave(CambiarClave.GetCambiarClave(
             new FiltroUsuarios
             {
                 Usuario = txtUser.Text,
                 Dominio = cboDominio.Text
             })))
         {
             if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
                 XtraMessageBox.Show(
                     "Contraseña cambiada con éxito!",
                     Text,
                     MessageBoxButtons.OK,
                     MessageBoxIcon.Information);
                 txtPass.Focus();
             }
         }
     }
     catch (DataPortalException ex)
     {
         XtraMessageBox.Show(
             ex.BusinessException.Message,
             Text,
             MessageBoxButtons.OK,
             MessageBoxIcon.Information);
     }
     catch (Exception ex)
     {
         XtraMessageBox.Show(
             ex.Message,
             Text,
             MessageBoxButtons.OK,
             MessageBoxIcon.Information);
     }
     finally
     {
         Cursor.Current = Cursors.Default;
     }
 }