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)); }
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)); }
public Category Put(int categoryId, Category category) { return(_categoryServices.EditCategory(categoryId, category)); }