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