/// <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); }
/// <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); } } }
/// <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); } } }