Beispiel #1
0
        public async Task <IActionResult> ChangeStatus(int id, string pageIndex, string keyword, int?CategoryID, int?BrandID)
        {
            var result = await _productApiClient.ChangeStatus(id);

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