Ejemplo n.º 1
0
        /// <summary>
        /// Loads a collection of MemberClass objects from the database.
        /// </summary>
        /// <returns>A collection containing all of the MemberClass objects in the database.</returns>
        public static MemberClassCollection LoadCollection(string spName, SqlParameter[] parms)
        {
            MemberClassCollection result = new MemberClassCollection();

            using (SqlDataReader reader = SqlHelper.Default.ExecuteReader(spName, parms))
            {
                while (reader.Read())
                {
                    MemberClass tmp = new MemberClass();
                    tmp.LoadFromReader(reader);
                    result.Add(tmp);
                }
            }
            return(result);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Loads a MemberClass object from the database using the given where clause
 /// </summary>
 /// <param name="whereClause">The filter expression for the query</param>
 /// <returns>A MemberClass object</returns>
 public static MemberClass LoadWhere(string whereClause)
 {
     SqlParameter[] parameterValues = new SqlParameter[] { new SqlParameter("@WhereClause", whereClause) };
     using (SqlDataReader reader = SqlHelper.Default.ExecuteReader("spMemberClass_SelAll", parameterValues))
     {
         if (reader.Read())
         {
             MemberClass result = new MemberClass();
             result.LoadFromReader(reader);
             return(result);
         }
         else
         {
             return(null);
         }
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Loads a MemberClass object from the database using the given ClassId
 /// </summary>
 /// <param name="classId">The primary key value</param>
 /// <returns>A MemberClass object</returns>
 public static MemberClass Load(Guid classId)
 {
     SqlParameter[] parameterValues = new SqlParameter[] { new SqlParameter("@ClassId", classId) };
     using (SqlDataReader reader = SqlHelper.Default.ExecuteReader("spMemberClass_SelRec", parameterValues))
     {
         if (reader.Read())
         {
             MemberClass result = new MemberClass();
             result.LoadFromReader(reader);
             return(result);
         }
         else
         {
             return(null);
         }
     }
 }