我需要一些幫助,CASE語句LINQ(C#):LINQ 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;
此查詢更新從生產到商業網站的庫存狀態。
使用代碼塊男人 – Chance 2009-06-01 18:17:37