Example #1
0
        public async Task <IActionResult> Deleted()
        {
            var user = await this.userManager.GetUserAsync(this.User);

            var result = this.articleService.GetAllByAtuthorIdDeleted <IndexArticleViewModel>(user.Id);
            var model  = new IndexArticlesViewModel()
            {
                Articles = result,
            };

            return(this.View(model));
        }
Example #2
0
        public async Task <IActionResult> Deleted(int page = 1)
        {
            var skip = this.pagingService.CountSkip(page, GlobalConstants.AdministrationItemsPerPage);

            var user = await this.userManager.GetUserAsync(this.User);

            var result = this.articleService.GetAllByAtuthorIdDeleted <IndexArticleViewModel>(user.Id, GlobalConstants.AdministrationItemsPerPage, skip);

            var articlesCount = this.articleService.GetCountByAuthorIdDeleted(user.Id);

            var model = new IndexArticlesViewModel()
            {
                Articles   = result,
                PagesCount = this.pagingService.PagesCount(articlesCount, GlobalConstants.AdministrationItemsPerPage),
            };

            model.CurrentPage = this.pagingService.SetPage(page, model.PagesCount);

            return(this.View(model));
        }