我需要有关linq(C#)中CASE语句的一些帮助:
osc_products.products_quantity =
CASE
WHEN itempromoflag <> 'N' THEN 100000
WHEN itemcat1 IN ('1','2','31') AND itemsalestatus = 'S' THEN 100000
WHEN itemsalestatus = 'O' THEN 0
ELSE cds_oeinvitem.itemqtyonhand - cds_oeinvitem.itemqtycommitted
END
我开始转换为linq,(我仍在学习):
cdsDBDataContext db = new cdsDBDataContext();
var query = from items in db.cdsItems
where items.ItemHandHeldFlag.Equals("Y") &&
items.ItemQtyOnHand - items.ItemQtyCommitted > 0
select items;
此查询将库存状态从生产更新为贸易站点。
UYOU
慕慕森
翻过高山走不出你
相关分类