1.数据源处理
数据源集合数据结构:
使用Linq将数据根据Location和PN做Group by ,Sum(PN)。
var list = from it in UIOrderDate.OrderItemList
group it by new { it.Location, it.PN } into g
select new SOrderItemInfo
{
Location = g.Key.Location,
PN = g.Key.PN,
SPQty = g.Sum(it => it.SPQty)
};
var list = from it in UIOrderDate.OrderItemList
group it by new { it.Location, it.PN } into g
select new SOrderItemInfo
{
Location = g.Key.Location,
PN = g.Key.PN,
SPQty = g.Sum(it => it.SPQty)
};
数据源集合