public JsonPager <CompoundInfo> PageComoundList(CompoundQInfo qInfo) { Sql sql = new Sql("select * from [dbo].[CompoundLibrary] where 1 = 1 "); Page <CompoundInfo> pagedata = _db.Page <CompoundInfo>(qInfo.Page, qInfo.ItemsPerPage, sql); JsonPager <CompoundInfo> ret = new JsonPager <CompoundInfo>(); ret.result = pagedata.Items; ret.total = pagedata.TotalItems; return(ret); }
public JsonPager <Employee> PageUser(EmployeeQryInfo qInfo) { Sql sql = new Sql("select badge,name UserName,[compid] Company,[depcname] Department from [users] where status<>'Loff'"); if (!string.IsNullOrEmpty(qInfo.UserName)) { sql.Append(" and name like @0", "%" + qInfo.UserName + "%"); } if (qInfo.OrderBy != null && qInfo.OrderBy.Length > 0) { sql.AddOrderBy(qInfo.OrderBy); } ; var pageData = _db.Page <Employee>(qInfo.Page, qInfo.ItemsPerPage, sql); JsonPager <Employee> ret = new JsonPager <Employee>(); ret.result = pageData.Items; ret.total = pageData.TotalItems; return(ret); }