Пример #1
0
        public async Task <IActionResult> Active(ProductCategoryIdRequestModel request)
        {
            if (!ModelState.IsValid)
            {
                return(RedirectToErrorPage());
            }

            var isActived = await _productCategoryService.ActiveAsync(new ProductCategoryRequest
            {
                Id          = request.Id,
                UpdatedById = LoggedUserId
            });

            if (!isActived)
            {
                return(RedirectToErrorPage());
            }

            if (request.ShouldKeepUpdatePage)
            {
                return(RedirectToAction(nameof(Update), new { id = request.Id }));
            }

            return(RedirectToAction(nameof(Index)));
        }