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