private void DefaultSession_BeforeConnect(object sender, SessionManipulationEventArgs e) { throw new Exception( "This error occurs because you tried to use the Session.DefaultSession " + "(please refer to XPO documentation to learn more) in XAF. " + "It is not allowed by default. Instead, use the XafApplication.ConnectionString property " + "to configure the connection to the database according to your needs. " + "Most likely, this problem is caused by the fact that you instantiated your persistent object, " + "XPCollection, etc. without the Session parameter and the default session was used by default. " + "Use a non-default session object to instantiate your objects and collections."); }
private void directBaseUow_BeforeCommitTransaction(object sender, SessionManipulationEventArgs e) { var listDemo = new List <DemoInfo>(); var listSource = new List <SourseInfo>(); foreach (var item in e.Session.GetObjectsToSave()) { switch (item) { case DemoInfo demoInfo: { if (!listDemo.Contains(demoInfo)) { listDemo.Add(demoInfo); } break; } case SourseInfo sourseInfo: { if (!listSource.Contains(sourseInfo)) { listSource.Add(sourseInfo); } break; } case ConsultRecord consultRecord: { if (consultRecord.DemoInfo != null && !listDemo.Contains(consultRecord.DemoInfo)) { listDemo.Add(consultRecord.DemoInfo); } if (consultRecord.SourseInfo != null && !listSource.Contains(consultRecord.SourseInfo)) { listSource.Add(consultRecord.SourseInfo); } break; } } } foreach (var demoInfo in listDemo) { demoInfo.CalculateCurrentCount(); } foreach (var sourseInfo in listSource) { sourseInfo.CalculateCurrentCount(); } }
private void UnitOfWork_BeforeDisconnect(object sender, SessionManipulationEventArgs e) { }
private void UnitOfWork_AfterConnect(object sender, SessionManipulationEventArgs e) { }
private void UnitOfWork_AfterCommitTransaction(object sender, SessionManipulationEventArgs e) { }
/// <summary> /// Handles the AfterCommitTransaction event of the session control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="DevExpress.Xpo.SessionManipulationEventArgs"/> instance containing the event data.</param> private void session_AfterCommitTransaction(object sender, SessionManipulationEventArgs e) { // save changes saveProtocolData(); trackedObjects.Refresh(); }
/// <summary> /// Handles the AfterRollbackTransaction event of the session control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="DevExpress.Xpo.SessionManipulationEventArgs"/> instance containing the event data.</param> private void session_AfterRollbackTransaction(object sender, SessionManipulationEventArgs e) { // clear lists trackedObjects.Clear(); sessionEvents.Rollback(); }
private void Session_AfterCommitTransaction(object sender, SessionManipulationEventArgs e) { AcceptSequence(); }
static void UnitOfWorkBeforePreProcessCommitedList(object sender, SessionManipulationEventArgs e) { System.Diagnostics.Debug.WriteLine("UnitOfWorkBeforePreProcessCommitedList()"); }
static void UnitOfWorkBeforeFlushChanges(object sender, SessionManipulationEventArgs e) { System.Diagnostics.Debug.WriteLine("UnitOfWorkBeforeFlushChanges()"); }
static void UnitOfWorkBeforeDisconnect(object sender, SessionManipulationEventArgs e) { System.Diagnostics.Debug.WriteLine("UnitOfWorkBeforeDisconnect()"); }
static void UnitOfWorkAfterCommitTransaction(object sender, SessionManipulationEventArgs e) { System.Diagnostics.Debug.WriteLine("UnitOfWorkAfterCommitTransaction()"); }
static void UnitOfWorkAfterBeginTrackingChanges(object sender, SessionManipulationEventArgs e) { System.Diagnostics.Debug.WriteLine("UnitOfWorkAfterBeginTrackingChanges()"); }
/// <summary> /// Handles the AfterRollbackTransaction event of the session control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="DevExpress.Xpo.SessionManipulationEventArgs"/> instance containing the event data.</param> private void session_AfterRollbackTransaction(object sender, SessionManipulationEventArgs e) { // clear lists trackedObjects.Clear(); sessionEvents.Rollback(); }
private void UnitOfWork_BeforeRollbackTransaction(object sender, SessionManipulationEventArgs e) { }
static void UnitOfWorkBeforeRollbackTransaction(object sender, SessionManipulationEventArgs e) { System.Diagnostics.Debug.WriteLine("UnitOfWorkBeforeRollbackTransaction()"); }
private static void SessionOnAfterCommitTransaction(object sender, SessionManipulationEventArgs e) { ((Session)sender).AfterCommitTransaction -= SessionOnAfterCommitTransaction; Instance.Accept(); }
private void Session_AfterRollBack(object sender, SessionManipulationEventArgs e) { CancelSequence(); }
void Session_AfterCommitTransaction(object sender, SessionManipulationEventArgs e) { AcceptSequence(); }
/// <summary> /// Handles the AfterCommitTransaction event of the session control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="DevExpress.Xpo.SessionManipulationEventArgs"/> instance containing the event data.</param> private void session_AfterCommitTransaction(object sender, SessionManipulationEventArgs e) { // save changes saveProtocolData(); trackedObjects.Refresh(); }
void Session_AfterRollBack(object sender, SessionManipulationEventArgs e) { CancelSequence(); }
public void SessionManipulationHandler(object sender, SessionManipulationEventArgs e) { EvalTransactionState(); }
private void DefaultSession_BeforeConnect(object sender, SessionManipulationEventArgs e) { throw new Exception( "This error occurs because you tried to use the Session.DefaultSession " + "(please refer to XPO documentation to learn more) in XAF. " + "It is not allowed by default. Instead, use the XafApplication.ConnectionString property " + "to configure the connection to the database according to your needs. " + "Most likely, this problem is caused by the fact that you instantiated your persistent object, " + "XPCollection, etc. without the Session parameter and the default session was used by default. " + "Use a non-default session object to instantiate your objects and collections."); }