コード例 #1
0
ファイル: BindGiftNo.cs プロジェクト: wra222/testgit
        /// <summary>
        /// 将前一步骤生成的最大生成号插入FRUGift表中,然后将scanPart插入到FRUGift_Part表中
        /// </summary>
        /// <param name="executionContext"></param>
        /// <returns></returns>
        protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
        {
            //将前一步骤生成的最大生成号插入FRUGift表中
            IGiftRepository giftRep = RepositoryFactory.GetInstance().GetRepository<IGiftRepository, FRUGift>();
            string model = (string)CurrentSession.GetValue(Session.SessionKeys.ModelName);
            IList<string> giftNoLst = (IList<string>)CurrentSession.GetValue(Session.SessionKeys.GiftNoList);
            string giftID = giftNoLst[0];
            CurrentSession.AddValue(Session.SessionKeys.GiftID, giftID);
            int qty = (int)CurrentSession.GetValue(Session.SessionKeys.GiftScanPartCount);
            FRUGift item = new FRUGift(model, giftID, qty);
            
            

            //将scanPart插入到FRUGift_Part表中
            IList<string> partLst = (IList<string>)CurrentSession.GetValue(Session.SessionKeys.GiftPartNoList);
            IList<IList<string>> scanList = (IList<IList<string>>)CurrentSession.GetValue(Session.SessionKeys.GiftScanPartList);
            for (int i = 0; i < partLst.Count; i++)
            {
                //    <bug>
                //                BUG NO:ITC-1155-0197
                //                REASON:错写成scanList.Count
                //    </bug>
                for (int j = 0; j < scanList[i].Count; j++)
                {
                    FRUPart fruPart = new FRUPart(giftID, partLst[i], scanList[i][j],this.Editor,new DateTime());
                    item.AddPart(fruPart);
                }
               
            }
            giftRep.Add(item, CurrentSession.UnitOfWork);
           

            return base.DoExecute(executionContext);
        }
コード例 #2
0
ファイル: BindCartonToCT.cs プロジェクト: wra222/testgit
        protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
        {
            IFRUCartonRepository fruCartonRep = RepositoryFactory.GetInstance().GetRepository<IFRUCartonRepository>();
            string cartonNo = ((IList<string>)this.CurrentSession.GetValue(Session.SessionKeys.FRUCartonNoList))[0];
            string model = (string)this.CurrentSession.GetValue(Session.SessionKeys.ModelName);
            int qty = (int)this.CurrentSession.GetValue(Session.SessionKeys.GiftScanPartCount);
            
            FRUCarton fr = new FRUCarton(cartonNo, model, qty);

          
            IList<string> partLst = (IList<string>)CurrentSession.GetValue(Session.SessionKeys.GiftPartNoList);
            IList<IList<string>> scanList = (IList<IList<string>>)CurrentSession.GetValue(Session.SessionKeys.GiftScanPartList);
           
            for (int i = 0; i < partLst.Count; i++)
            {
                for (int j = 0; j < scanList[i].Count; j++)
                {
                    FRUPart fruPart = new FRUPart(cartonNo, partLst[i], scanList[i][j], this.Editor, new DateTime());
                    fr.AddPart(fruPart);
                }
               
            }
           
            fruCartonRep.Add(fr, CurrentSession.UnitOfWork);
       
            return base.DoExecute(executionContext);
     
        }
コード例 #3
0
ファイル: BindGiftNoFor055.cs プロジェクト: wra222/testgit
        protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
        {
            IFRUCartonRepository fruCartonRep = RepositoryFactory.GetInstance().GetRepository<IFRUCartonRepository>();
            string cartonNo = ((IList<string>)this.CurrentSession.GetValue(Session.SessionKeys.FRUCartonNoList))[0];
            string model = (string)this.CurrentSession.GetValue(Session.SessionKeys.ModelName);
            int qty = (int)this.CurrentSession.GetValue(Session.SessionKeys.Qty);
            IList<string> giftList = (IList<string>)this.CurrentSession.GetValue(Session.SessionKeys.GiftNoList);


            FRUCarton fr = new FRUCarton(cartonNo, model, qty);

            foreach (string gift in giftList)
            {
                if (fruCartonRep.CheckExistForFRUCarton_FRUGift(gift))
                {
                    throw new FisException("CHK132", new string[] { gift });
                }
                IFRUPart item = new FRUPart(cartonNo, gift, "", this.Editor, System.DateTime.Now);
                fr.AddGift(item);
            }

            fruCartonRep.Add(fr, CurrentSession.UnitOfWork);
            return base.DoExecute(executionContext);
        }