Beispiel #1
0
        public IList<TrGroupMember> Fill(TRGroup group)
        {
            if (group == null)
                return GetAllTrGroupMember();

            IList<Core.Business.TrGroupMember> trGroupMemberlist = new List<Core.Business.TrGroupMember>();

            SqlServerUtility sql = new SqlServerUtility();

            sql.AddParameter("@GroupCode", SqlDbType.NVarChar, group.TrGroupCode, 30);

            SqlDataReader reader = sql.ExecuteSqlReader(SqlFillTrGroupMemberByGroupCode);

            if (reader != null)
            {
                while (reader.Read())
                {
                    Core.Business.TrGroupMember trGroupMember = new Core.Business.TrGroupMember();

                    if (!reader.IsDBNull(0)) trGroupMember.Id = reader.GetInt32(0);
                    if (!reader.IsDBNull(1)) trGroupMember.TrGroup = reader.GetString(1);
                    if (!reader.IsDBNull(2)) trGroupMember.TeacherCode = reader.GetString(2);
                    if (!reader.IsDBNull(3)) trGroupMember.JoinDate = reader.GetDateTime(3);
                    if (!reader.IsDBNull(4)) trGroupMember.PositionTitle = reader.GetString(4);

                    trGroupMember.MarkOld();
                    trGroupMemberlist.Add(trGroupMember);
                }
                reader.Close();
            }
            return trGroupMemberlist;
        }
Beispiel #2
0
        public IList<Core.Business.TrGroupMember> GetAllTrGroupMember()
        {
            IList<Core.Business.TrGroupMember> trGroupMemberlist = new List<Core.Business.TrGroupMember>();
            SqlServerUtility sql = new SqlServerUtility();

            SqlDataReader reader = sql.ExecuteSqlReader(SqlGetAllTrGroupMember);

            if (reader != null)
            {
                while (reader.Read())
                {
                    Core.Business.TrGroupMember trGroupMember = new Core.Business.TrGroupMember();

                    if (!reader.IsDBNull(0)) trGroupMember.Id = reader.GetInt32(0);
                    if (!reader.IsDBNull(1)) trGroupMember.TrGroup = reader.GetString(1);
                    if (!reader.IsDBNull(2)) trGroupMember.TeacherCode = reader.GetString(2);
                    if (!reader.IsDBNull(3)) trGroupMember.JoinDate = reader.GetDateTime(3);
                    if (!reader.IsDBNull(4)) trGroupMember.PositionTitle = reader.GetString(4);

                    trGroupMember.MarkOld();
                    trGroupMemberlist.Add(trGroupMember);
                }
                reader.Close();
            }
            return trGroupMemberlist;
        }