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


C# XPCollection.Add方法代码示例

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


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

示例1: cachePOLine

        private void cachePOLine()
        {
            XPClassInfo poLineClass = uow.GetClassInfo(typeof(PurchOrderLine));
            CriteriaOperator criteria = CriteriaOperator.Parse(string.Format("(OrderStatus = '{0}' OR OrderStatus = '{1}' OR OrderStatus = '{2}') ", PurchOrderLine.PurchOrderStatus.Approval, PurchOrderLine.PurchOrderStatus.Waiting, PurchOrderLine.PurchOrderStatus.Active));
            SortingCollection sortProps = new SortingCollection(null);
            sortProps.Add(new SortProperty("NeedDate", SortingDirection.Ascending));

            ICollection purchOrderLines = uow.GetObjects(poLineClass, criteria, sortProps, int.MaxValue, false, true);

            XPCollection<WIPPurchOrderLine> poLines;
            WIPPurchOrderLine poLine;

            foreach (PurchOrderLine purchOrderLine in purchOrderLines)
            {
                string itemNo = purchOrderLine.Item.ItemNo;
                poLine = new WIPPurchOrderLine(uow, purchOrderLine);
                poLine.WIPTable = wipTable;
                poLine.Save();

                if (dictPoLine.ContainsKey(itemNo))
                {
                    poLines = dictPoLine[itemNo];
                    poLines.Add(poLine);
                }
                else
                {
                    poLines = new XPCollection<WIPPurchOrderLine>(uow, false);
                    poLines.Add(poLine);
                    dictPoLine.Add(itemNo, poLines);
                }
            }
        }
开发者ID:kamchung322,项目名称:Namwah,代码行数:32,代码来源:WIPCalc.cs

示例2: cacheSOLine

        private void cacheSOLine()
        {
            XPClassInfo soLineClass = uow.GetClassInfo(typeof(SalesOrderLine));
            CriteriaOperator criteria = CriteriaOperator.Parse(string.Format("(OrderStatus = '{0}' || OrderStatus == '{1}') ", SalesOrderLine.SalesOrderStatus.Active, SalesOrderLine.SalesOrderStatus.Waiting));
            SortingCollection sortProps = new SortingCollection(null);
            sortProps.Add(new SortProperty("NeedDate", SortingDirection.Ascending));

            ICollection salesOrderLines = uow.GetObjects(soLineClass, criteria, sortProps, int.MaxValue, false, true);

            soLines = new XPCollection<WIPSalesOrderLine>(uow, false);
            WIPSalesOrderLine soLine;

            foreach (SalesOrderLine salesOrderLine in salesOrderLines)
            {
                soLine = new WIPSalesOrderLine(uow, salesOrderLine);
                soLine.WIPTable = wipTable;
                soLine.Save();
                soLines.Add(soLine);
            }
        }
开发者ID:kamchung322,项目名称:Namwah,代码行数:20,代码来源:WIPCalc.cs

示例3: cacheWHTotal

        private void cacheWHTotal()
        {
            XPClassInfo whTotalClass = uow.GetClassInfo(typeof(WHTotal));
            CriteriaOperator criteria = CriteriaOperator.Parse("");
            SortingCollection sortProps = new SortingCollection(null);
            //criteria = CriteriaOperator.Parse(string.Format("(ProdOrder.OrderStatus = '{0}') ", ProdOrder.ProdOrderStatus.Active));
            //sortProps.Add(new SortProperty("NeedDate", SortingDirection.Descending));

            ICollection whTotals = uow.GetObjects(whTotalClass, criteria, sortProps, int.MaxValue, false, true);
            XPCollection<WIPWHTotal> wipWHTotals;
            WIPWHTotal wipWHTotal;
            string key;

            foreach (WHTotal whTotal in whTotals)
            {
                wipWHTotal = new WIPWHTotal(uow, whTotal);
                wipWHTotal.WIPTable = wipTable;
                wipWHTotal.Save();

                key = wipWHTotal.Item.ItemNo;

                if (dictWHTotal.ContainsKey(key))
                {
                    wipWHTotals = dictWHTotal[key];
                    wipWHTotals.Add(wipWHTotal);
                }
                else
                {
                    wipWHTotals = new XPCollection<WIPWHTotal>(uow, false);
                    wipWHTotals.Add(wipWHTotal);
                    dictWHTotal.Add(key, wipWHTotals);
                }

                wipWHTotals.Add(wipWHTotal);
            }
        }
开发者ID:kamchung322,项目名称:Namwah,代码行数:36,代码来源:WIPCalc.cs

示例4: cacheProdBom

        private void cacheProdBom()
        {
            XPClassInfo prodBomClass = uow.GetClassInfo(typeof(ProdBom));
            CriteriaOperator criteria = CriteriaOperator.Parse(string.Format("(ProdOrder.OrderStatus = '{0}' && ProdOrder.WipQty > 0) ", ProdOrder.ProdOrderStatus.Active));
            SortingCollection sortProps = new SortingCollection(null);
            string key;

            ICollection prodBoms = uow.GetObjects(prodBomClass, criteria, sortProps, int.MaxValue, false, true);
            XPCollection<WIPProdBom> pBoms;
            WIPProdBom pBom;

            foreach (ProdBom prodBom in prodBoms)
            {
                double diffQty = prodBom.CanMakeKitQty - prodBom.ProdOrder.KitQty;
                //key = prodBom.bomItem.ItemNo;
                key = String.Format("{0}_{1}", prodBom.ProdOrder.Item.ItemNo, prodBom.bomItem.ItemNo);

                if (diffQty > 0)
                {
                    diffQty = (prodBom.ProdOrder.WipQty - prodBom.ProdOrder.KitQty) * prodBom.Qty / prodBom.PerSeries;

                    if (prodBom.Unit != null)
                        diffQty = Math.Round(diffQty, prodBom.Unit.Decimal);

                    if (diffQty < 0)
                        diffQty = 0;
                }

                if (diffQty > 0)
                {
                    pBom = new WIPProdBom(uow, prodBom);
                    pBom.Qty = (float)diffQty;
                    pBom.WIPTable = wipTable;
                    pBom.Save();

                    if (dictProdBom.ContainsKey(key))
                    {
                        pBoms = dictProdBom[key];
                        pBoms.Add(pBom);
                    }
                    else
                    {
                        pBoms = new XPCollection<WIPProdBom>(uow, false);
                        pBoms.Add(pBom);
                        dictProdBom.Add(key, pBoms);
                    }
                }
            }
        }
开发者ID:kamchung322,项目名称:Namwah,代码行数:49,代码来源:WIPCalc.cs

示例5: cacheProdRoute

        private void cacheProdRoute()
        {
            XPClassInfo prodRouteClass = uow.GetClassInfo(typeof(ProdRoute));
            CriteriaOperator criteria = CriteriaOperator.Parse(string.Format("(ProdOrder.OrderStatus = '{0}' && WipQty > 0) ", ProdOrder.ProdOrderStatus.Active));
            SortingCollection sortProps = new SortingCollection(null);
            string key;

            ICollection prodRoutes = uow.GetObjects(prodRouteClass, criteria, sortProps, int.MaxValue, false, true);
            XPCollection<WIPProdRoute> pRoutes;
            WIPProdRoute pRoute;

            foreach (ProdRoute prodRoute in prodRoutes)
            {
                pRoute = new WIPProdRoute(uow, prodRoute);
                pRoute.WIPTable = wipTable;
                pRoute.Save();
                key = String.Format("{0}_{1}", pRoute.ProdRoute.Item.ItemNo, pRoute.ProdRoute.WorkOper.Name);

                if (pRoute.Qty > 0)
                {
                    if (dictProdRoute.ContainsKey(key))
                    {
                        pRoutes = dictProdRoute[key];
                        pRoutes.Add(pRoute);
                    }
                    else
                    {
                        pRoutes = new XPCollection<WIPProdRoute>(uow, false);
                        pRoutes.Add(pRoute);
                        dictProdRoute.Add(key, pRoutes);
                    }
                }
            }
        }
开发者ID:kamchung322,项目名称:Namwah,代码行数:34,代码来源:WIPCalc.cs

示例6: RefreshAvailVendor

        private void RefreshAvailVendor()
        {
            _availVendor = new XPCollection<Vendor>(Session) { LoadingEnabled = false };

            foreach (PriceDisc pDisc in PriceDiscs)
            {
                if (pDisc.Type == PriceDisc.PriceType.Purch)
                    _availVendor.Add((Vendor)pDisc.ExternalContact);
            }
        }
开发者ID:kamchung322,项目名称:Namwah,代码行数:10,代码来源:Item.cs

示例7: RefreshAvailProdOrder

        private void RefreshAvailProdOrder()
        {
            _availProdOrder = new XPCollection<ProdOrder>(Session);
            _availProdOrder.LoadingEnabled = false;
            BindingList<ProdRoute> pRoutes = this.CalcProdOrderFQCs(Session);

            foreach (ProdRoute pRoute in pRoutes)
            {
                _availProdOrder.Add(pRoute.ProdOrder);
            }
        }
开发者ID:kamchung322,项目名称:Namwah,代码行数:11,代码来源:mpProdOrderFQC.cs

示例8: cacheSOLine

        private void cacheSOLine()
        {
            XPClassInfo soLineClass;
            CriteriaOperator criteria;
            SortingCollection sortProps;

            soLineClass = uow.GetClassInfo(typeof(SalesOrderLine));
            criteria = CriteriaOperator.Parse(string.Format("(OrderStatus = '{0}' || OrderStatus == '{1}') ", SalesOrderLine.SalesOrderStatus.Active, SalesOrderLine.SalesOrderStatus.Waiting));

            if (debugMode)
            {
                criteria = CriteriaOperator.Parse(string.Format("(Item.ItemNo = '05CA1798A01' ) "));
                //criteria = CriteriaOperator.Parse(string.Format("(OrderStatus = '{0}' || OrderStatus == '{1}') && Item.ItemNo == '01CA9096A05' ", SalesOrderLine.SalesOrderStatus.Active, SalesOrderLine.SalesOrderStatus.Waiting));
            }

            sortProps = new SortingCollection(null);
            sortProps.Add(new SortProperty("NeedDate", SortingDirection.Ascending));

            ICollection salesOrderLines = uow.GetObjects(soLineClass, criteria, sortProps, int.MaxValue, false, true);

            soLines = new XPCollection<WIPSalesOrderLine>(Session, false);
            WIPSalesOrderLine soLine;

            foreach (SalesOrderLine salesOrderLine in salesOrderLines)
            {
                soLine = new WIPSalesOrderLine(Session, salesOrderLine);
                soLine.WIPTable = wipTable;
                System.Diagnostics.Debug.Print(string.Format("SO {0}, Item {1}", salesOrderLine.SalesOrder.OrderNo, salesOrderLine.Item.ItemNo));
                MakeWIPRouteLine(salesOrderLine.Item);
                soLine.Save();
                soLines.Add(soLine);
            }
        }
开发者ID:kamchung322,项目名称:Namwah,代码行数:33,代码来源:mpWIPAll.cs

