本文整理汇总了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);
}
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
}
}
示例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);
}
}
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
}
}
示例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();
}
}
}
示例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);
}
}
}
示例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);
}
}
}