Example #1
0
        public IList<Core.Business.ConductInfo> GetAllConductInfo()
        {
            IList<Core.Business.ConductInfo> conductInfolist = new List<Core.Business.ConductInfo>();
            SqlServerUtility sql = new SqlServerUtility();

            SqlDataReader reader = sql.ExecuteSqlReader(SqlGetAllConductInfo);

            if(reader != null)
            {
                while(reader.Read())
                {
                    Core.Business.ConductInfo conductInfo = new Core.Business.ConductInfo();

                    if (!reader.IsDBNull(0)) conductInfo.Id = reader.GetInt32(0);
                    if (!reader.IsDBNull(1)) conductInfo.StdCode = reader.GetString(1);
                    if (!reader.IsDBNull(2)) conductInfo.YearNum = reader.GetString(2);
                    if (!reader.IsDBNull(3)) conductInfo.Grade = reader.GetString(3);
                    if (!reader.IsDBNull(4)) conductInfo.Term = reader.GetInt32(4);
                    if (!reader.IsDBNull(5)) conductInfo.CndtScore = reader.GetInt32(5);
                    if (!reader.IsDBNull(6)) conductInfo.CndtPeerCode = reader.GetString(6);
                    if (!reader.IsDBNull(7)) conductInfo.CndtPeerName = reader.GetString(7);
                    if (!reader.IsDBNull(8)) conductInfo.CndtWeek = reader.GetInt32(8);
                    if (!reader.IsDBNull(9)) conductInfo.CndtType = reader.GetString(9);

                    conductInfo.MarkOld();
                    conductInfolist.Add(conductInfo);
                }
                reader.Close();
            }
            return conductInfolist;
        }
Example #2
0
        public IList<Core.Business.ConductInfo> GetAvgScore(string year,int term,string grade)
        {
            IList<Core.Business.ConductInfo> conductInfolist = new List<Core.Business.ConductInfo>();
            SqlServerUtility sql = new SqlServerUtility();
            sql.AddParameter("@Year", SqlDbType.NVarChar, year);
            sql.AddParameter("@Term", SqlDbType.Int, term);
            sql.AddParameter("@Grade", SqlDbType.NVarChar, grade);
            SqlDataReader reader = sql.ExecuteSqlReader(SqlGetAvgScore);

            if (reader != null)
            {
                while (reader.Read())
                {
                    Core.Business.ConductInfo conductInfo = new Core.Business.ConductInfo();

                    if (!reader.IsDBNull(0)) conductInfo.AvgScore = reader.GetDecimal(0);
                    if (!reader.IsDBNull(1)) conductInfo.StdCode = reader.GetString(1);
                    if (!reader.IsDBNull(2)) conductInfo.YearNum = reader.GetString(2);
                    if (!reader.IsDBNull(3)) conductInfo.Grade = reader.GetString(3);
                    if (!reader.IsDBNull(4)) conductInfo.Term = reader.GetInt32(4);

                    conductInfo.MarkOld();

                    conductInfolist.Add(conductInfo);
                }
                reader.Close();
            }
            else
            {
                return null;
            }
            return conductInfolist;
        }
Example #3
0
        public IList<Core.Business.ConductInfo> GetListByQuery(string wherestr)
        {
            IList<Core.Business.ConductInfo> conductInfolist = new List<Core.Business.ConductInfo>();
            SqlServerUtility sql = new SqlServerUtility();
            StringBuilder sb = new StringBuilder();
            sb.Append(SqlGetListByQuery);
            if (!string.IsNullOrEmpty(wherestr))
            {
                sb.Append(" Where 1=1 AND " +wherestr);
            }
            SqlDataReader reader = sql.ExecuteSqlReader(sb.ToString());

            if (reader != null)
            {
                while (reader.Read())
                {
                    Core.Business.ConductInfo conductInfo = new Core.Business.ConductInfo();

                    if (!reader.IsDBNull(0)) conductInfo.Id = reader.GetInt32(0);
                    if (!reader.IsDBNull(1)) conductInfo.StdCode = reader.GetString(1);
                    if (!reader.IsDBNull(2)) conductInfo.YearNum = reader.GetString(2);
                    if (!reader.IsDBNull(3)) conductInfo.Grade = reader.GetString(3);
                    if (!reader.IsDBNull(4)) conductInfo.Term = reader.GetInt32(4);
                    if (!reader.IsDBNull(5)) conductInfo.CndtScore = reader.GetInt32(5);
                    if (!reader.IsDBNull(6)) conductInfo.CndtPeerCode = reader.GetString(6);
                    if (!reader.IsDBNull(7)) conductInfo.CndtPeerName = reader.GetString(7);
                    if (!reader.IsDBNull(8)) conductInfo.CndtWeek = reader.GetInt32(8);
                    if (!reader.IsDBNull(9)) conductInfo.CndtType = reader.GetString(9);

                    conductInfo.MarkOld();

                    conductInfolist.Add(conductInfo);
                }
                reader.Close();
            }
            else
            {
                return null;
            }
            return conductInfolist;
        }