private void btnEdit_Click(object sender, EventArgs e)
 {
     try
     {
         Cursor.Current = Cursors.WaitCursor;
         var seleccionado = listaOpcionesBindingSource.Current as Opcion;
         if (seleccionado == null)
         {
             return;
         }
         using (var frm = new frmOpcionesUI(seleccionado))
         {
             if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
                 listaOpcionesBindingSource.ResetBindings(false);
             }
         }
     }
     catch (Exception ex)
     {
         XtraMessageBox.Show(ex.Message, Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
     finally
     {
         Cursor.Current = Cursors.Default;
     }
 }
Exemple #2
0
        private void btnModificar_Click(object sender, EventArgs e)
        {
            try
            {
                Cursor.Current = Cursors.WaitCursor;
                CargaDatosActuales();

                switch (xtcAplicacion.SelectedTabPage.Name)
                {
                case "tpOpcionesUI":
                    using (var frm = new frmOpcionesUI(m_Opcion))
                    {
                        frm.Nuevo = false;
                        frm.ShowDialog();
                        m_Opcion = frm.m_Opcion;
                        opcionesUIBindingSource.ResetBindings(false);
                    }
                    break;
                }
            }
            catch (DataPortalException ex)
            {
                XtraMessageBox.Show(ex.BusinessException.Message,
                                    "Modificar Objeto de Autorización",
                                    MessageBoxButtons.OK,
                                    MessageBoxIcon.Exclamation);
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message,
                                    "Modificar Objeto de Autorización",
                                    MessageBoxButtons.OK,
                                    MessageBoxIcon.Exclamation);
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }