Пример #1
0
        public void CancelHandleRMA(RMAInfo rmaInfo, SessionInfo sInfo)
        {
            TransactionOptions options = new TransactionOptions();

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

            using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, options))
            {
                if (this.GetRMACurrentStatus(rmaInfo.SysNo) != (int)AppEnum.RMAStatus.Handled)
                {
                    throw new BizException("This rma sheet is not handled now,can't cancel handle");
                }
                //如果存在退货单,则作废
                ROInfo roInfo = ROManager.GetInstance().LoadROfromRMA(rmaInfo.SysNo);
                if (roInfo != null)
                {
                    ROManager.GetInstance().AbandonRO(roInfo);
                    LogManager.GetInstance().Write(new LogInfo(roInfo.SysNo, (int)AppEnum.LogType.Sale_RO_Abandon, sInfo));
                }
                Hashtable paramHash = new Hashtable(4);
                paramHash.Add("Status", rmaInfo.Status);
                paramHash.Add("RMATime", rmaInfo.RMATime);
                paramHash.Add("RMAUserSysNo", rmaInfo.RMAUserSysNo);
                paramHash.Add("SysNo", rmaInfo.SysNo);
                this.UpdateRMAMaster(paramHash);
                LogManager.GetInstance().Write(new LogInfo(rmaInfo.SysNo, (int)AppEnum.LogType.Sale_RMA_CancelHandle, sInfo));
                scope.Complete();
            }
        }
Пример #2
0
        public void HandleRMA(RMAInfo rmaInfo, SessionInfo sInfo)
        {
            TransactionOptions options = new TransactionOptions();

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

            using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, options))
            {
                if (this.GetRMACurrentStatus(rmaInfo.SysNo) != (int)AppEnum.RMAStatus.Received)
                {
                    throw new BizException("This rma sheet is not received now,can't be handled");
                }
                Hashtable paramHash = new Hashtable(4);
                paramHash.Add("Status", rmaInfo.Status);
                paramHash.Add("RMATime", rmaInfo.RMATime);
                paramHash.Add("RMAUserSysNo", rmaInfo.RMAUserSysNo);
                paramHash.Add("SysNo", rmaInfo.SysNo);
                this.UpdateRMAMaster(paramHash);
                //如果有退货类型的商品,自动生成退货单
                foreach (RMAItemInfo rmaItem in rmaInfo.ItemHash.Values)
                {
                    if (rmaItem.RMAType == (int)AppEnum.RMAType.Return)
                    {
                        ROInfo roInfo = ROManager.GetInstance().BuildROFromRMA(rmaInfo);
                        ROManager.GetInstance().AddRO(roInfo);
                        LogManager.GetInstance().Write(new LogInfo(roInfo.SysNo, (int)AppEnum.LogType.Sale_RO_Create, sInfo));
                        break;
                    }
                }
                LogManager.GetInstance().Write(new LogInfo(rmaInfo.SysNo, (int)AppEnum.LogType.Sale_RMA_Handle, sInfo));
                scope.Complete();
            }
        }