public ActionResult GetCMS_Article(int page, int rows, DateTime?stime, DateTime?etime) { int count = 0; if (stime.ToString() != "" || etime.ToString() != "") { count = d.CMS_Article.Where(a => a.ctime >= stime || a.ctime <= etime).Count(); } else { count = db.V_CMS_ArticleCount(); } Dictionary <string, object> dic = new Dictionary <string, object>(); dic.Add("total", count); dic.Add("rows", db.GetCMS_Articles(page, rows, stime, etime)); return(Json(dic, JsonRequestBehavior.AllowGet)); }