/// <summary> /// Loads a collection of WorkplaceZone objects from the database. /// </summary> /// <returns>A collection containing all of the WorkplaceZone objects in the database.</returns> public static WorkplaceZoneCollection LoadCollection(string spName, SqlParameter[] parms) { WorkplaceZoneCollection result = new WorkplaceZoneCollection(); using (SqlDataReader reader = SqlHelper.Default.ExecuteReader(spName, parms)) { while (reader.Read()) { WorkplaceZone tmp = new WorkplaceZone(); tmp.LoadFromReader(reader); result.Add(tmp); } } return(result); }
/// <summary> /// Loads a WorkplaceZone object from the database using the given where clause /// </summary> /// <param name="whereClause">The filter expression for the query</param> /// <returns>A WorkplaceZone object</returns> public static WorkplaceZone LoadWhere(string whereClause) { SqlParameter[] parameterValues = new SqlParameter[] { new SqlParameter("@WhereClause", whereClause) }; using (SqlDataReader reader = SqlHelper.Default.ExecuteReader("spWorkplaceZone_SelAll", parameterValues)) { if (reader.Read()) { WorkplaceZone result = new WorkplaceZone(); result.LoadFromReader(reader); return(result); } else { return(null); } } }
/// <summary> /// Loads a WorkplaceZone object from the database using the given ZoneId /// </summary> /// <param name="zoneId">The primary key value</param> /// <returns>A WorkplaceZone object</returns> public static WorkplaceZone Load(Guid zoneId) { SqlParameter[] parameterValues = new SqlParameter[] { new SqlParameter("@ZoneId", zoneId) }; using (SqlDataReader reader = SqlHelper.Default.ExecuteReader("spWorkplaceZone_SelRec", parameterValues)) { if (reader.Read()) { WorkplaceZone result = new WorkplaceZone(); result.LoadFromReader(reader); return(result); } else { return(null); } } }