当前位置: 首页>>代码示例>>C#>>正文


C# Session.GetValue方法代码示例

本文整理汇总了C#中Session.GetValue方法的典型用法代码示例。如果您正苦于以下问题:C# Session.GetValue方法的具体用法?C# Session.GetValue怎么用?C# Session.GetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Session的用法示例。


在下文中一共展示了Session.GetValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Execute

        /// <summary>
        /// 
        /// </summary>
        /// <param name="workflowName"></param>
        /// <param name="session"></param>
        /// <param name="key"></param>
        /// <param name="line"></param>
        /// <param name="editor"></param>
        /// <param name="customer"></param>
        public static void Execute(string workflowName, Session session, string key, string line, string editor, string customer)
        {
            string methodName = "HandleRollBackExecute";
            logger.DebugFormat("BEGIN: {0}()", methodName);
            try
            {
                if (session == null)
                {
                    return;
                }
                //if (workflowName== "CombineCartonInDN" ||
                //    workflowName == "CombineCartonInDN_BIRCH"||
                //    workflowName == "CombineCartonInDN_JR"||
                //    workflowName == "CombineCartonInDN_Skoda") 
                if (workflowName.StartsWith("CombineCartonInDN") ||
                    workflowName.StartsWith("CombineCartonInPO")) //Tablet Combine Carton In Delivery
                {
                    Carton carton = (Carton)session.GetValue(Session.SessionKeys.Carton);
                    if (carton != null)
                    {
                        //ICartonRepository cartonRep = RepositoryFactory.GetInstance().GetRepository<ICartonRepository, Carton>();
                       // IDeliveryRepository deliveryRep = RepositoryFactory.GetInstance().GetRepository<IDeliveryRepository, Delivery>();
                        cartonRep.RollBackAssignCarton(carton.CartonSN, editor);
                        deliveryRep.RollBackAssignBoxId(carton.CartonSN);
                    }
                }
                else if (workflowName == "PalletVerifyAndAssignDN")  //handle Delivery_Pallet to H->'0'
                {

                    IList<DeliveryPallet> sapDPList = (IList<DeliveryPallet>)session.GetValue(Session.SessionKeys.SAPDeliveryPalletList);
                    if (sapDPList != null && sapDPList.Count > 0)
                    {
                        IDeliveryRepository deliveryRep = RepositoryFactory.GetInstance().GetRepository<IDeliveryRepository, Delivery>();
                        foreach (DeliveryPallet item in sapDPList)
                        {
                            deliveryRep.UpdateDeliveryPalletInfo(new DeliveryPalletInfo { status = "0" },
                            new DeliveryPalletInfo { id = item.ID });
                        }
                    }
                }
            }
            catch (Exception e)
            {
                logger.Error(e.Message, e);
            }
            finally
            {
                logger.DebugFormat("END: {0}()", methodName);
            }
        }
开发者ID:wra222,项目名称:testgit,代码行数:59,代码来源:HandleRollBack.cs

