Exemplo n.º 1
0
        protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
        {
            var prodMo = (MO)CurrentSession.GetValue(Session.SessionKeys.ProdMO);
            var prodNoList = (IList<string>)CurrentSession.GetValue(Session.SessionKeys.ProdNoList);
         //   var ecr = CurrentSession.GetValue(Session.SessionKeys.ECR).ToString();
            var shipDate = CurrentSession.GetValue(IMES.Infrastructure.Extend.ExtendSession.SessionKeys.DeliveryDate).ToString();
            var sku = CurrentSession.GetValue(IMES.Infrastructure.Extend.ExtendSession.SessionKeys.SKU).ToString();
            var subProdList = new List<IProduct>();
            CurrentSession.AddValue(Session.SessionKeys.ProdList, subProdList);

            IProductRepository prodRepository = RepositoryFactory.GetInstance().GetRepository<IProductRepository, IProduct>();
           
            //将所有的ProdId插入Product表,ID=ProdId#, MOID=mo#, ModelID=model#,ECR=ecr# 
            //记录Product的状态,在ProductStatus插入记录
            
            foreach (string item in prodNoList)
            {

                Product prod = new Product(item);

          //      prod.ECR = ecr;
                prod.MO = prodMo.Key.ToString ();
                prod.Model = prodMo.Model;
                ProductStatus prodStatus = new ProductStatus();
                prodStatus.Editor = this.Editor;
                prodStatus.Line = this.Line;
                prodStatus.StationId = this.Station;
                prodStatus.ProId = item;
                prodStatus.Status = StationStatus.Pass;
                prodStatus.ReworkCode = string.Empty;
                prod.Status  = prodStatus;
                prod.SetExtendedProperty("ShipDate",shipDate,this.Editor);
                if (!string.IsNullOrEmpty(sku))
                { prod.SetExtendedProperty("SKU", sku, this.Editor); }

                prodRepository.Add(prod, CurrentSession.UnitOfWork);
                subProdList.Add(prod);
           }


            return base.DoExecute(executionContext);
        }
Exemplo n.º 2
0
        /// <summary> 
        /// </summary>        
        protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
        {
            var prodMo = (MO)CurrentSession.GetValue(Session.SessionKeys.ProdMO);
            var prodNoList = (IList<string>)CurrentSession.GetValue(Session.SessionKeys.ProdNoList);            
            var shipDate = CurrentSession.GetValue(IMES.Infrastructure.Extend.ExtendSession.SessionKeys.DeliveryDate).ToString();
            string bomremark = (string)CurrentSession.GetValue("BomRemark");
            string remark = (string)CurrentSession.GetValue("Remark");
            string exception = (string)CurrentSession.GetValue("Exception");
            string inFAI = (string)CurrentSession.GetValue("inFAI");
            var subProdList = new List<IProduct>();
            CurrentSession.AddValue(Session.SessionKeys.ProdList, subProdList);

            IProductRepository prodRepository = RepositoryFactory.GetInstance().GetRepository<IProductRepository, IProduct>();

            //将所有的ProdId插入Product表,ID=ProdId#, MOID=mo#, ModelID=model#
            
            foreach (string item in prodNoList)
            {

                Product prod = new Product(item);

                prod.MO = prodMo.Key.ToString();
                prod.Model = prodMo.Model;
                ProductStatus prodStatus = new ProductStatus();
                prodStatus.Editor = this.Editor;
                prodStatus.Line = this.Line;
                prodStatus.StationId = this.Station;
                prodStatus.ProId = item;
                prodStatus.Status = StationStatus.Pass;
                prodStatus.ReworkCode = string.Empty;
                prod.Status = prodStatus;
                //ITC-1360-1337 ITC-1360-1300
                prod.SetExtendedProperty("ShipDate", shipDate, this.Editor);
                if(!String.IsNullOrEmpty(bomremark))
                    prod.SetExtendedProperty("BomRemark", bomremark.ToUpper(), this.Editor);
                if(!String.IsNullOrEmpty(remark))
                    prod.SetExtendedProperty("Remark", remark.ToUpper(), this.Editor);
                if(!String.IsNullOrEmpty(exception))
                    prod.SetExtendedProperty("Exception", exception, this.Editor);
                if (inFAI == "Y")
                    prod.SetExtendedProperty("FAIinFA", "Y", this.Editor);
                prod.SetExtendedProperty("PdLine", this.Line, this.Editor);
                //TODO 1.
                prodRepository.Add(prod, CurrentSession.UnitOfWork);
                subProdList.Add(prod);
            }
            IList<string> range = (IList<string>)CurrentSession.GetValue(Session.SessionKeys.ProdNoList);
            string mo = (string)CurrentSession.GetValue(Session.SessionKeys.MONO);
            CurrentSession.AddValue(Session.SessionKeys.PrintLogName, "PrdId");
            CurrentSession.AddValue(Session.SessionKeys.PrintLogBegNo, range[0]);            
            CurrentSession.AddValue(Session.SessionKeys.PrintLogEndNo, range[range.Count-1]);
            CurrentSession.AddValue(Session.SessionKeys.PrintLogDescr, mo);
                          
            return base.DoExecute(executionContext);
        }
        /// <summary> 
        /// </summary>        
        protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
        {
            var prodMo = (MO)CurrentSession.GetValue(Session.SessionKeys.ProdMO);
            var prodNoList = (IList<string>)CurrentSession.GetValue(Session.SessionKeys.ProdNoList);
        
            
            var subProdList = new List<IProduct>();
            CurrentSession.AddValue(Session.SessionKeys.ProdList, subProdList);

            IProductRepository prodRepository = RepositoryFactory.GetInstance().GetRepository<IProductRepository, IProduct>();

            //将所有的ProdId插入Product表,ID=ProdId#, MOID=mo#, ModelID=model#
            string ecr = (string)CurrentSession.GetValue(Session.SessionKeys.ECR);
            foreach (string item in prodNoList)
            {

                Product prod = new Product(item);

                prod.MO = prodMo.Key.ToString();
                prod.Model = prodMo.Model;
                ProductStatus prodStatus = new ProductStatus();
                prodStatus.Editor = this.Editor;
                prodStatus.Line = this.Line;
                prodStatus.StationId = "F0";
                prodStatus.ProId = item;
                prodStatus.Status = StationStatus.Pass;
                prodStatus.ReworkCode = string.Empty;
                prod.Status = prodStatus;
                
                if (!String.IsNullOrEmpty(ecr))
                    prod.SetExtendedProperty("ECR", ecr.ToUpper(), this.Editor);

                prodRepository.Add(prod, CurrentSession.UnitOfWork);
                subProdList.Add(prod);
            }
            IList<string> range = (IList<string>)CurrentSession.GetValue(Session.SessionKeys.ProdNoList);
            string mo = (string)CurrentSession.GetValue(Session.SessionKeys.MONO);
            CurrentSession.AddValue(Session.SessionKeys.PrintLogName, "PrdId");
            CurrentSession.AddValue(Session.SessionKeys.PrintLogBegNo, range[0]);
            CurrentSession.AddValue(Session.SessionKeys.PrintLogEndNo, range[range.Count - 1]);
            CurrentSession.AddValue(Session.SessionKeys.PrintLogDescr, mo);

            return base.DoExecute(executionContext);
        }