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

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