예제 #1
0
        private void OnSaveEvent()
        {
            if (!this.Validate())
            {
                return;
            }

            OnValidateControl();
            AddonValidateControl();

            if (!OnBeforeSave() || !AddonOnBeforeSave())
            {
                return;
            }
            OnValidateControl();
            AddonValidateControl();


            dbManager.StartTransaction();

            dbManager.ValidateControl();
            if (!AddonOnSaveButton() || !OnDuringSave() || !OnSaveButton())
            {
                dbManager.Rollback();
                return;
            }

            DrawingControl.SuspendDrawing(this);
            dbManager.Commit();
            dbManager.UnlockRecordAndFind();

            OnAfterSave();
            AddOnOnAfterSave();
            dbManager.Refresh();

            OnPrepareAuxData();
            AddonPrepareAuxData();

            ManageToolbarEvents();
            IsNew = false;
            DrawingControl.ResumeDrawing(this);
        }
예제 #2
0
        private void OnSaveEvent()
        {
            if (!this.Validate())
            {
                return;
            }

            OnValidateControl();

            if (!OnBeforeSave())
            {
                return;
            }
            OnValidateControl();

            dbManager.StartTransaction();

            dbManager.ValidateControl();
            if (!OnDuringSave() || !OnSaveButton())
            {
                dbManager.Rollback();
                return;
            }
            dbManager.Commit();
            dbManager.UnlockRecordAndFind();

            OnAfterSave();
            dbManager.Refresh();

            OnPrepareAuxData();

            ManageToolbarEvents();
            IsNew = false;
            if (this.Modal)
            {
                this.Close();
            }
        }