首页 > 代码库 > 事务记账

事务记账

  var transactionOption = new TransactionOptions { IsolationLevel = IsolationLevel.Serializable, Timeout = TimeSpan.FromMilliseconds(10 * 60 * 1000) };

                using (var scope = isTrans ? new TransactionScope(TransactionScopeOption.Required, transactionOption) : null)
                {
                    #region 第一大步:记账前检查

                    #region 第一小步:事项(记账前检查)

                    #endregion

                    #region 第二小步:交易(记账前检查)

                    #endregion

                    #region 第三小步:账户(记账前检查)
                    #endregion

                    #region 第四大步:记账后处理

                    #region 第一小步:事项(记账后处理)

                    #endregion

                    #region 第二小步:交易(记账后处理)
                    #endregion

                    #endregion

                    if (isTrans)
                    {
                        scope.Complete();
                    }
                }

事务记账