示例#1
0
        public JsonResult GetCounts()
        {
            CountDTO dto = new CountDTO();

            dto = bll.GetCounts();
            return(Json(dto, JsonRequestBehavior.AllowGet));
        }
示例#2
0
        public CountDTO GetCounts()
        {
            CountDTO dto = new CountDTO();

            dto.MessageCount = dao.GetMessageCount();
            dto.CommentCount = dao.GetCommentCount();
            return(dto);
        }
示例#3
0
        public ActionResult PostList()
        {
            CountDTO countDTO = new CountDTO();

            countDTO = bll.GetAllCounts();
            ViewData["AllCounts"] = countDTO;
            List <PostDTO> postList = new List <PostDTO>();

            postList = bll.GetPosts();
            return(View(postList));
        }
示例#4
0
        public CountDTO GetAllCounts()
        {
            CountDTO dto = new CountDTO();

            using (POSTDATAEntities db = new POSTDATAEntities())
            {
                dto.CommentCount = db.Comments.Where(x => x.isDeleted == false).Count();
                dto.MessageCount = db.Contacts.Where(x => x.isDeleted == false).Count();
                dto.PostCount    = db.Posts.Where(x => x.isDeleted == false).Count();
                dto.ViewCount    = db.Posts.Where(x => x.isDeleted == false).Sum(x => x.ViewCount);
            }
            return(dto);
        }
示例#5
0
        // GET: Admin/Dash
        public ActionResult Index()
        {
            var vm = new DashIndexViewModel();

            vm.StockLatest = DashService.GetLatestStocks();
            CountDTO cdto = DashService.GetStockMemberCount();

            vm.StockTodayCount    = cdto.StockTodayCount;
            vm.StockMonthCount    = cdto.StockMonthCount;
            vm.MemberTodayCount   = cdto.MemberTodayCount;
            vm.MemberMonthCount   = cdto.MemberMonthCount;
            vm.StockMonthlyCount  = DashService.GetStockMonthlyCount();
            vm.MemberMonthlyCount = DashService.GetMemberMonthlyCount();

            return(View(vm));
        }