public IList<CurriculmArrange> Fill(string QueryParam) { if (string.IsNullOrEmpty(QueryParam)) { return null; } IList<Core.Business.CurriculmArrange> curriculmArrangelist = new List<Core.Business.CurriculmArrange>(); SqlServerUtility sql = new SqlServerUtility(); SqlDataReader reader = sql.ExecuteSqlReader(SqlFillCurriculmArrange + QueryParam); if (reader != null) { while (reader.Read()) { Core.Business.CurriculmArrange curriculmArrange = new Core.Business.CurriculmArrange(); if (!reader.IsDBNull(0)) curriculmArrange.Term = reader.GetInt32(0); if (!reader.IsDBNull(1)) curriculmArrange.ClassCode = reader.GetString(1); if (!reader.IsDBNull(2)) curriculmArrange.Year = reader.GetString(2); curriculmArrange.MarkOld(); curriculmArrangelist.Add(curriculmArrange); } reader.Close(); } return curriculmArrangelist; }
public IList<CurriculmArrange> Fill(ClassInfo classInfo, string year, int term) { if (classInfo == null || string.IsNullOrEmpty(year) || term <= 0) { return null; } IList<Core.Business.CurriculmArrange> curriculmArrangelist = new List<Core.Business.CurriculmArrange>(); SqlServerUtility sql = new SqlServerUtility(); sql.AddParameter("@ClassCode", SqlDbType.NVarChar, classInfo.ClassCode, 30); sql.AddParameter("@Term", SqlDbType.Int, term); sql.AddParameter("@Year", SqlDbType.NVarChar, year); SqlDataReader reader = sql.ExecuteSqlReader(SqlFillCurriculmArrangeList); if (reader != null) { while (reader.Read()) { Core.Business.CurriculmArrange curriculmArrange = new Core.Business.CurriculmArrange(); if (!reader.IsDBNull(0)) curriculmArrange.Id = reader.GetInt32(0); if (!reader.IsDBNull(1)) curriculmArrange.CourseTime = reader.GetInt32(1); if (!reader.IsDBNull(2)) curriculmArrange.Term = reader.GetInt32(2); if (!reader.IsDBNull(3)) curriculmArrange.ClassCode = reader.GetString(3); if (!reader.IsDBNull(4)) curriculmArrange.CourseCode = reader.GetString(4); if (!reader.IsDBNull(5)) curriculmArrange.TeacherCode = reader.GetString(5); if (!reader.IsDBNull(6)) curriculmArrange.ClassRoomCode = reader.GetString(6); if (!reader.IsDBNull(7)) curriculmArrange.Year = reader.GetString(7); curriculmArrange.MarkOld(); curriculmArrangelist.Add(curriculmArrange); } reader.Close(); } return curriculmArrangelist; }
public IList<Core.Business.CurriculmArrange> GetAllCurriculmArrange() { IList<Core.Business.CurriculmArrange> curriculmArrangelist = new List<Core.Business.CurriculmArrange>(); SqlServerUtility sql = new SqlServerUtility(); SqlDataReader reader = sql.ExecuteSqlReader(SqlGetAllCurriculmArrange); if (reader != null) { while (reader.Read()) { Core.Business.CurriculmArrange curriculmArrange = new Core.Business.CurriculmArrange(); if (!reader.IsDBNull(0)) curriculmArrange.Id = reader.GetInt32(0); if (!reader.IsDBNull(1)) curriculmArrange.CourseTime = reader.GetInt32(1); if (!reader.IsDBNull(2)) curriculmArrange.Term = reader.GetInt32(2); if (!reader.IsDBNull(3)) curriculmArrange.ClassCode = reader.GetString(3); if (!reader.IsDBNull(4)) curriculmArrange.CourseCode = reader.GetString(4); if (!reader.IsDBNull(5)) curriculmArrange.TeacherCode = reader.GetString(5); if (!reader.IsDBNull(6)) curriculmArrange.ClassRoomCode = reader.GetString(6); if (!reader.IsDBNull(7)) curriculmArrange.Year = reader.GetString(7); curriculmArrange.MarkOld(); curriculmArrangelist.Add(curriculmArrange); } reader.Close(); } return curriculmArrangelist; }
public List<CY.GFive.Core.Business.CurriculmArrange> FillTeacher(string queryParam) { if (string.IsNullOrEmpty(queryParam)) { return null; } List<CY.GFive.Core.Business.CurriculmArrange> Teachers = new List<CY.GFive.Core.Business.CurriculmArrange>(); SqlServerUtility sql = new SqlServerUtility(); SqlDataReader reader = sql.ExecuteSqlReader(SqlFillCurriculmArrangeTeachers + queryParam); if (reader != null) { while (reader.Read()) { Core.Business.CurriculmArrange curriculmArrange = new Core.Business.CurriculmArrange(); if (!reader.IsDBNull(0)) curriculmArrange.TeacherCode = reader.GetString(0); if (!reader.IsDBNull(1)) curriculmArrange.Year = reader.GetString(1); if (!reader.IsDBNull(2)) curriculmArrange.Term = reader.GetInt32(2); curriculmArrange.MarkOld(); Teachers.Add(curriculmArrange); } reader.Close(); } return Teachers; }