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