public JsonResult GetCounts() { CountDTO dto = new CountDTO(); dto = bll.GetCounts(); return(Json(dto, JsonRequestBehavior.AllowGet)); }
public CountDTO GetCounts() { CountDTO dto = new CountDTO(); dto.MessageCount = dao.GetMessageCount(); dto.CommentCount = dao.GetCommentCount(); return(dto); }
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)); }
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); }
// 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)); }