public ActionResult LoadItemProduct(string StoreID) { var listProductDish = _factory.GetProductApplyStore(StoreID, (byte)Commons.EProductType.Dish); var listProduct = listProductDish; var listProductSetMenu = _factory.GetProductApplyStore(StoreID, (byte)Commons.EProductType.SetMenu); listProduct.AddRange(listProductSetMenu); RSVPStoreProducMappingModels model = new RSVPStoreProducMappingModels(); if (listProduct != null) { model.ListRSVPProductMapping = new List <ProductItemModels>(); foreach (var item in listProduct) { ProductItemModels product = new ProductItemModels() { ProductID = item.ID, ProductName = item.Name, ProductCode = item.ProductCode, ProductType = item.ProductType }; model.ListRSVPProductMapping.Add(product); } } model.ListRSVPProductMapping = model.ListRSVPProductMapping.OrderBy(x => x.ProductName).ToList(); return(PartialView("_ListItemProduct", model)); }
/*Add More Store Product Mapping*/ public ActionResult AddMoreStoreProductMapping(int currentOffset, string StoreID, string StoreName) { RSVPStoreProducMappingModels model = new RSVPStoreProducMappingModels(); model.OffSet = currentOffset; model.StoreName = StoreName; model.StoreID = StoreID; return(PartialView("_StoreProductMapping", model)); }
public RSVPStoreProducMappingModels GetDetail(string id) { try { var result = (List <SelectListItem>)ViewBag.ListStore; List <string> ListStoreId = result.Select(x => x.Value).ToList(); var data = _factoryRSVP.GetList(ListStoreId, CurrentUser.ListOrganizationId); RSVPStoreProducMappingModels model = new RSVPStoreProducMappingModels(); if (data != null && data.Count > 0) { model = data.Where(x => x.StoreID.Equals(id)).FirstOrDefault(); model.StoreName = result == null ? "" : result.Where(z => z.Value.Equals(id)).FirstOrDefault().Text; } return(model); } catch (Exception ex) { _logger.Error("RSVPProductMapping_Detail: " + ex); return(null); } }
public new PartialViewResult View(string id) { RSVPStoreProducMappingModels model = GetDetail(id); return(PartialView("_View", model)); }