• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ActivityExecutionContext类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ActivityExecutionContext的典型用法代码示例。如果您正苦于以下问题:C# ActivityExecutionContext类的具体用法?C# ActivityExecutionContext怎么用?C# ActivityExecutionContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ActivityExecutionContext类属于命名空间,在下文中一共展示了ActivityExecutionContext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Execute

        protected override ActivityExecutionStatus Execute(ActivityExecutionContext executionContext)
        {
            string pageName = this.PageName;

            List<Page> userPages = DatabaseHelper.GetList<Page, Guid>(DatabaseHelper.SubsystemEnum.Page,
                this.UserGuid, LinqQueries.CompiledQuery_GetPagesByUserId);

            // Find the page that has the specified Page Name and make it as current
            // page. This is needed to make a tab as current tab when the tab name is
            // known
            if (!string.IsNullOrEmpty(pageName))
            {

                foreach (Page page in userPages)
                {
                    if (page.Title.Replace(' ', '_') == pageName)
                    {
                        this.CurrentPageId = page.ID;
                        this.CurrentPage = page;
                        break;
                    }
                }
            }

            // If there's no such page, then the first page user has will be the current
            // page. This happens when a page is deleted.
            if (this.CurrentPageId == 0)
            {
                this.CurrentPageId = userPages[0].ID;
                this.CurrentPage = userPages[0];
            }

            return ActivityExecutionStatus.Closed;
        }
开发者ID:modulexcite,项目名称:dropthings,代码行数:34,代码来源:DecideCurrentPageActivity.cs


示例2: Execute

        /// <summary>
        /// Called by the workflow runtime to execute an activity.
        /// </summary>
        /// <param name="executionContext">The <see cref="T:Mediachase.Commerce.WorkflowCompatibility.ActivityExecutionContext"/> to associate with this <see cref="T:Mediachase.Commerce.WorkflowCompatibility.Activity"/> and execution.</param>
        /// <returns>
        /// The <see cref="T:Mediachase.Commerce.WorkflowCompatibility.ActivityExecutionStatus"/> of the run task, which determines whether the activity remains in the executing state, or transitions to the closed state.
        /// </returns>
        protected override ActivityExecutionStatus Execute(ActivityExecutionContext executionContext)
        {
            try
            {
                // Check for multiple warehouses. In the default, we simply reject processing an order if the application has
                //  multiple warehouses. Any corresponding fulfillment process is the responsibility of the client.
                this.CheckMultiWarehouse();

                // Validate the properties at runtime
                this.ValidateRuntime();

                var orderForms = OrderGroup.OrderForms.Where(o => !OrderForm.IsReturnOrderForm(o));

                foreach (OrderForm orderForm in orderForms)
                {
                    foreach (Shipment shipment in orderForm.Shipments)
                    {
                        foreach (var lineItem in Shipment.GetShipmentLineItems(shipment))
                        {
                            AdjustStockItemQuantity(shipment, lineItem);
                        }
                    }
                }

                // Retun the closed status indicating that this activity is complete.
                return ActivityExecutionStatus.Closed;
            }
            catch
            {
                // An unhandled exception occured.  Throw it back to the WorkflowRuntime.
                throw;
            }
        }
开发者ID:valdisiljuconoks,项目名称:Ascend15,代码行数:40,代码来源:AdjustInstoreInventoryActivity.cs


