Пример #1
0
        public ActionResult Edit([Bind(Prefix = "id")] string categoryId, string categoryName)
        {
            _categoryService.EditCategory(categoryId, categoryName); // Update
            var categoryList = _categoryService.GetCategoriesList(categoryId);

            ViewBag.Title = "Home Page";
            return(View("EditView", categoryList));
        }
Пример #2
0
 public async Task <IActionResult> Edit(CategoryViewModel editCategory)
 {
     HttpContext.Session.GetString("fullname");
     if (ModelState.IsValid)
     {
         if (await _categoryServices.EditCategory(editCategory))
         {
             TempData["succcessMessage"] = _resourcesServices.GetLocalizedHtmlString("msg_EditCategorySuccess").ToString();
             return(RedirectToAction("Index"));
         }
     }
     ViewData["errorMessage"] = _resourcesServices.GetLocalizedHtmlString("msg_EditCategoryError");
     return(View(editCategory));
 }
Пример #3
0
 public Category Put(int categoryId, Category category)
 {
     return(_categoryServices.EditCategory(categoryId, category));
 }