public ActionResult LoadSources(SYSMArticleSearch condition) { PageJsonModel <SYSMArticle> page = new PageJsonModel <SYSMArticle>(); page.pageIndex = condition.pageIndex; page.pageSize = condition.pageSize; page.strForm = string.Format(" SYSMArticle "); page.strSelect = " * "; page.strWhere = " and Title<>'' "; if (condition.dayType == "today") { page.strWhere += string.Format(" and DatEdit>='{0}' ", DateTime.Now.ToString("yyyy-MM-dd 00:00:00")); } if (condition.dayType == "history") { page.strWhere += string.Format(" and DatEdit<'{0}' ", DateTime.Now.ToString("yyyy-MM-dd 00:00:00")); } page.strOrder = "DatEdit desc"; page.LoadList(); return(Json(page.pageResponse, JsonRequestBehavior.AllowGet)); }
private string StrWhere(SYSMArticleSearch condition) { string where = string.Empty; if (!string.IsNullOrWhiteSpace(condition.Title)) { where += string.Format(" and Title ='{0}'", condition.Title); } return(where); }
public ActionResult GetPage(SYSMArticleSearch condition) { string where = StrWhere(condition); PageJsonModel <SYSMArticle> page = new PageJsonModel <SYSMArticle>(); page.pageIndex = condition.pageIndex; page.pageSize = condition.pageSize; page.strForm = " SYSMArticle "; page.strSelect = " * "; page.strWhere = where; page.strOrder = "DatEdit desc"; page.LoadList(); return(Json(page.pageResponse, JsonRequestBehavior.AllowGet)); }