public ActionResult ProductList() { var model = new EnrollmentProductListViewModel(); model.OrderItems = ExigoDAL.GetItems(new ExigoService.GetItemsRequest { Configuration = OrderConfiguration, IncludeAllChildCategories = true, IncludeGroupMembers = true }).ToList(); model.AutoOrderItems = model.OrderItems.Where(i => i.AllowOnAutoOrder).DeepClone(); model.AutoOrderItems.ToList().ForEach(c => c.Type = ShoppingCartItemType.AutoOrder); foreach (var item in ShoppingCart.Items.Where(x => x.Type == ShoppingCartItemType.Order)) { model.OrderItems.Where(w => w.ItemCode == item.ItemCode).Select(c => { c.Quantity = item.Quantity; return(c); }).ToList(); } foreach (var item in ShoppingCart.Items.Where(x => x.Type == ShoppingCartItemType.AutoOrder)) { model.AutoOrderItems.Where(w => w.ItemCode == item.ItemCode).Select(c => { c.Quantity = item.Quantity; return(c); }).ToList(); } return(View(model)); }
public ActionResult ProductList() { var model = new EnrollmentProductListViewModel(); model.OrderItems = Exigo.GetItems(new ExigoService.GetItemsRequest { Configuration = OrderConfiguration }).ToList(); var autoOrderItems = Exigo.GetItems(new ExigoService.GetItemsRequest { Configuration = AutoOrderConfiguration }).ToList(); autoOrderItems.ForEach(c => c.Type = ShoppingCartItemType.AutoOrder); model.AutoOrderItems = autoOrderItems; return(View(model)); }