Example #1
0
        public IList<Core.Business.StudentEx> GetAllStudentEx()
        {
            IList<Core.Business.StudentEx> studentExlist = new List<Core.Business.StudentEx>();
            SqlServerUtility sql = new SqlServerUtility();

            SqlDataReader reader = sql.ExecuteSqlReader(SqlGetAllStudentEx);

            if (reader != null)
            {
                while (reader.Read())
                {
                    Core.Business.StudentEx studentEx = new Core.Business.StudentEx();

                    if (!reader.IsDBNull(0)) studentEx.Id = reader.GetInt32(0);

                    if (!reader.IsDBNull(1)) studentEx.StdCode = reader.GetString(1);
                    if (!reader.IsDBNull(2)) studentEx.Interest = reader.GetString(2);
                    if (!reader.IsDBNull(3)) studentEx.CardCode = reader.GetString(3);
                    if (!reader.IsDBNull(4)) studentEx.ProfessLvl = reader.GetString(4);
                    if (!reader.IsDBNull(5)) studentEx.PreSchlLvl = reader.GetString(5);
                    if (!reader.IsDBNull(6)) studentEx.FamilyContator = reader.GetString(6);
                    if (!reader.IsDBNull(7)) studentEx.TotalRevenue = reader.GetDecimal(7);
                    if (!reader.IsDBNull(8)) studentEx.PeerRevenue = reader.GetDecimal(8);
                    if (!reader.IsDBNull(9)) studentEx.LowIncomer = reader.GetBoolean(9);
                    if (!reader.IsDBNull(10)) studentEx.InComeSource = reader.GetString(10);
                    if (!reader.IsDBNull(11)) studentEx.IsCCYL = reader.GetInt32(11);
                    if (!reader.IsDBNull(12)) studentEx.Connector = reader.GetString(12);
                    studentEx.MarkOld();
                    studentExlist.Add(studentEx);
                }
                reader.Close();
            }
            return studentExlist;
        }
Example #2
0
        public Core.Business.StudentEx GetStudentByCode(string stdCode)
        {
            SqlServerUtility sql = new SqlServerUtility();

            sql.AddParameter("@StdCode", SqlDbType.NVarChar, stdCode);
            SqlDataReader reader = sql.ExecuteSqlReader(SqlGetByCode);

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

                if (!reader.IsDBNull(0)) studentEx.Id = reader.GetInt32(0);

                if (!reader.IsDBNull(1)) studentEx.StdCode = reader.GetString(1);
                if (!reader.IsDBNull(2)) studentEx.Interest = reader.GetString(2);
                if (!reader.IsDBNull(3)) studentEx.CardCode = reader.GetString(3);
                if (!reader.IsDBNull(4)) studentEx.ProfessLvl = reader.GetString(4);
                if (!reader.IsDBNull(5)) studentEx.PreSchlLvl = reader.GetString(5);
                if (!reader.IsDBNull(6)) studentEx.FamilyContator = reader.GetString(6);
                if (!reader.IsDBNull(7)) studentEx.TotalRevenue = reader.GetDecimal(7);
                if (!reader.IsDBNull(8)) studentEx.PeerRevenue = reader.GetDecimal(8);
                if (!reader.IsDBNull(9)) studentEx.LowIncomer = reader.GetBoolean(9);
                if (!reader.IsDBNull(10)) studentEx.InComeSource = reader.GetString(10);
                if (!reader.IsDBNull(11)) studentEx.IsCCYL = reader.GetInt32(11);
                reader.Close();
                studentEx.MarkOld();
                return studentEx;
            }
            else
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();

                return null;
            }
        }