Ejemplo n.º 1
0
        public async Task <IActionResult> ChangeStatus(int id, string pageIndex)
        {
            var result = await _categoryApiClient.ChangeStatus(id);

            if (result.IsSuccess)
            {
                TempData["result"] = "Thay đổi trạng thái thành công";
                return(RedirectToAction("Index", new { pageIndex = !string.IsNullOrWhiteSpace(pageIndex) ? int.Parse(pageIndex) : 1 }));
            }
            TempData["error"] = result.Message;
            return(RedirectToAction("Index", new { pageIndex = !string.IsNullOrWhiteSpace(pageIndex) ? int.Parse(pageIndex) : 1 }));
        }