Пример #1
0
        //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));
        }
Пример #2
0
 public ActionResult UnassignFeaturesFromCategory(EditFeaturesForCategoriesViewModel model)
 {
     adminService.DeleteAssignFeaturesToCategory(model.CategoryId, model.SelectedFeaturesId);
     return(RedirectToAction("ConnectFeaturesToCategory", new { categoryId = model.CategoryId }));
 }