Exemplo n.º 1
0
        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);
     
        }
Exemplo n.º 2
0
        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);
        }