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)); }
public ActionResult MatchProductToAssemblyWithModel(SelectProductToAssemblyViewModel model) { assemblyService.AddProductToAssembly(model.SelectedProductId, model.CurrentAssemblyId); return(RedirectToAction(nameof(CreateNewAssembly), new { model.UserId })); }