/// <summary> /// job列表 /// </summary> /// <returns></returns> public List <Job_Info> GetJobList() { List <Job_Info> list = null; try { string SqlStr = "select * from job_info"; var ds = MySqlHelper.GetDataSet(SqlStr); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { list = new List <Job_Info>(); Job_Info info = new Job_Info(); foreach (System.Data.DataRow row in ds.Tables[0].Rows) { info = Job_Info.ToEntity <Job_Info>(row, info); if (info != null) { list.Add(info); } } } } finally { } return(list); }
/// <summary> /// job列表 /// </summary> /// <returns></returns> public List <Job_Info> GetJobList(int pageIndex, int pageSize) { List <Job_Info> list = null; try { string SqlStr = "select * from job_info"; SqlStr += string.Format(" limit {0},{1};", (pageIndex - 1) * pageSize, pageSize); var ds = MySqlHelper.GetDataSet(SqlStr); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { list = new List <Job_Info>(); Job_Info info = new Job_Info(); foreach (System.Data.DataRow row in ds.Tables[0].Rows) { info = Job_Info.ToEntity <Job_Info>(row, info); if (info != null) { list.Add(info); } } } } finally { } return(list); }
public Job_Info GetOne(int id) { Job_Info job = null; try { string SqlStr = "select * from job_info where id=" + id; var ds = MySqlHelper.GetDataSet(SqlStr); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { job = new Job_Info(); foreach (System.Data.DataRow row in ds.Tables[0].Rows) { job = Job_Info.ToEntity <Job_Info>(row, job); } } } catch (Exception ex) { } return(job); }