Exemple #1
0
        public IList<Core.Business.GraduationInfo> GetAllGraduationInfo()
        {
            IList<Core.Business.GraduationInfo> graduationInfolist = new List<Core.Business.GraduationInfo>();
            SqlServerUtility sql = new SqlServerUtility();

            SqlDataReader reader = sql.ExecuteSqlReader(SqlGetAllGraduationInfo);

            if (reader != null)
            {
                while (reader.Read())
                {
                    Core.Business.GraduationInfo graduationInfo = new Core.Business.GraduationInfo();

                    if (!reader.IsDBNull(0)) graduationInfo.Id = reader.GetInt32(0);
                    if (!reader.IsDBNull(1)) graduationInfo.StdCode = reader.GetString(1);
                    if (!reader.IsDBNull(2)) graduationInfo.EmployDate = reader.GetDateTime(2);
                    if (!reader.IsDBNull(3)) graduationInfo.EntCode = reader.GetString(3);
                    if (!reader.IsDBNull(4)) graduationInfo.EntName = reader.GetString(4);
                    if (!reader.IsDBNull(5)) graduationInfo.ProDate = reader.GetDateTime(5);
                    if (!reader.IsDBNull(6)) graduationInfo.AddDate = reader.GetDateTime(6);
                    if (!reader.IsDBNull(7)) graduationInfo.EmployCate = reader.GetString(7);
                    if (!reader.IsDBNull(8)) graduationInfo.AdderCode = reader.GetString(8);
                    if (!reader.IsDBNull(9)) graduationInfo.ProtcolCode = reader.GetString(9);

                    graduationInfo.MarkOld();
                    graduationInfolist.Add(graduationInfo);
                }
                reader.Close();
                return graduationInfolist;
            }
            else
            {

                if (reader != null && !reader.IsClosed)
                    reader.Close();
                return null;
            }
        }
Exemple #2
0
        public IList<Core.Business.GraduationInfo> GetGraduationInfoList(string strWhere)
        {
            IList<Core.Business.GraduationInfo> graduationInfolist = new List<Core.Business.GraduationInfo>();
            SqlServerUtility sql = new SqlServerUtility();
            StringBuilder sb = new StringBuilder();
            sb.Append(SqlGetGraduationInfoList);
            if (!string.IsNullOrEmpty(strWhere))
                sb.Append(" AND " + strWhere);
            SqlDataReader reader = sql.ExecuteSqlReader(sb.ToString());
            if (reader != null && !reader.IsClosed)
            {
                while (reader.Read())
                {
                    Core.Business.GraduationInfo graduationInfo = new Core.Business.GraduationInfo();

                    if (!reader.IsDBNull(0)) graduationInfo.Id = reader.GetInt32(0);
                    if (!reader.IsDBNull(1)) graduationInfo.StdCode = reader.GetString(1);
                    if (!reader.IsDBNull(2)) graduationInfo.EmployDate = reader.GetDateTime(2);
                    if (!reader.IsDBNull(3)) graduationInfo.EntCode = reader.GetString(3);
                    if (!reader.IsDBNull(4)) graduationInfo.EntName = reader.GetString(4);
                    if (!reader.IsDBNull(5)) graduationInfo.ProDate = reader.GetDateTime(5);
                    if (!reader.IsDBNull(6)) graduationInfo.AddDate = reader.GetDateTime(6);
                    if (!reader.IsDBNull(7)) graduationInfo.EmployCate = reader.GetString(7);
                    if (!reader.IsDBNull(8)) graduationInfo.AdderCode = reader.GetString(8);
                    if (!reader.IsDBNull(9)) graduationInfo.ProtcolCode = reader.GetString(9);
                    if (!reader.IsDBNull(10)) graduationInfo.ClassName = reader.GetString(10);
                    if (!reader.IsDBNull(11)) graduationInfo.GradeCode = reader.GetString(11);

                    graduationInfo.MarkOld();

                    graduationInfolist.Add(graduationInfo);
                }
                reader.Close();

                return graduationInfolist;
            }
            else
            {

                if (reader != null && !reader.IsClosed)
                    reader.Close();
                return null;
            }
        }
Exemple #3
0
        public Core.Business.GraduationInfo Select(int id)
        {
            SqlServerUtility sql = new SqlServerUtility();

            sql.AddParameter("@Id", SqlDbType.Int, id);
            SqlDataReader reader = sql.ExecuteSqlReader(SqlSelectGraduationInfo);

            if (reader != null && !reader.IsClosed && reader.Read())
            {
                Core.Business.GraduationInfo graduationInfo = new Core.Business.GraduationInfo();

                if (!reader.IsDBNull(0)) graduationInfo.Id = reader.GetInt32(0);
                if (!reader.IsDBNull(1)) graduationInfo.StdCode = reader.GetString(1);
                if (!reader.IsDBNull(2)) graduationInfo.EmployDate = reader.GetDateTime(2);
                if (!reader.IsDBNull(3)) graduationInfo.EntCode = reader.GetString(3);
                if (!reader.IsDBNull(4)) graduationInfo.EntName = reader.GetString(4);
                if (!reader.IsDBNull(5)) graduationInfo.ProDate = reader.GetDateTime(5);
                if (!reader.IsDBNull(6)) graduationInfo.AddDate = reader.GetDateTime(6);
                if (!reader.IsDBNull(7)) graduationInfo.EmployCate = reader.GetString(7);
                if (!reader.IsDBNull(8)) graduationInfo.AdderCode = reader.GetString(8);
                if (!reader.IsDBNull(9)) graduationInfo.ProtcolCode = reader.GetString(9);

                reader.Close();
                return graduationInfo;
            }
            else
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();

                return null;
            }
        }