Exemplo n.º 1
0
        public async Task <IActionResult> Edit(CategoryViewModel categoryViewModel)
        {
            if (ModelState.IsValid)
            {
                var category = await _categoryServices.EditAsync(categoryViewModel);

                if (category)
                {
                    TempData["Success"] = _commonLocalizer.GetLocalizedHtmlString("msg_EditSuccess").ToString();
                    return(RedirectToAction("Index"));
                }
                ViewData["Error"] = _categoryLocalizer.GetLocalizedHtmlString("err_EditCategoryFailure");
                return(View(categoryViewModel));
            }
            Log.Error("Edit Category Error");
            return(View(categoryViewModel));
        }