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