private void LoadGridItems() { try { var AllList = (from o in DB.ESHOP_ORDER_ITEMs where o.ORDER_ID == m_order_id orderby o.ESHOP_NEW.NEWS_TITLE descending select new { o.ITEM_ID, o.ESHOP_NEW.NEWS_TITLE, o.ESHOP_NEW.NEWS_CODE, o.ITEM_QUANTITY, o.ITEM_PRICE, o.ITEM_SUBTOTAL, o.ITEM_FIELD1, o.ITEM_FIELD2 }); if (AllList.ToList().Count > 0) { Rpdonhang.DataSource = AllList; Rpdonhang.DataBind(); } } catch (Exception ex) { clsVproErrorHandler.HandlerError(ex); } }
private void LoadGridItems() { try { if (_gtype != 1) { string[] arrShop = _gshop.Split(','); var AllList = (from o in DB.ESHOP_ORDER_ITEMs join g in DB.ESHOP_NEWs on o.NEWS_ID equals g.NEWS_ID where o.ORDER_ID == m_order_id && g.SHOP_ID != null && arrShop.Contains(g.SHOP_ID.ToString()) orderby o.ESHOP_NEW.NEWS_TITLE descending select new { o.ITEM_ID, o.ESHOP_NEW.NEWS_TITLE, o.ESHOP_NEW.NEWS_CODE, o.ITEM_QUANTITY, o.ITEM_PRICE, o.ITEM_SUBTOTAL, o.ITEM_FIELD1, o.ITEM_FIELD2 }); if (AllList.ToList().Count > 0) { Rpdonhang.DataSource = AllList; Rpdonhang.DataBind(); } } else { var AllList = (from o in DB.ESHOP_ORDER_ITEMs where o.ORDER_ID == m_order_id orderby o.ESHOP_NEW.NEWS_TITLE descending select new { o.ITEM_ID, o.ESHOP_NEW.NEWS_TITLE, o.ESHOP_NEW.NEWS_CODE, o.ITEM_QUANTITY, o.ITEM_PRICE, o.ITEM_SUBTOTAL, o.ITEM_FIELD1, o.ITEM_FIELD2 }); if (AllList.ToList().Count > 0) { Rpdonhang.DataSource = AllList; Rpdonhang.DataBind(); } } } catch (Exception ex) { clsVproErrorHandler.HandlerError(ex); } }