//Akcje łączenie cech z kategoriami public ActionResult ConnectFeaturesToCategory(int categoryId) { var featuresAssignedToCategory = adminService.GetAllFeaturesAssignedForCategory(categoryId); var featuresNotAssignedToCategory = adminService.GetAllFeaturesNotAssignedForCategory(categoryId); var model = new EditFeaturesForCategoriesViewModel() { Category = adminService.GetCategoryById(categoryId), FeaturesAssignedToCategory = featuresAssignedToCategory, FeaturesNotAssignedToCategory = featuresNotAssignedToCategory }; return(View(model)); }
public ActionResult UnassignFeaturesFromCategory(EditFeaturesForCategoriesViewModel model) { adminService.DeleteAssignFeaturesToCategory(model.CategoryId, model.SelectedFeaturesId); return(RedirectToAction("ConnectFeaturesToCategory", new { categoryId = model.CategoryId })); }