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