public IList<Core.Business.ScoreInPratise> GetAllScoreInPratise() { IList<Core.Business.ScoreInPratise> scoreInPratiselist = new List<Core.Business.ScoreInPratise>(); SqlServerUtility sql = new SqlServerUtility(); SqlDataReader reader = sql.ExecuteSqlReader(SqlGetAllScoreInPratise); if(reader != null) { while(reader.Read()) { Core.Business.ScoreInPratise scoreInPratise = new Core.Business.ScoreInPratise(); if (!reader.IsDBNull(0)) scoreInPratise.Id = reader.GetInt32(0); if (!reader.IsDBNull(1)) scoreInPratise.StudentCode = reader.GetString(1); if (!reader.IsDBNull(2)) scoreInPratise.YearNum = reader.GetString(2); if (!reader.IsDBNull(3)) scoreInPratise.Term = reader.GetInt32(3); if (!reader.IsDBNull(4)) scoreInPratise.ScoreNum = reader.GetDecimal(4); if (!reader.IsDBNull(5)) scoreInPratise.ScoreCate = reader.GetString(5); if (!reader.IsDBNull(6)) scoreInPratise.PracticeId = reader.GetInt32(6); scoreInPratise.MarkOld(); scoreInPratiselist.Add(scoreInPratise); } reader.Close(); } return scoreInPratiselist; }
public IList<Core.Business.ScoreInPratise> GetScoreInPratiseByTime(string strWhere) { StringBuilder sb = new StringBuilder(); sb.Append(SqlGetAllScoreInPratise); if (!string.IsNullOrEmpty(strWhere)) sb.Append(" where " + strWhere); IList<Core.Business.ScoreInPratise> scoreInPratiselist = new List<Core.Business.ScoreInPratise>(); SqlServerUtility sql = new SqlServerUtility(); SqlDataReader reader = sql.ExecuteSqlReader(sb.ToString()); if (reader != null) { while (reader.Read()) { Core.Business.ScoreInPratise scoreInPratise = new Core.Business.ScoreInPratise(); if (!reader.IsDBNull(0)) scoreInPratise.Id = reader.GetInt32(0); if (!reader.IsDBNull(1)) scoreInPratise.StudentCode = reader.GetString(1); if (!reader.IsDBNull(2)) scoreInPratise.YearNum = reader.GetString(2); if (!reader.IsDBNull(3)) scoreInPratise.Term = reader.GetInt32(3); if (!reader.IsDBNull(4)) scoreInPratise.ScoreNum = reader.GetDecimal(4); if (!reader.IsDBNull(5)) scoreInPratise.ScoreCate = reader.GetString(5); if (!reader.IsDBNull(6)) scoreInPratise.PracticeId = reader.GetInt32(6); scoreInPratise.MarkOld(); scoreInPratiselist.Add(scoreInPratise); } reader.Close(); } return scoreInPratiselist; }