/// <summary> /// 列表 /// </summary> /// <param name="setting"></param> /// <returns></returns> public static IPageOfList <JobInfo> List(JobSearchSetting setting) { FastPaging fp = new FastPaging(); fp.PageIndex = setting.PageIndex; fp.PageSize = setting.PageSize; fp.Ascending = false; fp.TableName = "Job"; fp.TableReName = "p"; fp.PrimaryKey = "ID"; fp.QueryFields = "p.*"; fp.OverOrderBy = " IsHot DESC,Sort DESC ,CreateDateTime DESC"; fp.WithOptions = " WITH(NOLOCK)"; fp.Condition = " IsDeleted = 0"; if (setting.IsOnlyShowPublished) { fp.Condition += " AND IsPublished = 1 "; } IList <JobInfo> list = new List <JobInfo>(); DataTable dt = Goodspeed.Library.Data.SQLPlus.ExecuteDataTable(CommandType.Text, fp.Build2005()); if (dt != null && dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { list.Add(GetByRow(dr)); } } int count = Convert.ToInt32(Goodspeed.Library.Data.SQLPlus.ExecuteScalar(CommandType.Text, fp.BuildCountSQL()));; return(new PageOfList <JobInfo>(list, setting.PageIndex, setting.PageSize, count)); }
/// <summary> /// 列表 /// </summary> /// <param name="setting"></param> /// <returns></returns> public static IPageOfList<JobInfo> List(JobSearchSetting setting) { FastPaging fp = new FastPaging(); fp.PageIndex = setting.PageIndex; fp.PageSize = setting.PageSize; fp.Ascending = false; fp.TableName = "Job"; fp.TableReName = "p"; fp.PrimaryKey = "ID"; fp.QueryFields = "p.*"; fp.OverOrderBy = " IsHot DESC,Sort DESC ,CreateDateTime DESC"; fp.WithOptions = " WITH(NOLOCK)"; fp.Condition = " IsDeleted = 0"; if(setting.IsOnlyShowPublished){ fp.Condition += " AND IsPublished = 1 "; } IList<JobInfo> list = new List<JobInfo>(); DataTable dt = Goodspeed.Library.Data.SQLPlus.ExecuteDataTable(CommandType.Text, fp.Build2005()); if (dt != null && dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { list.Add(GetByRow(dr)); } } int count = Convert.ToInt32(Goodspeed.Library.Data.SQLPlus.ExecuteScalar(CommandType.Text, fp.BuildCountSQL())); ; return new PageOfList<JobInfo>(list, setting.PageIndex, setting.PageSize, count); }
/// <summary> /// 列表 /// </summary> /// <param name="setting"></param> /// <returns></returns> public static IPageOfList <JobInfo> List(JobSearchSetting setting) { return(JobManage.List(setting)); }
/// <summary> /// 列表 /// </summary> /// <param name="setting"></param> /// <returns></returns> public static IPageOfList<JobInfo> List(JobSearchSetting setting) { return JobManage.List(setting); }