コード例 #1
0
 /// <summary>
 /// 获取DN表相关信息GetDeliveryPalletListByDN
 /// </summary>
 public IList<S_RowData_DN> GetDNList()
 {
     logger.Debug("(_CombineDNPalletforBT)GetDNList start.");
     try
     {
         IList<S_RowData_DN> ret = new List<S_RowData_DN>();
         DNQueryCondition condition = new DNQueryCondition();
         DateTime temp = DateTime.Now;
         temp = temp.AddDays(-3);
         condition.ShipDateFrom = new DateTime(temp.Year, temp.Month, temp.Day, 0, 0, 0, 0);
         IList<DNForUI> dnList = currentRepository.GetDNListByCondition(condition);
         foreach (DNForUI tmp in dnList)
         {
             S_RowData_DN ele = new S_RowData_DN();
             ele.DeliveryNO = tmp.DeliveryNo;
             if (tmp.Status != "00")
             {
                 continue;
             }
             if (!(tmp.ModelName.Length == 12 && tmp.ModelName.Substring(0, 2) == "PC"))
             {
                 continue;
             }
             ele.Model = tmp.ModelName;
             ele.CustomerPN = currentRepository.GetDeliveryInfoValue(tmp.DeliveryNo, "PartNo");
             ele.PoNo = tmp.PoNo;
             ele.Date = tmp.ShipDate.ToString();
             ele.Qty = tmp.Qty.ToString();
             IList<IProduct> productList = new List<IProduct>();
             productList = productRepository.GetProductListByDeliveryNo(tmp.DeliveryNo);
             if (null != productList)
             {
                 ele.PackedQty = productList.Count.ToString();
             }
             ret.Add(ele);
         }
         return ret;
     }
     catch (FisException e)
     {
         logger.Error(e.mErrmsg, e);
         throw new Exception(e.mErrmsg);
     }
     catch (Exception e)
     {
         logger.Error(e.Message, e);
         throw new SystemException(e.Message);
     }
     finally
     {
         logger.Debug("(_CombineDNPalletforBT)GetDNList end.");
     }
 }
コード例 #2
0
        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();
                }
                arrRet.Add(pallet.PalletNo);
                arrRet.Add(q1.ToString());
                arrRet.Add(q2.ToString());
                arrRet.Add(ele);
                return arrRet;
            }
            catch (FisException e)
            {
                if (!string.IsNullOrEmpty(prodId))
                {
                    IDeliveryRepository deliveryRep = RepositoryFactory.GetInstance().GetRepository<IDeliveryRepository, Delivery>();
                    deliveryRep.RollBackAssignBoxId(prodId);
                }

                logger.Error(e.mErrmsg, e);
                throw new Exception(e.mErrmsg);
            }
            catch (Exception e)
            {
                if (!string.IsNullOrEmpty(prodId))
                {
                    IDeliveryRepository deliveryRep = RepositoryFactory.GetInstance().GetRepository<IDeliveryRepository, Delivery>();
                    deliveryRep.RollBackAssignBoxId(prodId);
                }

                logger.Error(e.Message, e);
                throw new SystemException(e.Message);
            }
            finally
            {
                Session sessionDelete = SessionManager.GetInstance.GetSession(keyStr, SessionType); ;
                if (sessionDelete != null)
                {
                    SessionManager.GetInstance.RemoveSession(sessionDelete);
                }
                logger.Debug("(_CombineDNPalletforBT)AssignAll end, custSn:" + custSN);
            }
        }
コード例 #3
0
    private void BindGrv(S_RowData_DN sDN)
    {
        DataTable dt = initTable();
        DataRow newRow;
        newRow = dt.NewRow();
        newRow["Delivery NO"] = sDN.DeliveryNO;
        newRow["Model"] = sDN.Model;
        newRow["Customer P/N"] = sDN.CustomerPN;
        newRow["PoNo"] = sDN.PoNo;
        newRow["Date"] = sDN.Date;
        newRow["Qty"] = sDN.Qty;
        newRow["Packed Qty"] = sDN.PackedQty;
        dt.Rows.Add(newRow);
        for (int i = 0; i < 4; i++) 
        {
            newRow = dt.NewRow();
            dt.Rows.Add(newRow);
        }

        this.gridViewDN.DataSource = dt;
        this.gridViewDN.DataBind();
        initTableColumnHeader();
        UpdatePanelTableDN.Update();
     
    }