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

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