Example #1
0
        public void Verify(int netpaySysNo, int userSysNo)
        {
            TransactionOptions options = new TransactionOptions();

            options.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;
            options.Timeout        = TransactionManager.DefaultTimeout;

            using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, options))
            {
                NetPayInfo dbInfo = Load(netpaySysNo);
                if (dbInfo.Status != (int)AppEnum.NetPayStatus.Origin)
                {
                    throw new BizException("netpay: not origin, can't verify");
                }

                dbInfo.Status = (int)AppEnum.NetPayStatus.Verified;

                Hashtable ht = new Hashtable(5);
                ht.Add("SysNo", dbInfo.SysNo);
                ht.Add("ApproveUserSysNo", userSysNo);
                ht.Add("ApproveTime", DateTime.Now);
                ht.Add("Status", dbInfo.Status);

                new NetPayDac().Update(ht);

                //so income 的唯一性那边会判断的
                SOIncomeInfo oIncome = new SOIncomeInfo();
                oIncome.OrderType       = (int)AppEnum.SOIncomeOrderType.SO;
                oIncome.OrderSysNo      = dbInfo.SOSysNo;
                oIncome.OrderAmt        = dbInfo.PayAmount;
                oIncome.IncomeStyle     = (int)AppEnum.SOIncomeStyle.Advanced;
                oIncome.IncomeAmt       = dbInfo.PayAmount;
                oIncome.IncomeUserSysNo = userSysNo;
                oIncome.IncomeTime      = DateTime.Now;
                oIncome.Status          = (int)AppEnum.SOIncomeStatus.Origin;

                SOIncomeManager.GetInstance().Insert(oIncome);

                scope.Complete();
            }
        }
Example #2
0
        public void InsertSOIncomeVoucherList(Hashtable ht)
        {
            TransactionOptions options = new TransactionOptions();

            options.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;
            options.Timeout        = TransactionManager.DefaultTimeout;

            using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, options))
            {
                foreach (SOIncomeVoucherInfo oParam in ht.Keys)
                {
                    SOIncomeVoucherInfo newInfo = LoadSOIncomeVoucher(oParam);
                    if (newInfo == null)
                    {
                        InsertSOIncomeVoucher(oParam);
                    }
                    else
                    {
                        newInfo.VoucherID   = oParam.VoucherID;
                        newInfo.VoucherTime = oParam.VoucherTime;
                        UpdateSOIncomeVoucher(newInfo);
                    }

                    SOIncomeInfo oInfo = SOIncomeManager.GetInstance().Load(oParam.FSISysNo);
                    if (oInfo.OrderType == (int)AppEnum.SOIncomeOrderType.RO)
                    {
                        RMARefundInfo oRefundInfo = RMARefundManager.GetInstance().LoadRMARefund(oInfo.OrderSysNo);
                        if (oRefundInfo != null)
                        {
                            Hashtable rmaht = new Hashtable();
                            rmaht.Add("SysNo", oRefundInfo.SysNo);
                            rmaht.Add("VoucherID", oParam.VoucherID);
                            rmaht.Add("VoucherTime", oParam.VoucherTime);
                            RMARefundManager.GetInstance().UpdateMasterMemo(rmaht);
                        }
                    }
                }
                scope.Complete();
            }
        }