Example #1
0
        public void CommendCustomerEmailVerified(int CustomerSysNo,string CommendEmail)
        {
            TransactionOptions options = new TransactionOptions();
            options.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;
            options.Timeout = TransactionManager.DefaultTimeout;

            using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, options))
            {
                CustomerCommendInfo oInfo = LoadCustomerCommend(CommendEmail);
                if(oInfo == null)
                    throw new BizException("");
                decimal increment = 5; //�Ƽ��ĺ���ͨ��Email��֤����5���˷�
                int rowsAffected = new FreeShipFeeDac().SetFreeShipFee(CustomerSysNo, increment);
                if (rowsAffected != 1)
                    throw new BizException("�ͻ��˷�������ʧ�ܣ�������Ϊ�˷����㡣");

                UpdateCustomerCommendStatus(CommendEmail, (int) AppEnum.CommendStatus.Registered); //�����Ƽ�״̬

                if (increment != 0)
                {
                    int freeShipFeeLogType = (int)AppEnum.FreeShipFeeLogType.CustomerRegister;
                    string freeShipFeeLogMemo = "�Ƽ��ͻ�ע�����˷� - " + CommendEmail;
                    CustomerFreeShipFeeLogInfo oLog = new CustomerFreeShipFeeLogInfo(CustomerSysNo, freeShipFeeLogType, increment, freeShipFeeLogMemo);
                    oLog.LogCheck = oLog.CalcLogCheck();

                    if (1 != new FreeShipFeeDac().Insert(oLog))
                        throw new BizException("�����˷����ʧ��");
                }

                scope.Complete();
            }
        }
Example #2
0
        public void SetFreeShipFee(int CustomerSysNo, decimal increment, int freeShipFeeLogType, string freeShipFeeLogMemo)
        {
            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 FreeShipFeeDac().SetFreeShipFee(CustomerSysNo, increment);
                if (rowsAffected != 1)
                    throw new BizException("�ͻ����˷�������ʧ�ܣ�������Ϊ�˷����㡣");

                if (increment != 0)
                {
                    CustomerFreeShipFeeLogInfo oLog = new CustomerFreeShipFeeLogInfo(CustomerSysNo,freeShipFeeLogType,increment,freeShipFeeLogMemo);
                    oLog.LogCheck = oLog.CalcLogCheck();

                    if (1 != new FreeShipFeeDac().Insert(oLog))
                        throw new BizException("�������˷����ʧ��");
                }

                scope.Complete();
            }
        }