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