Пример #1
0
        /// <summary>
        /// Loads a collection of PurchaseOrderReceiveHeader objects from the database.
        /// </summary>
        /// <returns>A collection containing all of the PurchaseOrderReceiveHeader objects in the database.</returns>
        public static PurchaseOrderReceiveHeaderCollection LoadCollection(string spName, SqlParameter[] parms)
        {
            PurchaseOrderReceiveHeaderCollection result = new PurchaseOrderReceiveHeaderCollection();

            using (SqlDataReader reader = SqlHelper.Default.ExecuteReader(spName, parms))
            {
                while (reader.Read())
                {
                    PurchaseOrderReceiveHeader tmp = new PurchaseOrderReceiveHeader();
                    tmp.LoadFromReader(reader);
                    result.Add(tmp);
                }
            }
            return(result);
        }
Пример #2
0
 /// <summary>
 /// Loads a PurchaseOrderReceiveHeader object from the database using the given where clause
 /// </summary>
 /// <param name="whereClause">The filter expression for the query</param>
 /// <returns>A PurchaseOrderReceiveHeader object</returns>
 public static PurchaseOrderReceiveHeader LoadWhere(string whereClause)
 {
     SqlParameter[] parameterValues = new SqlParameter[] { new SqlParameter("@WhereClause", whereClause) };
     using (SqlDataReader reader = SqlHelper.Default.ExecuteReader("spPurchaseOrderReceiveHeader_SelAll", parameterValues))
     {
         if (reader.Read())
         {
             PurchaseOrderReceiveHeader result = new PurchaseOrderReceiveHeader();
             result.LoadFromReader(reader);
             return(result);
         }
         else
         {
             return(null);
         }
     }
 }
Пример #3
0
 /// <summary>
 /// Loads a PurchaseOrderReceiveHeader object from the database using the given ReceiveHeaderId
 /// </summary>
 /// <param name="receiveHeaderId">The primary key value</param>
 /// <returns>A PurchaseOrderReceiveHeader object</returns>
 public static PurchaseOrderReceiveHeader Load(Guid receiveHeaderId)
 {
     SqlParameter[] parameterValues = new SqlParameter[] { new SqlParameter("@ReceiveHeaderId", receiveHeaderId) };
     using (SqlDataReader reader = SqlHelper.Default.ExecuteReader("spPurchaseOrderReceiveHeader_SelRec", parameterValues))
     {
         if (reader.Read())
         {
             PurchaseOrderReceiveHeader result = new PurchaseOrderReceiveHeader();
             result.LoadFromReader(reader);
             return(result);
         }
         else
         {
             return(null);
         }
     }
 }