Esempio n. 1
0
        public async Task <ActionResult> Index(int page = 1, string search = "")
        {
            ViewBag.sea = search;
            int                    pagesize      = 36;
            IArticleManger         articleManger = new ArticleManger();
            IUserMnager            userMnager    = new UserManger();
            List <UserInformation> usList        = await userMnager.GetAllUserByAdminUnder();

            ViewBag.alluser = usList;         //所有博主
            ViewBag.ucount  = usList.Count(); //统计博客数量
            List <CommentDto> coList = await articleManger.GetAllComment();

            ViewBag.coList = coList;
            ViewBag.ccount = coList.Count();    //统计评论数量
            List <BlogCategoryDto> cateList = await articleManger.GetAllBlogcategory();

            ViewBag.catecount         = cateList.Count();
            ViewBag.articleTocateList = await articleManger.GetAllArticleTocate();

            IAdminManger adminManger = new AdminManger();
            string       linkname    = "";
            string       desc        = "";

            ViewBag.links = await adminManger.GetAllLink(linkname, desc);

            //var data = await articleManger.GetAllArticle(search);
            var data = await articleManger.GetAllArticleIsFreeze(search);   //除开账号冻结发布的文章

            ViewBag.catelist = await articleManger.GetAllBlogcategory();

            return(View(data.ToPagedList <ArticleDto>(page, pagesize)));
        }
        public async Task <ActionResult> LinkIndex(int page = 1, string linkname = "", string desc = "")
        {
            int pagesize = 10;

            ViewBag.linkname = linkname;
            ViewBag.desc     = desc;
            IAdminManger adminManger = new AdminManger();
            var          links       = await adminManger.GetAllLink(linkname, desc);

            return(View(links.ToPagedList <LinkDto>(page, pagesize)));
        }