public static RMASendAccessoryManager GetInstance()
 {
     if (_instance == null)
     {
         _instance = new RMASendAccessoryManager();
     }
     return(_instance);
 }
示例#2
0
        public static RMASendAccessoryManager GetInstance()
        {
            if (_instance == null)
            {

                _instance = new RMASendAccessoryManager();
            }
            return _instance;
        }
        public int DeleteItem(int productSysNo, int saSysNo)
        {
            int result;
            RMASendAccessoryItemInfo saItemInfo = RMASendAccessoryManager.GetInstance().LoadItem(productSysNo, saSysNo);
            RMASendAccessoryInfo     saInfo     = RMASendAccessoryManager.GetInstance().Load(saSysNo);

            if (saInfo.Status != (int)AppEnum.RMASendAccessoryStatus.WaitingAudit)
            {
                throw new BizException("补发附件单不是待审核状态,不能删除相关Item!");
            }
            else
            {
                result = new RMASendAccessoryDac().DeleteItem(saItemInfo.SysNo);
            }
            return(result);
        }
        public void AddAccessory(RMASendAccessoryInfo rmaInfo)
        {
            TransactionOptions options = new TransactionOptions();

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

            using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, options))
            {
                rmaInfo.SysNo           = SequenceDac.GetInstance().Create("RMA_SendAccessory_Sequence");
                rmaInfo.SendAccessoryID = this.BuildSendAccessoryID(rmaInfo.SysNo);
                rmaInfo.Status          = (int)AppEnum.RMASendAccessoryStatus.WaitingAudit;
                this.InsertSentAccessory(rmaInfo);
                foreach (RMASendAccessoryItemInfo rmaItem in rmaInfo.ItemHash.Values)
                {
                    rmaItem.SendAccessorySysNo = rmaInfo.SysNo;
                    RMASendAccessoryManager.GetInstance().InsertSentAccessoryItem(rmaItem);
                }
                scope.Complete();
            }
        }