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

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