예제 #1
0
        public static void PostfixUBFTransactionScopeConstructor(UBFTransactionScope __instance,
                                                                 TransactionOption option)
        {
            if (_debugConfig == null)
            {
                return;
            }
            string enterpriseID = PlatformContext.Current.EnterpriseID;
            string orgCode      = PlatformContext.Current.OrgCode;
            string userCode     = PlatformContext.Current.UserCode;

            if (!IsLog(enterpriseID, orgCode, userCode))
            {
                return;
            }
            StringBuilder sb         = new StringBuilder();
            StackTrace    stackTrace = new StackTrace(true);

            for (int i = 0; i < stackTrace.FrameCount; i++)
            {
                StackFrame frame  = stackTrace.GetFrame(i);
                MethodBase method = frame.GetMethod();
                if (method.DeclaringType == null)
                {
                    continue;
                }
                if (method.DeclaringType == typeof(SQLDebug))
                {
                    continue;
                }
                string assemblyFullName = method.DeclaringType.Assembly.FullName;
                sb.AppendFormat("自定义事务:");
                if (!string.IsNullOrEmpty(assemblyFullName))
                {
                    sb.Append(assemblyFullName.Split(',')[0]);
                    sb.Append("!");
                }
                sb.AppendFormat("{0}.{1} 事务类型:{2} 事务ID:{3}",
                                method.DeclaringType.FullName,
                                method.Name, option, Transaction.Current == null
                        ? string.Empty
                        : Transaction.Current.TransactionInformation.LocalIdentifier);
                break;
            }
            if (_debugConfig.IsOutputTransactionStack)
            {
                sb.AppendLine();
                sb.Append(StackTraceHelper.GetCurrentStackTraceString(4));
            }
            Logger.Debug(sb.ToString());
        }
예제 #2
0
        // 事务,防止审核不过,但是状态变了;(2016-12-28 熊彬 测试,就有AAi生成失败,报错,但是单子已审核;)
        public static void ApproveMiscShips(System.Collections.Generic.List <CommonArchiveDataDTOData> miscshiplistCreated)
        {
            using (UBFTransactionScope aTransact = new UBFTransactionScope(TransactionOption.Required))
            {
                try
                {
                    CommonApproveMiscShipSVProxy approveproxy2 = new CommonApproveMiscShipSVProxy();
                    approveproxy2.MiscShipmentKeyList = (miscshiplistCreated);
                    approveproxy2.Do();

                    aTransact.Commit();
                }
                catch (Exception ex)
                {
                    aTransact.Rollback();

                    throw ex;
                }
            }
        }
예제 #3
0
        // 事务,防止审核不过,但是状态变了;
        public static void ApproveShipments(System.Collections.Generic.List <DocKeyDTOData> shipKeyList)
        {
            using (UBFTransactionScope aTransact = new UBFTransactionScope(TransactionOption.Required))
            {
                try
                {
                    AuditShipSVProxy approveproxy = new AuditShipSVProxy();
                    approveproxy.ShipKeys = shipKeyList;
                    approveproxy.Do();

                    aTransact.Commit();
                }
                catch (Exception ex)
                {
                    aTransact.Rollback();

                    throw ex;
                }
            }
        }
예제 #4
0
        public static void ApproveShipments(System.Collections.Generic.List<DocKeyDTOData> shipKeyList)
        {
            using (UBFTransactionScope aTransact = new UBFTransactionScope(TransactionOption.Required))
            {
                try
                {
                    AuditShipSVProxy approveproxy = new AuditShipSVProxy();
                    approveproxy.ShipKeys = shipKeyList;
                    approveproxy.Do();

                    aTransact.Commit();
                }
                catch (Exception ex)
                {
                    aTransact.Rollback();

                    throw ex;
                }
            }
        }