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