示例3: DoExecute

        /// <summary>
        /// 执行根据DeliveryNo修改所有属于该DeliveryNo的Product状态的操作
        /// </summary>
        /// <param name="executionContext"></param>
        /// <returns></returns>
        protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
        {
            Product currentProduct = ((Product)CurrentSession.GetValue(Session.SessionKeys.Product));
            var productRepository = RepositoryFactory.GetInstance().GetRepository<IProductRepository, IProduct>();
            IDeliveryRepository deliveryRepository = RepositoryFactory.GetInstance().GetRepository<IDeliveryRepository, Delivery>();
            string unpackType = ((string)CurrentSession.GetValue(Session.SessionKeys.CN));
            bool isPallet = ((bool)CurrentSession.GetValue(Session.SessionKeys.Pallet));
            productRepository.BackUpProduct(currentProduct.ProId,this.Editor);

            ShipBoxDetInfo setValue = new ShipBoxDetInfo();
            ShipBoxDetInfo condition = new ShipBoxDetInfo();
            setValue.snoId = "";
            condition.snoId = currentProduct.ProId;

            deliveryRepository.UpdateShipBoxDetInfo(setValue, condition);

            if (unpackType == "ALL")
            {
                currentProduct.PizzaID = string.Empty;
                currentProduct.CartonSN = string.Empty;
            }
            currentProduct.PalletNo = string.Empty;
            if (!isPallet)
            {
                currentProduct.DeliveryNo = string.Empty;
            }
            currentProduct.CartonWeight = 0;
            currentProduct.UnitWeight = 0;

            productRepository.Update(currentProduct, CurrentSession.UnitOfWork);

            productRepository.BackUpProductStatus(currentProduct.ProId, this.Editor);

            return base.DoExecute(executionContext);
        }
开发者ID:wra222,项目名称:testgit,代码行数:40,代码来源:UnPackProductByDN.cs


示例4: DoExecute

        protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
        {
            var logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
            //logger.InfoFormat("GetProductActivity: Key: {0}", this.Key);
            var productRepository = RepositoryFactory.GetInstance().GetRepository<IProductRepository, IProduct>();
            //var currentProduct = productRepository.Find(this.Key);
            //var currentProductCustSN = productRepository.FindOneProductWithProductIDOrCustSN(this.Key);
            var product = productRepository.GetProductByCustomSn(this.Key);

            if (product == null)
            {
                List<string> errpara = new List<string>();

                errpara.Add(this.Key);

                throw new FisException("CHK152", errpara);
            }
            //logger.InfoFormat("GetProductActivity: IProduct Hash: {0}; IProduct Key: {1}", currentProduct.GetHashCode().ToString(), currentProduct.Key);
            
            CurrentSession.AddValue(Session.SessionKeys.CustSN, this.Key);
            //add by sheng-ju for FRU 20110907
            CurrentSession.AddValue(Session.SessionKeys.ProductIDOrCustSN,product.ProId);
            CurrentSession.AddValue(Session.SessionKeys.Product, product);

            //logger.InfoFormat("GetProductActivity: CurrentSession Hash: {0}; CurrentSession Key: {1}; CurrentSession Type: {2}", CurrentSession.GetHashCode().ToString(), CurrentSession.Key, CurrentSession.Type.ToString());
            
            return base.DoExecute(executionContext);
        }
开发者ID:wra222,项目名称:testgit,代码行数:28,代码来源:GetCustSN.cs


示例5: DoExecute

        /// <summary>
        /// Check RMN
        /// </summary>
        /// <param name="executionContext"></param>
        /// <returns></returns>
        protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
        {
            Product curProduct = (Product)CurrentSession.GetValue(Session.SessionKeys.Product);
            if (curProduct == null)
            {
                List<string> errpara = new List<string>();
                errpara.Add(this.Key);
                throw new FisException("SFC002", errpara);
            }

            // OfflinePizzaFamily : 是否需要Pizza Id及 PizzaID Label(不需要打印)
            IPartRepository partRepository = RepositoryFactory.GetInstance().GetRepository<IPartRepository, IPart>();
            string keyOfflinePizzaFamily = "OfflinePizzaFamily";

            string isOfflinePizzaFamily = "N";
            IList<ConstValueTypeInfo> lstCnst = partRepository.GetConstValueTypeList(keyOfflinePizzaFamily);
            foreach (ConstValueTypeInfo cv in lstCnst)
            {
                if (cv.value.Equals(curProduct.Family))
                {
                    isOfflinePizzaFamily = "Y";
                    break;
                }
            }

            CurrentSession.AddValue(keyOfflinePizzaFamily, isOfflinePizzaFamily);

            return base.DoExecute(executionContext);
        }
开发者ID:wra222,项目名称:testgit,代码行数:34,代码来源:CheckOfflinePizzaFamily.cs


