Esempio n. 1
0
        protected override void Grabar()
        {
            customerEditBindingSource.RaiseListChangedEvents = false;

            customerEditBindingSource.EndEdit();

            try
            {
                Cursor = Cursors.WaitCursor;

                customer.Save();

                Listar();
                base.Grabar();
            }
            catch (DataPortalException ex)
            {
                MessageBox.Show(ex.BusinessException.Message, "Grabar", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            catch (Csla.Rules.ValidationException)
            {
                MessageBox.Show(customer.BrokenRulesCollection.ToString(), "Validacion", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            finally
            {
                Cursor = Cursors.Default;
            }

            customerEditBindingSource.RaiseListChangedEvents = true;
        }