Exemplo n.º 1
0
        public override void Grabar()
        {
            aplicacionBindingSource.RaiseListChangedEvents = false;
            aplicacionBindingSource.EndEdit();

            try
            {
                Cursor.Current = Cursors.WaitCursor;
                nombreTextEdit.Focus();
                m_Aplicacion.ChequearReglas();
                m_Aplicacion = m_Aplicacion.Save();
                XtraMessageBox.Show("Registro grabado correctamente!", Text, MessageBoxButtons.OK, MessageBoxIcon.Information);

                base.Grabar();
            }
            catch (ValidationException ex)
            {
                XtraMessageBox.Show(ex.Message, "Grabar", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            catch (DataPortalException ex)
            {
                XtraMessageBox.Show(ex.BusinessException.Message,
                                    "Grabar",
                                    MessageBoxButtons.OK,
                                    MessageBoxIcon.Exclamation);
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message,
                                    "Grabar",
                                    MessageBoxButtons.OK,
                                    MessageBoxIcon.Exclamation);
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }

            aplicacionBindingSource.RaiseListChangedEvents = true;
        }