public JsonResult ActivityData() { int pageSize = int.Parse(Request["pageSize"] ?? "5"); int pageIndex = int.Parse(Request["pageIndex"] ?? "1"); int OrgId = int.Parse(Request["OrgId"] ?? "-1"); int TimeType = int.Parse(Request["TimeType"] ?? "1"); DateTime dt = DateTime.Now; DateTime Start; if (TimeType == 1) { Start = DateTime.Parse(dt.ToString("yyyy-MM")); } else { Start = new DateTime(dt.Year, 1, 1); } DateTime End = DateTime.Now; var PageData = ActivityDetailService.GetTopCache(OrgId, Start, End, pageSize, pageIndex, out int total); if (PageData.Count() > 0) { return(Json(new { msg = "success", data = PageData }, JsonRequestBehavior.AllowGet)); } else { return(Json(new { msg = "fail", total })); } }
public JsonResult OrgActivityData() { int pageSize = int.Parse(Request["pageSize"] ?? "5"); int pageIndex = int.Parse(Request["pageIndex"] ?? "1"); int OrgId = int.Parse(Request["OrgId"] ?? "-1"); DateTime Start = DateTime.Parse(Request["Start"]); DateTime End = DateTime.Parse(Request["End"]).AddDays(1); var PageData = ActivityDetailService.GetTopCache(OrgId, Start, End, pageSize, pageIndex, out int total); return(Json(new { total, rows = PageData.ToList() }, JsonRequestBehavior.AllowGet)); }