Example #1
0
 public static ORD_CashBll GetInstance()
 {
     if (_instance == null)
     {
         _instance = new ORD_CashBll();
     }
     return(_instance);
 }
Example #2
0
        public bool SetPaySucc(ORD_CashMod m_mod)
        {
            TransactionOptions options = new TransactionOptions();

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

            using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, options))
            {
                m_mod.CurrentID = "";
                m_mod.PayTime   = DateTime.Now;
                m_mod.Status    = (int)AppEnum.CashOrderStatus.succed;
                ORD_CashBll.GetInstance().Update(m_mod);
                switch (m_mod.ProductType)
                {
                case (int)AppEnum.CashOrderType.consultpay:    //咨询订单
                    QA_OrderMod m_order = QA_OrderBll.GetInstance().GetModel(m_mod.ProductSysNo);
                    m_order.Status = (int)AppEnum.ConsultOrderStatus.payed;
                    QA_OrderBll.GetInstance().Update(m_order);

                    //生成收款单
                    if (m_mod.ProductType == (int)AppEnum.CashOrderType.consultpay)
                    {
                        ORD_CashMod rec_order = new ORD_CashMod();
                        QA_OrderMod tmp_order = QA_OrderBll.GetInstance().GetModel(m_mod.ProductSysNo);
                        rec_order.CustomerSysNo = tmp_order.CustomerSysNo;
                        rec_order.CurrentID     = "";
                        rec_order.Discount      = 1 - AppConst.ConsultDiscount;

                        rec_order.PayAmount    = m_mod.Price * rec_order.Discount;
                        rec_order.PayType      = m_mod.PayType;
                        rec_order.Price        = m_mod.Price;
                        rec_order.ProductSysNo = m_mod.SysNo;
                        rec_order.Status       = (int)AppEnum.CashOrderStatus.confirming;
                        rec_order.ProductType  = (int)AppEnum.CashOrderType.consultget;
                        rec_order.TS           = DateTime.Now;

                        rec_order.OrderID = "C" + m_mod.ProductType.ToString("0") + DateTime.Now.ToString("yyyyMMdd") + m_mod.ProductSysNo + CommonTools.ThrowRandom(0, 99999).ToString("00000");
                        rec_order.SysNo   = ORD_CashBll.GetInstance().Add(rec_order);
                    }
                    //修改咨询购买数
                    QA_QuestionMod m_quest = new QA_QuestionMod();
                    m_quest = QA_QuestionBll.GetInstance().GetModel(m_order.QuestionSysNo);
                    m_quest.BuyCount++;
                    QA_QuestionBll.GetInstance().Update(m_quest);
                    break;
                }
                scope.Complete();
                return(true);
            }
        }
Example #3
0
 public static ORD_CashBll GetInstance()
 {
     if (_instance == null)
     { _instance = new ORD_CashBll(); }
     return _instance;
 }