private async Task <IActionResult> GetDetails(int id, int approvalId)
        {
            var user = await _userManager.GetUserAsync(HttpContext.User);

            var roles = await _userManager.GetRolesAsync(user);

            PageRouteVersion pageRouteVersion = _pageRouteVersionRepository.Get(id);
            var notification = _approvalNotificationsRepository.GetByPageNameAndChangeType(pageRouteVersion.EnName, ChangeType.BasicInfo);

            ViewBag.DisableEditFlage = false;
            if (notification != null && notification.VersionStatusEnum == VersionStatusEnum.Submitted)
            {
                ViewBag.DisableEditFlage = true;
            }
            if (pageRouteVersion == null || (roles.Contains(UserRolesConst.MediaCenterContentManager) && (pageRouteVersion.ControllerName != "News" && pageRouteVersion.ControllerName != "PhotoArchive" && pageRouteVersion.ControllerName != "EventCalendar")))
            {
                return(NotFound());
            }

            List <NavItem>         navItems  = _navItemRepository.Get().ToList();
            PageRouteEditViewModel viewModel = new PageRouteEditViewModel(navItems);

            viewModel = pageRouteVersion.MapToPageRouteViewModel(viewModel);

            ViewBag.ApprovalId = approvalId;

            return(View(viewModel));
        }
        public async Task <IActionResult> Delete(int id)
        {
            PageRouteVersion pageRouteVersion = _pageRouteVersionRepository.Get(id);

            if (pageRouteVersion != null)
            {
                TempData[notificationMessageKey] = ToasrMessages.DeleteSuccess;
                TempData[notificationTypeKey]    = notificationSuccess;

                if (pageRouteVersion.ChangeActionEnum == ChangeActionEnum.New && pageRouteVersion.VersionStatusEnum == VersionStatusEnum.Draft)
                {
                    _pageRouteVersionRepository.SoftDelete(id);
                    _eventLogger.LogInfoEvent(HttpContext.User.Identity.Name, Common.ActivityEnum.Delete, "Definitions > Static Pages > Delete", "Soft Delete id: " + id);
                }
                else
                {
                    await SaveAndSubmitMethod(pageRouteVersion.MapToPageRouteViewModel(new PageRouteEditViewModel()), ChangeActionEnum.Delete);

                    _eventLogger.LogInfoEvent(HttpContext.User.Identity.Name, Common.ActivityEnum.Delete, "Definitions > Static Pages > Delete", "Delete id: " + id);
                }

                return(Json(new { }));
            }

            TempData[notificationMessageKey] = "Error has been occurred.";
            TempData[notificationTypeKey]    = notificationError;
            return(Json(new { }));
        }
        /// <summary>
        /// get DP details
        /// </summary>
        /// <param name="id"></param>
        /// <param name="approvalId"></param>
        /// <returns></returns>
        private async Task <IActionResult> GetDetails(int id, int approvalId)
        {
            var user = await _userManager.GetUserAsync(HttpContext.User);

            var role = (await _userManager.GetRolesAsync(user).ConfigureAwait(false)).FirstOrDefault();

            PageRouteVersion pageRouteVersion = _pageRouteVersionRepository.GetWithNoTracking(id);

            if (pageRouteVersion.VersionStatusEnum == VersionStatusEnum.Approved || pageRouteVersion.VersionStatusEnum == VersionStatusEnum.Ignored)
            {
                var pageRoute = _pageRouteRepository.Get(pageRouteVersion.PageRouteId ?? 0);
                if (pageRoute != null)
                {
                    pageRouteVersion.ApprovalDate     = pageRoute.ApprovalDate;
                    pageRouteVersion.ApprovedById     = pageRoute.ApprovedById;
                    pageRouteVersion.ArName           = pageRoute.ArName;
                    pageRouteVersion.ControllerName   = pageRoute.ControllerName;
                    pageRouteVersion.CreatedById      = pageRoute.CreatedById;
                    pageRouteVersion.CreationDate     = pageRoute.CreationDate;
                    pageRouteVersion.EnName           = pageRoute.EnName;
                    pageRouteVersion.HasNavItem       = pageRoute.HasNavItem;
                    pageRouteVersion.IsActive         = pageRoute.IsActive;
                    pageRouteVersion.IsDeleted        = pageRoute.IsDeleted;
                    pageRouteVersion.IsDynamicPage    = pageRoute.IsDynamicPage;
                    pageRouteVersion.NavItemId        = pageRoute.NavItemId;
                    pageRouteVersion.Order            = pageRoute.Order;
                    pageRouteVersion.PageFilePathAr   = pageRoute.PageFilePathAr;
                    pageRouteVersion.PageFilePathEn   = pageRoute.PageFilePathEn;
                    pageRouteVersion.SeoDescriptionAR = pageRoute.SeoDescriptionAR;
                    pageRouteVersion.SectionName      = pageRoute.SectionName;
                    pageRouteVersion.SeoDescriptionEN = pageRoute.SeoDescriptionEN;
                    pageRouteVersion.SeoOgTitleAR     = pageRoute.SeoOgTitleAR;
                    pageRouteVersion.SeoOgTitleEN     = pageRoute.SeoOgTitleEN;
                    pageRouteVersion.SeoTitleAR       = pageRoute.SeoTitleAR;
                    pageRouteVersion.SeoTitleEN       = pageRoute.SeoTitleEN;
                    pageRouteVersion.SeoTwitterCardAR = pageRoute.SeoTwitterCardAR;
                    pageRouteVersion.SeoTwitterCardEN = pageRoute.SeoTwitterCardEN;
                }
            }
            var notification = _approvalNotificationsRepository.GetByRelatedIdAndType(pageRouteVersion.Id, ChangeType.BasicInfo);

            ViewBag.DisableEditFlage = false;
            if (notification != null && notification.VersionStatusEnum == VersionStatusEnum.Submitted)
            {
                ViewBag.DisableEditFlage = true;
            }
            if (pageRouteVersion == null)
            {
                return(NotFound());
            }

            List <NavItem>         navItems  = _navItemRepository.Get().ToList();
            PageRouteEditViewModel viewModel = new PageRouteEditViewModel(navItems);

            viewModel = pageRouteVersion.MapToPageRouteViewModel(viewModel);

            ViewBag.ApprovalId = approvalId;

            return(View(viewModel));
        }