Example #1
0
        public ActionResult MatchProductToAssembly(int userId, int categoryId)
        {
            var model = new SelectProductToAssemblyViewModel()
            {
                Products          = assemblyService.GetMatchingProductsForCategory(userId, categoryId),
                UserId            = userId,
                CurrentAssemblyId = assemblyService.GetCurrentAssembly(userId).Id
            };

            return(View(model));
        }
Example #2
0
 public ActionResult MatchProductToAssemblyWithModel(SelectProductToAssemblyViewModel model)
 {
     assemblyService.AddProductToAssembly(model.SelectedProductId, model.CurrentAssemblyId);
     return(RedirectToAction(nameof(CreateNewAssembly), new { model.UserId }));
 }