private void DoSaving(string action, string jsonData, JToken parameters) { if (this.ModelInstance == null) { throw new Exception("Model is not defined for the store"); } this.responseRecords = new List <object>(); this.changingEventArgs = new BeforeStoreChangedEventArgs(action, jsonData, parameters, this.responseRecords); this.OnBeforeStoreChanged(changingEventArgs); Exception ex = null; try { if (!this.changingEventArgs.Cancel) { this.MakeChanges(); } } catch (Exception e) { ex = e; } AfterStoreChangedEventArgs eStoreChanged = new AfterStoreChangedEventArgs(action, true, ex, this.responseRecords); this.OnAfterStoreChanged(eStoreChanged); if (eStoreChanged.Exception != null && !eStoreChanged.ExceptionHandled) { throw new Exception(ex.Message, ex); } }
protected virtual void OnAfterStoreChanged(AfterStoreChangedEventArgs e) { AfterStoreChangedEventHandler handler = (AfterStoreChangedEventHandler)Events[EventAfterStoreChanged]; if (handler != null) { handler(this, e); } }
private void DoSaving(string jsonData, XmlNode callbackParameters) { changingEventArgs = new BeforeStoreChangedEventArgs(jsonData, null, callbackParameters); ConfirmationList confirmationList = null; if (this.UseIdConfirmation && this.Reader.Reader != null) { confirmationList = changingEventArgs.DataHandler.BuildConfirmationList(GetIdColumnName()); } changingEventArgs.ConfirmationList = confirmationList; this.OnBeforeStoreChanged(changingEventArgs); Exception ex = null; try { if (!changingEventArgs.Cancel) { this.MakeChanges(); } } catch (Exception e) { ex = e; } AfterStoreChangedEventArgs eStoreChanged = new AfterStoreChangedEventArgs(true, ex, confirmationList); this.OnAfterStoreChanged(eStoreChanged); if (eStoreChanged.Exception != null && !eStoreChanged.ExceptionHandled) { throw new Exception(ex.Message, ex); } }
private void DoSaving(string action, string jsonData, JToken parameters) { if (this.ModelInstance == null) { throw new Exception("Model is not defined for the store"); } this.responseRecords = new List<object>(); this.changingEventArgs = new BeforeStoreChangedEventArgs(action, jsonData, parameters, this.responseRecords); this.OnBeforeStoreChanged(changingEventArgs); Exception ex = null; try { if (!this.changingEventArgs.Cancel) { this.MakeChanges(); } } catch (Exception e) { ex = e; } AfterStoreChangedEventArgs eStoreChanged = new AfterStoreChangedEventArgs(action, true, ex, this.responseRecords); this.OnAfterStoreChanged(eStoreChanged); if (eStoreChanged.Exception != null && !eStoreChanged.ExceptionHandled) { throw new Exception(ex.Message, ex); } }