Exemple #1
0
        //2006-08-11
        public void AddScore(int CustomerSysNo,int increment)
        {
            if(HasAddScoreForHF(CustomerSysNo,17))
            {
                return;
            }
            TransactionOptions options = new TransactionOptions();
            options.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;
            options.Timeout = TransactionManager.DefaultTimeout;

            using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, options))
            {
                int rowsAffected = new PointDac().SetScore(CustomerSysNo, increment);
                if(rowsAffected!=1)
                    throw new BizException("�ͻ����ָ���ʧ�ܣ�������Ϊ���ֲ��㡣");

                if ( increment != 0)
                {
                    int pointLogType = 17;
                    string poingLogMemo = "�ƺ��ͻ���";
                    CustomerPointLogInfo oPointLog = new CustomerPointLogInfo(CustomerSysNo, pointLogType, increment, poingLogMemo);
                    oPointLog.LogCheck = oPointLog.CalcLogCheck();

                    if ( 1!=new PointDac().InsertLog(oPointLog))
                        throw new BizException("���ӻ�����ˮʧ��");
                }

                scope.Complete();
            }
        }
Exemple #2
0
        public void SetScore(int customerSysNo, int pointDelt, int pointLogType, string poingLogMemo)
        {
            TransactionOptions options = new TransactionOptions();
            options.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;
            options.Timeout = TransactionManager.DefaultTimeout;

            using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, options))
            {
                int rowsAffected = new PointDac().SetScore(customerSysNo, pointDelt);
                if(rowsAffected!=1)
                    throw new BizException("�ͻ����ָ���ʧ�ܣ�������Ϊ���ֲ��㡣");

                if ( pointDelt != 0)
                {
                    CustomerPointLogInfo oPointLog = new CustomerPointLogInfo(customerSysNo, pointLogType, pointDelt, poingLogMemo);
                    oPointLog.LogCheck = oPointLog.CalcLogCheck();

                    if ( 1!=new PointDac().InsertLog(oPointLog))
                        throw new BizException("���ӻ�����ˮʧ��");
                }

                scope.Complete();
            }
        }