示例2: DismantleBatch

        /// <summary>
        /// DismantleBatch
        /// </summary>
        /// <param name="snorproidlist"></param>
        /// <param name="sDismantleType"></param>
        /// <param name="sKeyparts"></param>
        /// <param name="sReturnStation"></param>
        /// <param name="line"></param>
        /// <param name="pCode"></param>
        /// <param name="editor"></param>
        /// <param name="station"></param>
        /// <param name="customer"></param>
        public void DismantleBatch(IList<string> snorproidlist, string sDismantleType, string sKeyparts, string sReturnStation, string line, string pCode, string editor, string station, string customer)
        {
            logger.Debug("(DismantleFA)DismantleBatch start,"
                      + " [line]:" + line
                      + " [editor]:" + editor
                      + " [station]:" + station
                      + " [customer]:" + customer);
            FisException ex;
            //IList<string> retLst = null;
            List<string> erpara = new List<string>();
            string snorproid = "";
            try
            {
                for (int i = 0; i < snorproidlist.Count; i++)
                {
                    snorproid = snorproidlist[i];
                    //snorproid = snorproidlist[0];
                    var currentProduct = CommonImpl.GetProductByInput(snorproid, CommonImpl.InputTypeEnum.ProductIDOrCustSN);
                    string sessionKey = currentProduct.ProId;
                    Session sessionInfo = SessionManager.GetInstance.GetSession(sessionKey, theType);

                    if (sessionInfo == null)
                    {
                        sessionInfo = new Session(sessionKey, theType, editor, station, line, customer);

                        Dictionary<string, object> wfArguments = new Dictionary<string, object>();

                        wfArguments.Add("Key", sessionKey);
                        wfArguments.Add("Station", station);
                        wfArguments.Add("Editor", editor);
                        wfArguments.Add("PdLine", line);
                        wfArguments.Add("Customer", customer);
                        wfArguments.Add("CurrentFlowSession", sessionInfo);
                        wfArguments.Add("SessionType", theType);


                        sessionInfo.AddValue(Session.SessionKeys.Product, currentProduct);
                        //sessionInfo.AddValue(Session.SessionKeys.PCode, pCode);
                        if (sDismantleType.ToUpper().Trim() == "KP")
                        {
                            sessionInfo.AddValue(Session.SessionKeys.ReturnStation, sReturnStation);
                            sessionInfo.AddValue(Session.SessionKeys.KPType, sKeyparts);
                        }
                        sessionInfo.AddValue("Dismantletype", sDismantleType.ToUpper());
                        sessionInfo.AddValue(Session.SessionKeys.Carton, currentProduct.CartonSN);
                        sessionInfo.AddValue(Session.SessionKeys.PalletNo, currentProduct.PalletNo);
                        sessionInfo.AddValue(Session.SessionKeys.DeliveryNo, currentProduct.DeliveryNo);
                        string getv = (string)sessionInfo.GetValue("Dismantletype");


                        string wfName, rlName;
                        RouteManagementUtils.GetWorkflow(station, "FADismantle.xoml", "fadismantle.rules", out wfName, out rlName);
                        WorkflowInstance instance = WorkflowRuntimeManager.getInstance.CreateXomlFisWorkflow(wfName, rlName, wfArguments);
                        sessionInfo.SetInstance(instance);


                        if (!SessionManager.GetInstance.AddSession(sessionInfo))
                        {
                            sessionInfo.WorkflowInstance.Terminate("Session:" + sessionKey + " Exists.");
                            erpara.Add(sessionKey);
                            ex = new FisException("CHK020", erpara);
                            throw ex;
                        }
                        sessionInfo.WorkflowInstance.Start();
                        sessionInfo.SetHostWaitOne();

                    }
                    /*
                    else
                    {
                        erpara.Add(sessionKey);
                        ex = new FisException("CHK020", erpara);
                        throw ex;
                    }
                    */
                    //check workflow exception
                    if (sessionInfo.Exception != null)
                    {
                        if (sessionInfo.GetValue(Session.SessionKeys.WFTerminated) != null)
                        {
                            sessionInfo.ResumeWorkFlow();
                        }
                        throw sessionInfo.Exception;
                    }
                }
            }
            catch (FisException e)
            {
//.........这里部分代码省略.........
开发者ID:wra222,项目名称:testgit,代码行数:101,代码来源:FADismantle.cs

示例3: SwitchToWF

        /// <summary>
        /// time out for SwitchToWF
        /// </summary>
        /// <param name="session"></param>
        /// <param name="sessionKeyValue"></param>
        /// <param name="timeout">Second unit</param>
        /// <returns></returns>
        public static Session SwitchToWF(Session session,
                                                           Dictionary<string, object> sessionKeyValue,
                                                           int timeout)
        {
            if (session == null)
            {
                throw new Exception("No Session !!");
            }

            if (sessionKeyValue != null)
            {
                foreach (KeyValuePair<string, object> item in sessionKeyValue)
                {
                    session.AddValue(item.Key, item.Value);
                }
            }
            bool hasTimeOut = false;
            session.Exception = null;
            DateTime now = DateTime.Now;
            hasTimeOut =!session.SwitchToWorkFlow(timeout*1000);
            if (hasTimeOut)
            {
                throw new Exception(string.Format("[TimeOut] SessionKey:{0} Line:{1} Editor:{2} Station:{3} TimeOut:{4} Cdt:{5} waiting wf timeout!!!",
                                                                      session.Key, session.Line??"",session.Editor??"", session.Station, timeout.ToString(), now.ToString("yyyyMMdd HH:mm:ss.fff")));
            }
            else
            {
                if (session.Exception != null)
                {
                    if (session.GetValue(Session.SessionKeys.WFTerminated) != null)
                    {
                        session.ResumeWorkFlow();
                    }
                    throw session.Exception;
                }
            }

            return session;
        }
开发者ID:wra222,项目名称:testgit,代码行数:46,代码来源:WorkflowUtility.cs

示例4: UpdateDeliveryStatus

        /// <summary>
        /// IMES_PAK..Delivery.Status = '87'
        /// </summary>
        /// <param name="line">line</param>
        /// <param name="editor">editor</param>
        /// <param name="station">station</param>
        /// <param name="customer">customer</param>
        /// <param name="DN">DN</param>
        /// <param name="custSN">custSN</param>
        /// <param name="coaSN">coaSN</param>
        public string UpdateDeliveryStatus(string line, string editor, string station, string customer, string DN, string custSN, string coaSN)
        {
            string keyStr = "";
            try
            {
                if (null == line)
                {
                    line = "";
                }
                if (null == station)
                {
                    station = "";
                }
                if (null == editor)
                {
                    editor = "";
                }
                if (null == customer)
                {
                    customer = "";
                }
                var currentProduct = CommonImpl.GetProductByInput(custSN, CommonImpl.InputTypeEnum.CustSN);
                if (null == currentProduct)
                {
                    List<string> errpara = new List<string>();

                    errpara.Add(custSN);
                    throw new FisException("SFC002", errpara);
                }
                Delivery reDelivery = currentRepository.Find(DN);

                S_RowData_Product productInfo = GetProductOnly(custSN);
                string sessionKey = custSN;
                keyStr = sessionKey;
                Session currentSession = new Session(sessionKey, SessionType, editor, station, line, customer);
                Dictionary<string, object> wfArguments = new Dictionary<string, object>();
                wfArguments.Add("Key", sessionKey);
                wfArguments.Add("Station", station);
                wfArguments.Add("CurrentFlowSession", currentSession);
                wfArguments.Add("Editor", editor);
                wfArguments.Add("PdLine", line);
                wfArguments.Add("Customer", customer);
                wfArguments.Add("SessionType", SessionType);

                string wfName, rlName;
                RouteManagementUtils.GetWorkflow(station, "CombineCOAandDN.xoml", "combinecoaanddn.rules", out wfName, out rlName);
                WorkflowInstance instance = WorkflowRuntimeManager.getInstance.CreateXomlFisWorkflow(wfName, rlName, wfArguments);
                currentSession.AddValue(Session.SessionKeys.COASN, coaSN);
                if (currentProduct.IsBT)
                {
                    currentSession.AddValue(Session.SessionKeys.IsBT, true);
                }
                else
                {
                    currentSession.AddValue(Session.SessionKeys.IsBT, false);
                }
                if (productInfo.isCDSI == "true")
                {
                    currentSession.AddValue(Session.SessionKeys.Pno, productInfo.isFactoryPo);
                }
                currentSession.AddValue(Session.SessionKeys.CustSN, custSN);
                currentSession.AddValue(Session.SessionKeys.DeliveryNo, DN);
                currentSession.AddValue(Session.SessionKeys.Product, currentProduct);
                currentSession.AddValue(Session.SessionKeys.Delivery, reDelivery);
                currentSession.AddValue(Session.SessionKeys.ReturnStation, "1");
                currentSession.AddValue(Session.SessionKeys.IsComplete, true);
                string QCIs = "false";
                currentSession.SetInstance(instance);
                if (!SessionManager.GetInstance.AddSession(currentSession))
                {
                    currentSession.WorkflowInstance.Terminate("Session:" + sessionKey + " Exists.");

                }
                currentSession.WorkflowInstance.Start();
                currentSession.SetHostWaitOne();
                if (currentSession.Exception != null)
                {
                    if (currentSession.GetValue(Session.SessionKeys.WFTerminated) != null)
                    {
                        currentSession.ResumeWorkFlow();
                    }

                    throw currentSession.Exception;
                }
                string DNTemp = (string)currentSession.GetValue(Session.SessionKeys.DeliveryNo);
                logger.Debug("(_CombineCOAandDN)UpdateDeliveryStatus DNTemp:" + DNTemp);
                logger.Debug("(_CombineCOAandDN)UpdateDeliveryStatus DN:" + DN);
                if (DN != DNTemp)
                {
                    QCIs = QCIs + "#@$#" + DNTemp;
//.........这里部分代码省略.........
开发者ID:wra222,项目名称:testgit,代码行数:101,代码来源:CombineCOAandDN.cs

示例5: GetCheckItemTypeRule

        private IList<CheckItemTypeRuleDef> GetCheckItemTypeRule(Session session)
        {
            var bomRepository = RepositoryFactory.GetInstance().GetRepository<IBOMRepository>();
            IList<CheckItemTypeRuleDef> _lstChkItemRule = null;
            string line = session.Line;
            if (line.Length > 1)
            {
                line = line.Substring(0, 1);
            }
            string model = (string)session.GetValue(Session.SessionKeys.ModelName);
            if (string.IsNullOrEmpty(model))
            {
                IProduct currentProduct = session.GetValue(Session.SessionKeys.Product) as IProduct;
                if (currentProduct != null)
                {
                    model = currentProduct.Model;
                }
            }
            string family = (string)session.GetValue(Session.SessionKeys.FamilyName);
            if (string.IsNullOrEmpty(family))
            {
                if (!string.IsNullOrEmpty(model))
                {
                    IModelRepository modelRep = RepositoryFactory.GetInstance().GetRepository<IModelRepository, Model>();
                    family = modelRep.Find(model).FamilyName;
                }

            }

            IList<CheckItemTypeRuleDef> lst =
                bomRepository.GetCheckItemTypeRuleWithPriority(part_check_type, line, session.Station, family);
            if (lst.Count > 0)
            {
                var min = lst.Select(p => p.Priority).Min();
                _lstChkItemRule = lst.Where(p => p.Priority == min).ToList();
            }
            return _lstChkItemRule;
        }
开发者ID:wra222,项目名称:testgit,代码行数:38,代码来源:Filter.cs

示例6: AssignAllNew

        public ArrayList AssignAllNew(string custSN, string line, string code, string floor,
                                                 string editor, string station, string customer, string DN)
        {
            string keyStr = "";
            string prodId = "";
            ArrayList arrRet = new ArrayList();
            try
            {
                var currentProduct = CommonImpl.GetProductByInput(custSN, CommonImpl.InputTypeEnum.CustSN);
                if (null == currentProduct)
                {
                    List<string> err = new List<string>();
                    err.Add(custSN);
                    throw new FisException("SFC002", err);
                }
                prodId = currentProduct.ProId;
                string sessionKey = custSN;
                keyStr = sessionKey;
                Session currentSession = new Session(sessionKey, SessionType, editor, station, line, customer);
                Dictionary<string, object> wfArguments = new Dictionary<string, object>();
                wfArguments.Add("Key", sessionKey);
                wfArguments.Add("Station", station);
                wfArguments.Add("CurrentFlowSession", currentSession);
                wfArguments.Add("Editor", editor);
                wfArguments.Add("PdLine", line);
                wfArguments.Add("Customer", customer);
                wfArguments.Add("SessionType", SessionType);

                string wfName, rlName;
                RouteManagementUtils.GetWorkflow(station, "CombineDNPalletforBT.xoml", "CombineDNPalletforBT.rules", out wfName, out rlName);
                WorkflowInstance instance = WorkflowRuntimeManager.getInstance.CreateXomlFisWorkflow(wfName, rlName, wfArguments);
                currentSession.AddValue(Session.SessionKeys.CustSN, custSN);
                currentSession.AddValue(Session.SessionKeys.IsComplete, false);
                currentSession.AddValue(Session.SessionKeys.Floor, floor);
                currentSession.AddValue(Session.SessionKeys.MBCode, code);
                currentSession.AddValue(Session.SessionKeys.DeliveryNo, DN);
                currentSession.AddValue(Session.SessionKeys.Product, currentProduct);
                if (DN == "")
                {
                    //auto is true
                    currentSession.AddValue(Session.SessionKeys.ifElseBranch, true);
                }
                else
                {
                    currentSession.AddValue(Session.SessionKeys.ifElseBranch, false);
                }


                currentSession.SetInstance(instance);

                if (!SessionManager.GetInstance.AddSession(currentSession))
                {
                    currentSession.WorkflowInstance.Terminate("Session:" + sessionKey + " Exists.");
                    FisException ex;
                    List<string> erpara = new List<string>();
                    erpara.Add(sessionKey);
                    ex = new FisException("CHK020", erpara);
                    throw ex;
                }


             

                currentSession.WorkflowInstance.Start();
                currentSession.SetHostWaitOne();
             

                if (currentSession.Exception != null)
                {
                    if (currentSession.GetValue(Session.SessionKeys.WFTerminated) != null)
                    {
                        currentSession.ResumeWorkFlow();
                    }

                    throw currentSession.Exception;
                }
                string temp = "";
                Delivery thisDelivery = (Delivery)currentSession.GetValue(Session.SessionKeys.Delivery);
                if (thisDelivery != null)
                {
                    temp = thisDelivery.DeliveryNo;
                }
                //Get Pallet
                Pallet pallet = (Pallet)currentSession.GetValue(Session.SessionKeys.Pallet);
                int q1 = palletRep.GetCountOfBoundProduct(pallet.PalletNo);
                int q2 = currentRepository.GetSumDeliveryQtyOfACertainPallet(pallet.PalletNo);
                //Get Pallet

                S_RowData_DN ele = new S_RowData_DN();
                ele.DeliveryNO = thisDelivery.DeliveryNo;
                ele.Model = thisDelivery.ModelName;
                ele.CustomerPN = currentRepository.GetDeliveryInfoValue(thisDelivery.DeliveryNo, "PartNo");
                ele.PoNo = thisDelivery.PoNo;
                ele.Date = thisDelivery.ShipDate.ToString("yyyy/MM/dd ");
                ele.Qty = thisDelivery.Qty.ToString();
                IList<IProduct> productList = new List<IProduct>();
                productList = productRepository.GetProductListByDeliveryNo(thisDelivery.DeliveryNo);
                if (null != productList)
                {
                    ele.PackedQty = productList.Count.ToString();
//.........这里部分代码省略.........
开发者ID:wra222,项目名称:testgit,代码行数:101,代码来源:CombineDNPalletforBT.cs

示例7: PrintUtility

        /// <summary>
        /// constructure
        /// </summary>
        /// <param name="session">session object</param>       
        /// <param name="modelName"> model name</param>
        /// <param name="moNo">MO Id</param>
        /// <param name="dnNo">Delivery No</param>
        /// <param name="partNo">Part No</param>
        /// <param name="customer">Customer</param>
        public PrintUtility(Session session, 
                                  string modelName, string moNo,
                                  string dnNo, string partNo, 
                                  string customer)
        {
            _session = session;
            _product =session.GetValue(Session.SessionKeys.Product) as Product;
            _mb = session.GetValue(Session.SessionKeys.MB) as MB;

            if (_product != null)
            {
                _customer = _product.Customer;
                if (string.IsNullOrEmpty(modelName) ||
                   modelName == _product.Model)
                {
                    modelName = _product.Model;
                    _model = _product.ModelObj;
                }               

                if (string.IsNullOrEmpty(moNo))
                {
                    moNo = _product.MO;
                }

                if (string.IsNullOrEmpty(dnNo))
                {
                    dnNo = _product.DeliveryNo;
                }

                //if (!string.IsNullOrEmpty(dnNo))
                //    _delivery = dnRep.Find(dnNo);
            }
            else if (_mb != null)
            {
                _customer = _mb.Customer;
                if (string.IsNullOrEmpty(modelName) &&
                    !string.IsNullOrEmpty(_mb.MB1397))
                {
                    modelName = _mb.MB1397;
                    _model = _mb.Model1397Obj;
                }

                if (string.IsNullOrEmpty(moNo))
                {
                    moNo = _mb.SMTMO;
                }
               

                if (string.IsNullOrEmpty(dnNo))
                {
                    dnNo = _mb.DeliveryNo;
                }

                //if (!string.IsNullOrEmpty(dnNo))
                //    _delivery = dnRep.Find(dnNo);

                if (string.IsNullOrEmpty(partNo))
                {
                    partNo = _mb.Model;
                }
            }

            _moNo = moNo;
            _modelName= modelName;
            _dnNo = dnNo;
            _partNo = partNo;

            if(string.IsNullOrEmpty(_customer))
            {
                _customer = customer;
            }            

            if(!string.IsNullOrEmpty(partNo))
            {
                _part =partRep.Find(partNo);
            }

            if (_model == null && !string.IsNullOrEmpty(_modelName))
            {
               _model= modelRep.Find(_modelName);
            }

            if (_delivery == null && !string.IsNullOrEmpty(_dnNo))
            {
                _delivery = dnRep.Find(_dnNo);
            }

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

示例8: Dn

        /// <summary>
        /// Dn
        /// </summary>
        private string Dn(Session session)
        {           
            switch (DnFrom)
            {
                case DnFromEnum.DeliveryNo:
                    return session.GetValue(Session.SessionKeys.DeliveryNo) as string;

                case DnFromEnum.Delivery:
                    Delivery currentDelivery = session.GetValue(Session.SessionKeys.Delivery) as Delivery;
                    if (currentDelivery == null)
                    {
                        return "";
                    }
                    else {
                        return currentDelivery.DeliveryNo;
                    }
                    //return CurrentSession.GetValue(Session.SessionKeys.Delivery) == null ? 
                    //    "" : (CurrentSession.GetValue(Session.SessionKeys.Delivery) as Delivery).DeliveryNo;
                case DnFromEnum.Product:
                    Product currentProduct = session.GetValue(Session.SessionKeys.Product) as Product;
                    if (currentProduct == null)
                    {
                        return "";
                    }
                    else
                    {
                        return currentProduct.DeliveryNo;
                    }

                default:
                    return "";
            }           
        }
开发者ID:wra222,项目名称:testgit,代码行数:36,代码来源:Print.cs

示例9: PartNo

 /// <summary>
 /// PartNo
 /// </summary>
 private string PartNo(Session session)
 {           
     switch (PartNoFrom)
     {
         case PartNoFromEnum.PartNo:
             return session.GetValue(Session.SessionKeys.PartNo) as string;
         case PartNoFromEnum.MB_Model:
             MB currentMB = session.GetValue(Session.SessionKeys.MB) as MB;
             if (currentMB == null)
             {
                 return "";
             }
             else
             {
                 return currentMB.Model;
             }
         default:
             return "";
     }            
 }
开发者ID:wra222,项目名称:testgit,代码行数:23,代码来源:Print.cs

示例10: InputProdId

        //public void InputProdId(string floor, string pdLine, string prodId, string editor, string stationId, string customerId)
        public ArrayList InputProdId(string floor, string pdLine, string customerSn, string editor, string stationId, string customerId, string pre_model)
        {
            logger.Debug("(_AssignWHLocation)InputProdId start, floor:" + floor + " pdLine:" + pdLine + " customerSn:" + customerSn + " editor:" + editor + " stationId:" + stationId + " customerId:" + customerId);
            ArrayList this_array_list_return = new ArrayList();
            FisException ex;
            List<string> erpara = new List<string>();
            //string sessionKey = prodId;
            try
            {
                var currentProduct = CommonImpl.GetProductByInput(customerSn, CommonImpl.InputTypeEnum.CustSN);
                if (currentProduct.ProId == "")
                {
                    throw new FisException("CHK020", new string[] { customerSn });
                }

                if ((pre_model.Length > 0) && (currentProduct.Model != pre_model))
                {
                    throw new FisException("CHK252", new string[] { });
                }

                string sessionKey = currentProduct.ProId;
                string this_model = currentProduct.Model;
                string this_line = currentProduct.Status.Line;
                Session Session = SessionManager.GetInstance.GetSession(sessionKey, TheType);

                
                if (Session == null)
                {
                    Session = new Session(sessionKey, TheType, editor, stationId, pdLine, customerId);

                    Dictionary<string, object> wfArguments = new Dictionary<string, object>();

                    wfArguments.Add("Key", sessionKey); // key must be prodId.
                    wfArguments.Add("Station", stationId);
                    wfArguments.Add("CurrentFlowSession", Session);
                    wfArguments.Add("Editor", editor);
                    wfArguments.Add("PdLine", pdLine);
                    wfArguments.Add("Customer", customerId);
                    wfArguments.Add("SessionType", TheType);
                    string wfName, rlName;
                    RouteManagementUtils.GetWorkflow(stationId, "AssignWHLocation.xoml", null, out wfName, out rlName);
                    WorkflowInstance instance = WorkflowRuntimeManager.getInstance.CreateXomlFisWorkflow(wfName, rlName, wfArguments);

                    Session.AddValue("_product_line", this_line);
                    Session.AddValue(Session.SessionKeys.Floor, floor);
                    Session.SetInstance(instance);

                    if (!SessionManager.GetInstance.AddSession(Session))
                    {
                        Session.WorkflowInstance.Terminate("Session:" + sessionKey + " Exists.");
                        erpara.Add(sessionKey);
                        ex = new FisException("CHK020", erpara);
                        throw ex;
                    }


                    //Release The XXX: 2012.04.24 LiuDong
                    try
                    {
                        Session.WorkflowInstance.Start();
                        Session.SetHostWaitOne();
                    }
                    finally
                    {
                        IProductRepository productRepository = RepositoryFactory.GetInstance().GetRepository<IProductRepository, IProduct>();
                        productRepository.ReleaseLockByTransThread("BTLoc", (Guid)Session.GetValue<Guid>(Session.SessionKeys.lockToken_Loc));
                    }
                    //Release The XXX: 2012.04.24 LiuDong


                }
                else
                {
                    erpara.Add(sessionKey);
                    ex = new FisException("CHK020", erpara);
                    throw ex;
                }
                               
                //check workflow exception
                if (Session.Exception != null)
                {
                    if (Session.GetValue(Session.SessionKeys.WFTerminated) != null)
                    {
                        Session.ResumeWorkFlow();
                    }
                    throw Session.Exception;
                }

                //if (hasDealWithOneFKU == false) hasDealWithOneFKU = true;
                this_array_list_return.Add(customerSn); // customerId
                this_array_list_return.Add(sessionKey); // ProdId
                this_array_list_return.Add(this_model); // model
                PakBtLocMasInfo CurrentLocation = (PakBtLocMasInfo)Session.GetValue(Session.SessionKeys.WHLocationObj);
                this_array_list_return.Add(CurrentLocation.snoId);
                //this_array_list_return.Add(CurrentLocation.cmbQty);//locQty);

                var currentRepository = RepositoryFactory.GetInstance().GetRepository<IPalletRepository, Pallet>();
                SnoDetBtLocInfo condition = new SnoDetBtLocInfo();
                /*
//.........这里部分代码省略.........
开发者ID:wra222,项目名称:testgit,代码行数:101,代码来源:AssignWHLocation.cs

示例11: MONO

        /// <summary>
        /// MONO
        /// </summary>
        private string MONO(Session session)
        {           
            switch (MOFrom)
            {
                case MOFromEnum.MONO:
                    return session.GetValue(Session.SessionKeys.MONO) as string;

                case MOFromEnum.ProdMO:
                    MO currentMO = session.GetValue(Session.SessionKeys.ProdMO) as MO;
                    if (currentMO == null)
                    {
                        return "";
                    }
                    else
                    {
                        return currentMO.MONO;
                    }

                case MOFromEnum.MB:
                    MB currentMB = session.GetValue(Session.SessionKeys.MB) as MB;
                    if (currentMB == null)
                    {
                        return "";
                    }
                    else
                    {
                        return currentMB.SMTMO;
                    }

                case MOFromEnum.Product:
                    Product currentProduct = session.GetValue(Session.SessionKeys.Product) as Product;
                    if (currentProduct == null)
                    {
                        return "";
                    }
                    else
                    {
                        return currentProduct.MO;
                    }

                default:
                    return "";
            }          
        }
开发者ID:wra222,项目名称:testgit,代码行数:47,代码来源:Print.cs

示例12: GetPCB

         private IMB GetPCB(object main_object, out Session session)
         {
             string objType = main_object.GetType().ToString();
             session = null;
             IMB iMB = null;
             Type mainType = main_object.GetType();
             if (mainType.Equals(typeof(IMES.FisObject.PCA.MB.IMB)))
             {
                 iMB = (IMB)main_object;
             }
             else if (mainType.Equals(typeof(IMES.Infrastructure.Session)))
             {
                 session = (IMES.Infrastructure.Session)main_object;
                 iMB = (IMB)session.GetValue(Session.SessionKeys.MB);
             }

             //if (iMB == null)
             //{
             //    throw new FisException("Can not get MB object in " + part_check_type + " module");
             //}
             return iMB;
         }
开发者ID:wra222,项目名称:testgit,代码行数:22,代码来源:Filter.cs

示例13: GetProduct

         IProduct GetProduct(object main_object, out Session session)
        {
            string objType = main_object.GetType().ToString();
            session = null;
            IProduct iprd = null;
            Type mainType = main_object.GetType();
            if (mainType.Equals(typeof(IMES.FisObject.FA.Product.Product)))
            {
                iprd = (IProduct)main_object;
            }
            else if (mainType.Equals(typeof(IMES.Infrastructure.Session)))
            {
                session = (IMES.Infrastructure.Session)main_object;
                iprd = (IProduct)session.GetValue(Session.SessionKeys.Product);
            }

            //if (iprd == null)
            //{
            //    throw new FisException("Can not get Product object in " + part_check_type + " module");
            //}
            return iprd;
        }
开发者ID:wra222,项目名称:testgit,代码行数:22,代码来源:Filter.cs

示例14: Dismantle


//.........这里部分代码省略.........
                    wfArguments.Add("Key", sessionKey);
                    wfArguments.Add("Station", station);
                    wfArguments.Add("Editor", editor);
                    wfArguments.Add("PdLine", line);
                    wfArguments.Add("Customer", customer);
                    wfArguments.Add("CurrentFlowSession", sessionInfo);
                    wfArguments.Add("SessionType", theType);


                    sessionInfo.AddValue(Session.SessionKeys.Product, currentProduct);
                    //sessionInfo.AddValue(Session.SessionKeys.PCode, pCode);
                    if (sDismantleType.ToUpper().Trim() == "KP")
                    {
                        sessionInfo.AddValue(Session.SessionKeys.ReturnStation, sReturnStation);
                        sessionInfo.AddValue(Session.SessionKeys.KPType, sKeyparts);
                    }
                    sessionInfo.AddValue("Dismantletype", sDismantleType.ToUpper());
                    /*
                    if (dismantletype.toUpperCase() == "PRODUCT")
                    {
                        idismantle = 1;
                    }
                    else if (dismantletype.toUpperCase() == "KP")
                    {
                        idismantle = 2;
                    }
                    else if (dismantletype.toUpperCase() == "IMEI")
                    {
                        idismantle = 3;
                    }
                    else if (dismantletype.toUpperCase() == "AST")
                    {
                        idismantle = 4;
                    }
                    else
                    {
                        idismantle = 0;
                    }
                    */
                    sessionInfo.AddValue(Session.SessionKeys.Carton, currentProduct.CartonSN);
                    sessionInfo.AddValue(Session.SessionKeys.PalletNo, currentProduct.PalletNo);
                    sessionInfo.AddValue(Session.SessionKeys.DeliveryNo, currentProduct.DeliveryNo);
                    string getv = (string)sessionInfo.GetValue("Dismantletype");


                    string wfName, rlName;
                    RouteManagementUtils.GetWorkflow(station, "FADismantle.xoml", "fadismantle.rules", out wfName, out rlName);
                    WorkflowInstance instance = WorkflowRuntimeManager.getInstance.CreateXomlFisWorkflow(wfName, rlName, wfArguments);
                    sessionInfo.SetInstance(instance);
             

                    if (!SessionManager.GetInstance.AddSession(sessionInfo))
                    {
                        sessionInfo.WorkflowInstance.Terminate("Session:" + sessionKey + " Exists.");
                        erpara.Add(sessionKey);
                        ex = new FisException("CHK020", erpara);
                        throw ex;
                    }
                    sessionInfo.WorkflowInstance.Start();
                    sessionInfo.SetHostWaitOne();

                }
                else
                {
                    erpara.Add(sessionKey);
                    ex = new FisException("CHK020", erpara);
                    throw ex;
                }

                //check workflow exception
                if (sessionInfo.Exception != null)
                {
                    if (sessionInfo.GetValue(Session.SessionKeys.WFTerminated) != null)
                    {
                        sessionInfo.ResumeWorkFlow();
                    }
                    throw sessionInfo.Exception;
                }
            }
            catch (FisException e)
            {
                logger.Error(e.mErrmsg);
                throw e;
            }
            catch (Exception e)
            {
                logger.Error(e.Message);
                throw new SystemException(e.Message);
            }
            finally
            {
                logger.Debug("(DismantleFA)Dismantle End,"
                      + " [CustSN or ProductId]:" + snorproid
                       + " [line]:" + line
                      + " [editor]:" + editor
                      + " [station]:" + station
                      + " [customer]:" + customer);

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

示例15: CheckProduct

        /// <summary>
        /// check product
        /// </summary>
        /// <param name="line">line</param>
        /// <param name="editor">editor</param>
        /// <param name="station">station</param>
        /// <param name="customer">customer</param>
        /// <param name="custSN">customer SN</param>
        public int CheckProduct(string line,string editor, string station, string customer,string custSN)
        {
           
            string keyStr = "";
            try
            {
                string sessionKey = custSN;
                keyStr = sessionKey;
                Session currentSession = new Session(sessionKey, SessionType, editor, station, line, customer);
                Dictionary<string, object> wfArguments = new Dictionary<string, object>();
                wfArguments.Add("Key", sessionKey);
                wfArguments.Add("Station", station);
                wfArguments.Add("CurrentFlowSession", currentSession);
                wfArguments.Add("Editor", editor);
                wfArguments.Add("PdLine", line);
                wfArguments.Add("Customer", customer);
                wfArguments.Add("SessionType", SessionType);

                string wfName, rlName;
                RouteManagementUtils.GetWorkflow(station, "CombineDNPalletforBTBlock.xoml", "", out wfName, out rlName);
                WorkflowInstance instance = WorkflowRuntimeManager.getInstance.CreateXomlFisWorkflow(wfName, rlName, wfArguments);
                currentSession.SetInstance(instance);
                if (!SessionManager.GetInstance.AddSession(currentSession))
                {
                    currentSession.WorkflowInstance.Terminate("Session:" + sessionKey + " Exists.");
                    FisException ex;
                    List<string> erpara = new List<string>();
                    erpara.Add(sessionKey);
                    ex = new FisException("CHK020", erpara);
                    throw ex;
                }
                currentSession.WorkflowInstance.Start();
                currentSession.SetHostWaitOne();
                if (currentSession.Exception != null)
                {
                    if (currentSession.GetValue(Session.SessionKeys.WFTerminated) != null)
                    {
                        currentSession.ResumeWorkFlow();
                    }

                    throw currentSession.Exception;
                }
               
                IProduct product = null;
                product = productRepository.GetProductByCustomSn(custSN);
                if (null == product)
                {
                    //no data
                    return -10;
                }
                string isCDSI = "";
                string isFactoryPo = "";
                IList<IMES.FisObject.Common.Model.ModelInfo> isPO = modelRep.GetModelInfoByModelAndName(product.Model, "PO");

                foreach (IMES.FisObject.Common.Model.ModelInfo tmpPO in isPO)
                {
                    if (tmpPO.Value == "Y")
                    {
                        isCDSI = "true";
                    }
                    else
                    {
                        IList<IMES.FisObject.Common.Model.ModelInfo> isATSNAV = modelRep.GetModelInfoByModelAndName(product.Model, "ATSNAV");
                        foreach (IMES.FisObject.Common.Model.ModelInfo tmpATSNAV in isATSNAV)
                        {
                            if (tmpATSNAV.Value == null)
                            { 
                            }
                            else if (tmpATSNAV.Value != "")
                            {
                                isCDSI = "true";
                            }
                            break;
                        }
                    }
                    break;
                }
                if (isCDSI == "true")
                {

                    CdsiastInfo condition = new CdsiastInfo();
                    condition.snoId = product.ProId;
                    condition.tp = "FactoryPO";
                    IList<CdsiastInfo> isCdsiastInfo = productRepository.GetCdsiastInfoList(condition);
                    isFactoryPo = "";
                    foreach (CdsiastInfo tmpCdsiastInfo in isCdsiastInfo)
                    {
                        isFactoryPo = tmpCdsiastInfo.sno;
                        break;
                    }
                    if (isFactoryPo == "" || isFactoryPo == null)
                    {
//.........这里部分代码省略.........
开发者ID:wra222,项目名称:testgit,代码行数:101,代码来源:CombineDNPalletforBT.cs


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