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