예제 #1
0
        /// <summary>
        /// Starts a <see cref="DALCTransaction"/> if this instance of the BusinessFacade was constructed to participate in
        /// transactions.  It also sets the transaction's private variables appropriately and pushes the created Guid for the
        /// BusinessFacade method calling Start() to the transaction's stack of users.
        /// </summary>
        protected void Start()
        {
            // Only start a transaction if the business facade was constructed to partipate in transactions
            if (_partipatesInTransaction)
            {
                //Start a transaction if one does not exist, otherwise it uses the existing transaction
                if (!_isInTransaction)
                {
                    //Create the DALCTransaction and set it to the private variable
                    _transaction     = new DALCTransaction(Guid.NewGuid());
                    _isInTransaction = true;

                    //Add the transaction to the TransactionManager if one exists
                    if (_hasTransactionManager)
                    {
                        _transactionManager.AddTransaction(_transaction);
                    }
                }
                else
                {
                    //Push a new GUID to the transaction users stack
                    _transaction.PushTransactionUser(Guid.NewGuid());
                }
            }
        }
예제 #2
0
        /// <summary>
        /// Constructor with a <see cref="DALCTransaction"/> to initialize the BusinessFacade's private variables.
        /// Called if this instance of the business facade is to be created within the scope of an existing <see cref="DALCTransaction"/>.
        /// </summary>
        /// <param name="transaction"><see cref="DALCTransaction"/> that has been previously created for a specific business workflow</param>
        public BusinessFacade(DALCTransaction transaction)
        {
            // Check input DALCTransaction
            if (transaction == null)
            {
                throw new MNFatalException(
                          "Transaction parameter must not be null to perform data access logic using a transaction.");
            }

            // Assign the transaction object
            _transaction = transaction;

            // Initialize variables
            _partipatesInTransaction = true;
            _isInTransaction         = true;
            _isTransactionAborted    = false;
            _hasTransactionManager   = false;
        }
예제 #3
0
 public IssueDocumentDalc(DALCTransaction transaction) : base(transaction)
 {
 }
예제 #4
0
 /// <summary>
 /// Constructor with a transaction.
 /// </summary>
 /// <param name="transaction"></param>
 public SubscriptionDalc(DALCTransaction transaction)
     : base(transaction)
 {
 }
예제 #5
0
 public ArticleDocumentDalc(DALCTransaction transaction) : base(transaction)
 {
 }
예제 #6
0
 public VolumeDALC(DALCTransaction transaction)
     : base(transaction)
 {
 }
예제 #7
0
 /// <summary>
 /// Constructor with a transaction.
 /// </summary>
 /// <param name="transaction"></param>
 public RoleDalc(DALCTransaction transaction)
     : base(transaction)
 {
 }
예제 #8
0
 public UserIPAddressDalc(DALCTransaction transaction) : base(transaction)
 {
 }
예제 #9
0
파일: UserDalc.cs 프로젝트: cagrawal27/NPC
 /// <summary>
 /// Constructor with a transaction.
 /// </summary>
 /// <param name="transaction"></param>
 public UserDalc(DALCTransaction transaction)
     : base(transaction)
 {
 }