示例9: cacheProdRouteQAQty

        private void cacheProdRouteQAQty()
        {
            XPClassInfo rListTransferClass;
            CriteriaOperator criteria;
            SortingCollection sortProps;
            rListTransferClass = uow.GetClassInfo(typeof(ProdRouteListTransfer));

            criteria = CriteriaOperator.Parse(string.Format("(Status = '{0}' ) ", ProdRouteListTransfer.ProdRouteListStatus.Waiting));
            sortProps = new SortingCollection(null);

            ICollection rListTransfers = uow.GetObjects(rListTransferClass, criteria, sortProps, int.MaxValue, false, true);

            foreach (ProdRouteListTransfer rListTransfer in rListTransfers)
            {
                if (rListTransfer.ToProdRoute == null)
                {
                    string itemNo;
                    itemNo = rListTransfer.ProdOrder.Item.ItemNo;

                    WIPWHTotal wipWHTotal = GetWHTotal(itemNo, rListTransfer.ProdOrder.Warehouse);

                    if (wipWHTotal != null)
                    {
                        wipWHTotal.QAQty = wipWHTotal.QAQty + rListTransfer.Qty + rListTransfer.ScrapQty;
                    }
                    else
                    {
                        wipWHTotal = new WIPWHTotal(Session, rListTransfer);
                        wipWHTotal.WIPTable = wipTable;
                        wipWHTotal.QAQty = wipWHTotal.QAQty + rListTransfer.Qty + rListTransfer.ScrapQty;
                        wipWHTotal.Save();
                    }

                    XPCollection<WIPWHTotal> wipWHTotals;
                    if (dictWHTotal.ContainsKey(itemNo))
                    {
                        wipWHTotals = dictWHTotal[itemNo];
                        wipWHTotals.Add(wipWHTotal);
                    }
                    else
                    {
                        wipWHTotals = new XPCollection<WIPWHTotal>(Session, false);
                        wipWHTotals.Add(wipWHTotal);
                        dictWHTotal.Add(itemNo, wipWHTotals);
                    }
                }
            }
        }
开发者ID:kamchung322,项目名称:Namwah,代码行数:48,代码来源:mpWIPAll.cs

示例10: cacheProdRoute

        private void cacheProdRoute()
        {
            XPClassInfo prodRouteClass;
            CriteriaOperator criteria;
            SortingCollection sortProps;
            string key;

            prodRouteClass = uow.GetClassInfo(typeof(ProdRoute));
            criteria = CriteriaOperator.Parse(string.Format("(ProdOrder.OrderStatus = '{0}' && WipQty > 0) ", ProdOrder.ProdOrderStatus.Active));
            sortProps = new SortingCollection(null);
            //sortProps.Add(new SortProperty("NeedDate", SortingDirection.Ascending));

            ICollection prodRoutes = uow.GetObjects(prodRouteClass, criteria, sortProps, int.MaxValue, false, true);
            XPCollection<WIPProdRoute> pRoutes;
            WIPProdRoute pRoute;

            foreach (ProdRoute prodRoute in prodRoutes )
            {
                pRoute = new WIPProdRoute(Session, prodRoute);

                if (pRoute.Qty > 0)
                {
                    pRoute.WIPTable = wipTable;
                    pRoute.Save();
                    key = pRoute.ProdRoute.Item.ItemNo + "_" + pRoute.ProdRoute.ProdOrder.OrderType.Name  +"_" + pRoute.ProdRoute.WorkOper.Name;

                    if (dictProdRoute.ContainsKey(key))
                    {
                        pRoutes = dictProdRoute[key];
                        pRoutes.Add(pRoute);
                    }
                    else
                    {
                        pRoutes = new XPCollection<WIPProdRoute>(Session, false);
                        pRoutes.Add(pRoute);
                        dictProdRoute.Add(key, pRoutes);
                    }
                }
                else
                {
                    pRoute.Delete();
                }
            }
        }
开发者ID:kamchung322,项目名称:Namwah,代码行数:44,代码来源:mpWIPAll.cs

