public ActionResult AddItemsEarn(/*string[] productIDs, int currentGroupOffSet, int currentItemOffset*/ EarningRuleDTO data) { EarningRuleDTO model = new EarningRuleDTO(); if (data.ListProduct != null && data.ListProduct.Count() > 0) { model.ListProduct = new List <PromotionProductDTO>(); } for (int i = 0; i < data.ListProduct.Count(); i++) { PromotionProductDTO item = new PromotionProductDTO(); item.OffSet = data.currentItemOffset; item.ProductID = data.ListProduct[i].ProductID; item.ProductCode = data.ListProduct[i].ProductCode; item.Name = data.ListProduct[i].Name; item.ItemType = data.ListProduct[i].ItemType; model.ListProduct.Add(item); data.currentItemOffset++; } model.OffSet = data.currentgroupOffSet; return(PartialView("_ItemModalEarn", model)); }
public ActionResult LoadItemsEarn(string StoreID, int ItemType) { var lstDish = _factoryProduct.GetListProduct(StoreID, ItemType, CurrentUser.ListOrganizationId); EarningRuleDTO model = new EarningRuleDTO(); if (lstDish != null) { lstDish = lstDish.Where(ww => ww.IsAllowedDiscount).ToList(); model.ListProduct = new List <PromotionProductDTO>(); foreach (var item in lstDish) { PromotionProductDTO product = new PromotionProductDTO() { ProductID = item.ID, Name = item.Name, ProductCode = item.ProductCode, ItemType = (byte)Commons.EProductType.Dish }; model.ListProduct.Add(product); } } return(PartialView("_TableChooseItemsEarn", model)); }