private void ProcessPayment(Boolean IsCorrection)
        {
            // start transaction
            using (TransactionScope TS = new TransactionScope())
            {
                // process payment
                try
                {
                    ClassCustomBinding.BindToObject("ModelTMSContainer." + SetName + "Set", KeyID, Controls, DataItem, ControlObjectContext);

                    if (!IsCorrection)
                    {
                        (DataItem as RelationAdvancePayment).PayOut(ControlObjectContext, Common.CurrentClientDateTime(Session));
                    }
                    else
                    {
                        (DataItem as RelationAdvancePayment).PayBack(ControlObjectContext, Common.CurrentClientDateTime(Session));
                    }
                    ControlObjectContext.SaveChanges(SaveOptions.DetectChangesBeforeSave);

                    // commit transaction
                    TS.Complete();
                }
                catch (Exception ex)
                {
                    // rollback transaction
                    TS.Dispose();

                    // inform user
                    Common.InformUserOnTransactionFail(ex, Page);
                }
            }
        }
Exemplo n.º 2
0
 public void SaveDataIntoDataItemFromControls()
 {
     ClassCustomBinding.BindToObject("ModelTMSContainer." + SetName + "Set", KeyID, Controls, DataItem, ControlObjectContext);
 }
Exemplo n.º 3
0
 public void RebindControls()
 {
     ClassCustomBinding.BindToControls("ModelTMSContainer." + SetName + "Set", KeyID, Controls, DataItem, ControlObjectContext);
 }