示例11: cachePOLineQAQty

        private void cachePOLineQAQty()
        {
            XPClassInfo poReceiveClass;
            CriteriaOperator criteria;
            SortingCollection sortProps;
            poReceiveClass = uow.GetClassInfo(typeof(PurchOrderReceive));
            criteria = CriteriaOperator.Parse(string.Format("(Status = '{0}' ) ", PurchOrderReceive.OrderReceiveStatus.Waiting));
            sortProps = new SortingCollection(null);

            ICollection poReceives = uow.GetObjects(poReceiveClass, criteria, sortProps, int.MaxValue, false, true);

            foreach (PurchOrderReceive poReceive in poReceives)
            {
                string key;
                key = poReceive.PurchOrderLine.Item.ItemNo ;

                WIPWHTotal wipWHTotal = GetWHTotal(key, poReceive.PurchOrderLine.Warehouse);

                if (wipWHTotal != null)
                {
                    wipWHTotal.QAQty = wipWHTotal.QAQty + poReceive.Qty + poReceive.ScrapQty;
                }
                else
                {
                    wipWHTotal = new WIPWHTotal(Session, poReceive);
                    wipWHTotal.QAQty = wipWHTotal.QAQty + poReceive.Qty + poReceive.ScrapQty;
                    wipWHTotal.Save();
                }

                XPCollection<WIPWHTotal> wipWHTotals;
                if (dictWHTotal.ContainsKey(key))
                {
                    wipWHTotals = dictWHTotal[key];
                    wipWHTotals.Add(wipWHTotal);
                }
                else
                {
                    wipWHTotals = new XPCollection<WIPWHTotal>(Session, false);
                    wipWHTotal.WIPTable = wipTable;
                    wipWHTotals.Add(wipWHTotal);
                    dictWHTotal.Add(key, wipWHTotals);
                }
            }
        }
开发者ID:kamchung322,项目名称:Namwah,代码行数:44,代码来源:mpWIPAll.cs

示例12: cachePOLine

        private void cachePOLine()
        {
            XPClassInfo poLineClass;
            CriteriaOperator criteria;
            SortingCollection sortProps;
            poLineClass = uow.GetClassInfo(typeof(PurchOrderLine));
            // Move QAQty to WHTotal
            //criteria = CriteriaOperator.Parse(string.Format("(OrderStatus = '{0}' OR OrderStatus = '{1}' OR OrderStatus = '{2}' OR PendingReceivedQty > 0 ) ", PurchOrderLine.PurchOrderStatus.Approval, PurchOrderLine.PurchOrderStatus.Waiting, PurchOrderLine.PurchOrderStatus.Active));
            criteria = CriteriaOperator.Parse(string.Format("(OrderStatus = '{0}' OR OrderStatus = '{1}' OR OrderStatus = '{2}' ) ", PurchOrderLine.PurchOrderStatus.Approval, PurchOrderLine.PurchOrderStatus.Waiting, PurchOrderLine.PurchOrderStatus.Active));
            sortProps = new SortingCollection(null);
            sortProps.Add(new SortProperty("NeedDate", SortingDirection.Ascending));

            ICollection purchOrderLines = uow.GetObjects(poLineClass, criteria, sortProps, int.MaxValue, false, true);

            XPCollection<WIPPurchOrderLine> poLines;
            WIPPurchOrderLine poLine;

            foreach (PurchOrderLine purchOrderLine in purchOrderLines)
            {
                string key;
                key = purchOrderLine.Item.ItemNo + "_" + purchOrderLine.OrderType.Name;
                poLine = new WIPPurchOrderLine(Session, purchOrderLine);
                poLine.WIPTable = wipTable;
                poLine.Save();

                if (dictPoLine.ContainsKey(key))
                {
                    poLines = dictPoLine[key];
                    poLines.Add(poLine);
                }
                else
                {
                    poLines = new XPCollection<WIPPurchOrderLine>(Session, false);
                    poLines.Add(poLine);
                    dictPoLine.Add(key, poLines);
                }
            }
        }
开发者ID:kamchung322,项目名称:Namwah,代码行数:38,代码来源:mpWIPAll.cs


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