示例6: Execute

		protected override ActivityExecutionStatus Execute (ActivityExecutionContext executionContext)
		{
			List <Activity> list = new List <Activity> ();
			Activity child = this;

			// Indicate that all children activites can be executed in paralell
			while (child != null) {
				//Console.WriteLine ("Child {0}", child);
				// TODO: if (IsBasedOnType (current, typeof (CompositeActivity))) {
				if (child.GetType ().BaseType == typeof (CompositeActivity)) {
					CompositeActivity composite = (CompositeActivity) child;
					foreach (Activity activity in composite.Activities) {
						list.Add (activity);
					}
				}

				if (list.Count == 0) {
					break;
				}

				child = list [0];
				child.ParallelParent = this;
				list.Remove (child);
			}

			foreach (Activity activity in Activities) {
				ActivitiesToExecute.Enqueue (activity);
			}

			NeedsExecution = false;
			return ActivityExecutionStatus.Closed;
		}
开发者ID:alesliehughes,项目名称:olive,代码行数:32,代码来源:ParallelActivity.cs


示例7: OnWorkflowChangesCompleted

        public virtual void OnWorkflowChangesCompleted(ActivityExecutionContext executionContext)
        {
            if (executionContext == null)
                throw new ArgumentNullException("executionContext");

            NextDynamicChangeExecutorInChain(executionContext.Activity).OnWorkflowChangesCompleted(executionContext);
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:7,代码来源:ActivityExecutionFilter.cs


示例8: DoExecute

        /// <summary>
        /// lightoff
        /// </summary>
        /// <param name="executionContext"></param>
        /// <returns></returns>
        protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
        {
            IFlatBOM curBom = (IFlatBOM)CurrentSession.GetValue(Session.SessionKeys.SessionBom);
            string stationDescr = CurrentSession.GetValue(Session.SessionKeys.StationDescr) as string;

            IFlatBOMItem curMatchBomItem = curBom.CurrentMatchedBomItem;
            if (curMatchBomItem != null && curMatchBomItem.CheckedPart != null && curMatchBomItem.CheckedPart.Count > 0 && curMatchBomItem.Qty == curMatchBomItem.CheckedPart.Count)
            {
                IList<WipBuffer> wipbuffers = (IList<WipBuffer>)CurrentSession.GetValue(Session.SessionKeys.PizzaKitWipBuffer);

                foreach (WipBuffer wipbufobj in wipbuffers)
                {
                    if (PartMatchWipBuffer(wipbufobj.PartNo, curMatchBomItem.AlterParts))
                    {

                        IPalletRepository pltRepository = RepositoryFactory.GetInstance().GetRepository<IPalletRepository, Pallet>();
                        IList<KittingLocPLMappingStInfo> kitlocstinfos = pltRepository.GetKitLocPLMapST(Line.Substring(0, 1), stationDescr, short.Parse(wipbufobj.LightNo));
                        if (kitlocstinfos != null && kitlocstinfos.Count > 0)
                        {
                            //only one
                            pltRepository.UpdateKitLocationFVOffDefered(CurrentSession.UnitOfWork, kitlocstinfos[0].tagID, false, true);
                        }

                        break;
                    }
                }

            }
            return base.DoExecute(executionContext);
        }
开发者ID:wra222,项目名称:testgit,代码行数:35,代码来源:LightOff.cs


示例9: DoExecute

        /// <summary>
        /// Get QCStatus of Product
        /// </summary>
        /// <param name="executionContext"></param>
        /// <returns></returns>
        /// 

        protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
        {
            var currentProduct = (IProduct)CurrentSession.GetValue(Session.SessionKeys.Product);
            List<string> errpara = new List<string>();
            string productID = currentProduct.ProId;

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

            //ProductLog 
            string[] tps = new string[1];
            tps[0] = "PIA2";
            string status = "EFI";  //exemption from inspection
            IList<ProductQCStatus> QCStatusList = new List<ProductQCStatus>();
            QCStatusList = productRepository.GetQCStatusOrderByCdtDesc(productID, tps);
            if (QCStatusList != null && QCStatusList.Count > 0)
            {
                foreach (ProductQCStatus qcStatus in QCStatusList)
                {
                    if (qcStatus.Remark == "1")
                    {
                        status = "EPIA";
                        break;
                    }
                }
            }
            CurrentSession.AddValue(Session.SessionKeys.QCStatus, status);
            return base.DoExecute(executionContext);
        }
开发者ID:wra222,项目名称:testgit,代码行数:35,代码来源:GetQCStatus.cs


示例10: Execute

 protected override ActivityExecutionStatus Execute(ActivityExecutionContext context)
 {
     // Create an Outlook Application object. 
     Outlook.Application outlookApp = new Outlook.Application();
     // Create a new TaskItem.
     Outlook.NoteItem newNote = (Outlook.NoteItem)outlookApp.CreateItem(Outlook.OlItemType.olNoteItem);
     // Configure the task at hand and save it.
     if (this.Parent.Parent is ParallelActivity)
     {
         newNote.Body = (this.Parent.Parent.Parent.Activities[1] as DummyActivity).TitleProperty;
         if ((this.Parent.Parent.Parent.Activities[1] as DummyActivity).TitleProperty != "")
         {
             MessageBox.Show("Creating Outlook Note");
             newNote.Save();
         }
     }
     else if (this.Parent.Parent is SequentialWorkflowActivity)
     {
         newNote.Body = (this.Parent.Parent.Activities[1] as DummyActivity).TitleProperty;
         if ((this.Parent.Parent.Activities[1] as DummyActivity).TitleProperty != "")
         {
             MessageBox.Show("Creating Outlook Note");
             newNote.Save();
         }
     }
     return ActivityExecutionStatus.Closed;
 }
开发者ID:ssickles,项目名称:archive,代码行数:27,代码来源:OutlookNote.cs


示例11: DoExecute

        /// <summary>
        /// 检查dn是否与机器结合了
        /// </summary>
        /// <param name="executionContext"></param>
        /// <returns></returns>
        protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
        {
            CurrentSession.AddValue(Session.SessionKeys.DNCombineProduct, false);
            var productRepository = RepositoryFactory.GetInstance().GetRepository<IProductRepository, IProduct>();
            string inputNo = (string)CurrentSession.GetValue(Session.SessionKeys.DeliveryNo);
            IList<IProduct> lstProduct = productRepository.GetProductListByDeliveryNo(inputNo);
            if (lstProduct != null && lstProduct.Count != 0)
            {
                CurrentSession.AddValue(Session.SessionKeys.DNCombineProduct, true);
                List<string> productIDList = new List<string>();
                List<string> cartonSNList = new List<string>();
                List<string> productCustSNList = new List<string>();
                foreach (var product in lstProduct)
                {
                    productIDList.Add(product.ProId);
                    cartonSNList.Add(product.CartonSN);
                    //collect customer sn
                    productCustSNList.Add(product.CUSTSN);

                    
                }
                CurrentSession.AddValue(Session.SessionKeys.NewScanedProductIDList, productIDList);
                CurrentSession.AddValue(Session.SessionKeys.CartonSNList, cartonSNList);
                CurrentSession.AddValue(Session.SessionKeys.NewScanedProductCustSNList, productCustSNList);
               
            }
           
            
            return base.DoExecute(executionContext);
        }
开发者ID:wra222,项目名称:testgit,代码行数:35,代码来源:CheckDNCombineProduct.cs


示例12: DoExecute

 /// <summary>
 /// 执行根据DeliveryNo修改所有属于该DeliveryNo的Product状态的操作
 /// </summary>
 /// <param name="executionContext"></param>
 /// <returns></returns>
 protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
 {
     IProduct defaultProduct = (IProduct)CurrentSession.GetValue(Session.SessionKeys.Product);
     string deliveryNo = defaultProduct.DeliveryNo;
     if (deliveryNo=="")
     {
        /* List<string> errpara = new List<string>();
         errpara.Add("no deliveryNo");
         throw new FisException("CHK107", errpara);*/
         return base.DoExecute(executionContext);
     }
     IDeliveryRepository DeliveryRepository = RepositoryFactory.GetInstance().GetRepository<IDeliveryRepository, Delivery>();
     Delivery CurrentDelivery = DeliveryRepository.Find(deliveryNo);
     if (CurrentDelivery == null)
     {
        /* List<string> errpara = new List<string>();
         errpara.Add(deliveryNo);
         throw new FisException("CHK107", errpara);*/
         return base.DoExecute(executionContext);
     }
     CurrentSession.AddValue(Session.SessionKeys.Delivery, CurrentDelivery);
     if (CurrentDelivery.Status == "98") {
         List<string> errpara = new List<string>();
         errpara.Add("已经上传SAP,不能Unpack!");
         throw new FisException("CHK290", errpara);
     }
     return base.DoExecute(executionContext);
 }
开发者ID:wra222,项目名称:testgit,代码行数:33,代码来源:UnPackCheckDnStatusBySn.cs


示例13: DoExecute

        /// <summary>
        /// 
        /// </summary>
        /// <param name="executionContext"></param>
        /// <returns></returns>
        protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
        {
            string data = (string)CurrentSession.GetValue("DeliveryNo");
            IPizzaRepository repPizza = RepositoryFactory.GetInstance().GetRepository<IPizzaRepository, Pizza>();
            bool flag = false;            
            flag = repPizza.CheckExistPakDashPakComnByInternalID(data.Substring(0,10));

            if (flag == true)
            {
                CurrentSession.AddValue(Session.SessionKeys.VCode, "DN");
                CurrentSession.AddValue(Session.SessionKeys.DeliveryNo, data.Substring(0, 10));
                return base.DoExecute(executionContext);                
            }
            
            flag = repPizza.CheckExistVShipmentPakComnByConsolInvoiceOrShipment(data);
            if (flag == true)
            {
                CurrentSession.AddValue(Session.SessionKeys.VCode, "Shipment");
                return base.DoExecute(executionContext);                
            }
            
            CurrentSession.AddValue(Session.SessionKeys.VCode, "Unknown");
            List<string> errpara = new List<string>();
            errpara.Add(data);
            FisException ex = new FisException("CHK277", errpara);
            //ex.stopWF = false;
            throw ex;

        }        
开发者ID:wra222,项目名称:testgit,代码行数:34,代码来源:CheckInputForScaningList.cs


示例14: DoExecute

        /// <summary>
        /// 用于Repair时修改Defect信息。
        /// </summary>
        /// <param name="executionContext"></param>
        /// <returns></returns>
        protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
        {
            IRepairTarget repairTarget = GetRepairTarget();
            //IProduct product = (IProduct)CurrentSession.GetValue(Session.SessionKeys.Product);
            //if (product != null)
            //{
            //    string value = (string)CurrentSession.GetValue(Session.SessionKeys.MAC);
            //    product.MAC = value;
            //}

            RepairDefect defect = (RepairDefect)CurrentSession.GetValue(Session.SessionKeys.CurrentRepairdefect);

            //Dean 20110530 因為PartType為Disable ,在新增時就要塞入PartType,來判斷是否回F0或40
            const string repairPartType = "";
            if (CurrentSession.GetValue(ExtendSession.SessionKeys.RepairPartType) != null)
            {
                defect.PartType = CurrentSession.GetValue(ExtendSession.SessionKeys.RepairPartType).ToString().Trim();
            }
            else
            {
                defect.PartType = repairPartType.Trim();
            }
            //Dean 20110530 因為PartType為Disable ,在新增時就要塞入PartType,來判斷是否回F0或40

            repairTarget.UpdateRepairDefect(defect.RepairID, defect);
            UpdateRepairTarget(repairTarget);

            return base.DoExecute(executionContext);
        }
开发者ID:wra222,项目名称:testgit,代码行数:34,代码来源:UpdateRepairDefect.cs


示例15: DoExecute

 /// <summary>
 /// 
 /// </summary>
 /// <param name="executionContext"></param>
 /// <returns></returns>
 protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
 {
     IMiscRepository miscRep = RepositoryFactory.GetInstance().GetRepository<IMiscRepository>();
     Session session = CurrentSession;
     IList<DefectComponentInfo> defectComponentInfoList = (IList<DefectComponentInfo>)session.GetValue("DefectComponentInfo");
     foreach (DefectComponentInfo item in defectComponentInfoList)
     {
         DefectComponentLogInfo saveItem = new DefectComponentLogInfo();
         saveItem.ActionName = ActionName;
         saveItem.ComponentID = item.ID;
         saveItem.RepairID = item.RepairID;
         saveItem.PartSn = item.PartSn;
         saveItem.Customer = item.Customer;
         saveItem.Model = item.Model;
         saveItem.Family = item.Family;
         saveItem.DefectCode = item.DefectCode;
         saveItem.DefectDescr = item.DefectDescr;
         saveItem.ReturnLine = item.ReturnLine;
         saveItem.Remark = "";
         saveItem.BatchID = item.BatchID;
         saveItem.Comment = item.Comment;
         saveItem.Status = item.Status;
         saveItem.Editor = this.Editor;
         saveItem.Cdt = DateTime.Now;
         miscRep.InsertDataWithIDDefered<DefectComponentLog, DefectComponentLogInfo>(session.UnitOfWork,saveItem);
     }
     return base.DoExecute(executionContext);
 }
开发者ID:wra222,项目名称:testgit,代码行数:33,代码来源:WriteDefectComponentLog.cs


示例16: DoExecute

        /// <summary>
        /// 检查ECR是否存在
        /// </summary>
        /// <param name="executionContext"></param>
        /// <returns></returns>
        protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
        {
            MB currenMB = CurrentSession.GetValue(Session.SessionKeys.MB) as MB;
            IPartRepository CurrentPartRepository = RepositoryFactory.GetInstance().GetRepository<IPartRepository, IPart>();
            
            IPart currentPart = CurrentPartRepository.Find(currenMB.Model);
            IEcrVersionRepository CurrentRepository = RepositoryFactory.GetInstance().GetRepository<IEcrVersionRepository, EcrVersion>();
            if (currentPart ==null ||currentPart.Descr == null)
            {
                throw new FisException("CHK223", new string[] { currenMB.Sn });
            }
            else {
                CurrentSession.AddValue(Session.SessionKeys.FamilyName, currentPart.Descr);
            }
            string ecr = CurrentSession.GetValue(Session.SessionKeys.ECR) as string;

            IList<EcrVersion> ECRList = CurrentRepository.GetECRVersionByFamilyMBCodeAndECR(currentPart.Descr, currenMB.MBCode, ecr);
            if (ECRList == null || ECRList.Count == 0)
            {
                throw new FisException("ICT001", new string[] { currenMB.Sn });
            }
            else {
                CurrentSession.AddValue(Session.SessionKeys.IECVersion, ECRList[0].IECVer);
            }

             CurrentSession.AddValue(Session.SessionKeys.PrintLogName,"ECR Label");
             CurrentSession.AddValue(Session.SessionKeys.PrintLogBegNo, currenMB.Sn);
             CurrentSession.AddValue(Session.SessionKeys.PrintLogEndNo, currenMB.Sn);
             CurrentSession.AddValue(Session.SessionKeys.PrintLogDescr,Line+" "+currenMB.PCBModelID);
                               
            return base.DoExecute(executionContext);
        }
开发者ID:wra222,项目名称:testgit,代码行数:37,代码来源:CheckECR.cs


示例17: DoExecute

        /// <summary>
        /// Get Pallet Object and put it into Session.SessionKeys.Pallet
        /// </summary>
        /// <param name="executionContext"></param>
        /// <returns></returns>
        protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
        {

            string palletNo = (string)CurrentSession.GetValue(Session.SessionKeys.PalletNo);
            IDeliveryRepository DeliveryRepository = RepositoryFactory.GetInstance().GetRepository<IDeliveryRepository, Delivery>();
            IProductRepository ProductRepository = RepositoryFactory.GetInstance().GetRepository<IProductRepository, IProduct>();
            List<string> erpara = new List<string>();
            FisException ex;

            int qty= DeliveryRepository.GetSumofDeliveryQtyFromDeliveryPallet( palletNo);
            int qty1 = ProductRepository.GetFactCartonQtyByPalletNo(palletNo);
            if (qty != qty1)
            {
                erpara.Add(palletNo);
                ex = new FisException("CHK878", erpara);
                throw ex;
            }
            IList<IProduct> prodList = ProductRepository.GetProductListByPalletNo2(palletNo);
            if (prodList.Count > 0)
            {
                CurrentSession.AddValue(Session.SessionKeys.Product, prodList[0]);
            }
            else
            {
                erpara.Add(palletNo);
                ex = new FisException("CHK878", erpara);
                throw ex;
            }
            //CurrentSession.AddValue(Session.SessionKeys.PalletQty, qty);
            //CurrentSession.AddValue(Session.SessionKeys.PalletNo, palletNo);
            return base.DoExecute(executionContext);
        }
开发者ID:wra222,项目名称:testgit,代码行数:37,代码来源:CheckPalletForPalletVerifyReprint.cs


示例18: DoExecute

        protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
        {
            var logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
            var palletRepository = RepositoryFactory.GetInstance().GetRepository<IPalletRepository, Pallet>();
            IList<PickIDCtrlInfo> lstPickIDCtrlInfo = palletRepository.GetPickIDCtrlInfoByPickID(Key);
            PickIDCtrlInfo pickIDCtrlInfo;

            if (lstPickIDCtrlInfo == null || lstPickIDCtrlInfo.Count == 0)
            {
                List<string> errpara = new List<string>();
                errpara.Add(this.Key);
                throw new FisException("CHK149", errpara);
            }

            pickIDCtrlInfo = lstPickIDCtrlInfo[0];
            //ITC-1268-0052 Tong.Zhi-Yong 2011-04-14
            lstPickIDCtrlInfo = palletRepository.GetPickIDCtrlInfoByPickIDAndDate(Key, DateTime.Now);

            if (lstPickIDCtrlInfo != null && lstPickIDCtrlInfo.Count != 0)
            {
                pickIDCtrlInfo = lstPickIDCtrlInfo[0];
            }

            CurrentSession.AddValue(Session.SessionKeys.PickIDCtrl, pickIDCtrlInfo);

            return base.DoExecute(executionContext);
        }
开发者ID:wra222,项目名称:testgit,代码行数:27,代码来源:GetPickIDCtrlByPickID.cs


示例19: Execute

        protected override ActivityExecutionStatus Execute(ActivityExecutionContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            ExternalRuleSetService.ExternalRuleSetService ruleSetService = context.GetService<ExternalRuleSetService.ExternalRuleSetService>();

            if (ruleSetService != null)
            {
                RuleSet ruleSet = ruleSetService.GetRuleSet(new RuleSetInfo(this.RuleSetName, this.MajorVersion, this.MinorVersion));
                if (ruleSet != null)
                {
                    Activity targetActivity = this.GetRootWorkflow(this.Parent);
                    RuleValidation validation = new RuleValidation(targetActivity.GetType(), null);
                    RuleExecution execution = new RuleExecution(validation, targetActivity, context);
                    ruleSet.Execute(execution);
                }
            }
            else
            {
                throw new InvalidOperationException("A RuleSetService must be configured on the host to use the PolicyFromService activity.");
            }

            return ActivityExecutionStatus.Closed;
        }
开发者ID:spzenk,项目名称:sfdocsamples,代码行数:27,代码来源:PolicyFromService.cs


示例20: Execute

	      	//protected override ActivityExecutionStatus Cancel(ActivityExecutionContext executionContext)

	      	protected override ActivityExecutionStatus Execute (ActivityExecutionContext executionContext)
	      	{
	      		bool condition_true = false;

			foreach (IfElseBranchActivity activity in Activities) {

				if (activity == null || activity.Condition == null)
					continue;

				if (activity.Condition.Evaluate (this, executionContext) == true) {
					condition_true = true;
					break;
				}
			}

			if (Activities.Count > 1) {
				if (condition_true == true) {
					ActivitiesToExecute.Enqueue (Activities[0]);
				} else {
					ActivitiesToExecute.Enqueue (Activities[1]);
				}
			}

			NeedsExecution = false;
			return ActivityExecutionStatus.Closed;
	      	}
开发者ID:alesliehughes,项目名称:olive,代码行数:28,代码来源:IfElseActivity.cs



注:本文中的ActivityExecutionContext类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ActivityExecutor类代码示例发布时间:2022-05-24
下一篇:
C# ActivityContext类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap