Пример #1
0
        public async Task <IActionResult> About()
        {
            var model = new HomeAboutViewModel
            {
                Banner = await _db.Banners.FirstOrDefaultAsync(),
                About  = await _db.Abouts.FirstOrDefaultAsync()
            };

            return(View(model));
        }
Пример #2
0
        public async Task <ActionResult> About()
        {
            HomeAboutViewModel model = new HomeAboutViewModel();

            model.Address = await settingService.GetModelByNameAsync("公司地址");

            model.Phone = await settingService.GetModelByNameAsync("客服电话");

            model.Logo = await settingService.GetModelByNameAsync("系统LOGO");

            model.About = await settingService.GetModelByNameAsync("关于我们");

            return(View(model));
        }
Пример #3
0
        public async Task <IActionResult> About()
        {
            var postsReactionsCount = await this.postReactionsService.GetTotalCountAsync();

            var repliesReactionsCount = await this.replyReactionsService.GetTotalCountAsync();

            var reactionsCount = postsReactionsCount + repliesReactionsCount;
            var postsCount     = await this.postsService.GetCountAsync();

            var usersCount = await this.usersService.GetTotalCountAsync();

            var admins = await this.usersService.GetAdminsAsync <HomeAdminViewModel>();

            var viewModel = new HomeAboutViewModel
            {
                ReactionsCount = reactionsCount,
                PostsCount     = postsCount,
                UsersCount     = usersCount,
                Admins         = admins
            };

            return(this.View(viewModel));
        }
Пример #4
0
        public ActionResult About()
        {
            var model = new HomeAboutViewModel();

            return View(model);
        }