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