Exemplo n.º 1
0
        /// <summary>
        /// Loads a collection of InvtLedgerHeader objects from the database.
        /// </summary>
        /// <returns>A collection containing all of the InvtLedgerHeader objects in the database.</returns>
        public static InvtLedgerHeaderCollection LoadCollection(string spName, SqlParameter[] parms)
        {
            InvtLedgerHeaderCollection result = new InvtLedgerHeaderCollection();

            using (SqlDataReader reader = SqlHelper.Default.ExecuteReader(spName, parms))
            {
                while (reader.Read())
                {
                    InvtLedgerHeader tmp = new InvtLedgerHeader();
                    tmp.LoadFromReader(reader);
                    result.Add(tmp);
                }
            }
            return(result);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Loads a InvtLedgerHeader object from the database using the given where clause
 /// </summary>
 /// <param name="whereClause">The filter expression for the query</param>
 /// <returns>A InvtLedgerHeader object</returns>
 public static InvtLedgerHeader LoadWhere(string whereClause)
 {
     SqlParameter[] parameterValues = new SqlParameter[] { new SqlParameter("@WhereClause", whereClause) };
     using (SqlDataReader reader = SqlHelper.Default.ExecuteReader("spInvtLedgerHeader_SelAll", parameterValues))
     {
         if (reader.Read())
         {
             InvtLedgerHeader result = new InvtLedgerHeader();
             result.LoadFromReader(reader);
             return(result);
         }
         else
         {
             return(null);
         }
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Loads a InvtLedgerHeader object from the database using the given HeaderId
 /// </summary>
 /// <param name="headerId">The primary key value</param>
 /// <returns>A InvtLedgerHeader object</returns>
 public static InvtLedgerHeader Load(Guid headerId)
 {
     SqlParameter[] parameterValues = new SqlParameter[] { new SqlParameter("@HeaderId", headerId) };
     using (SqlDataReader reader = SqlHelper.Default.ExecuteReader("spInvtLedgerHeader_SelRec", parameterValues))
     {
         if (reader.Read())
         {
             InvtLedgerHeader result = new InvtLedgerHeader();
             result.LoadFromReader(reader);
             return(result);
         }
         else
         {
             return(null);
         }
     }
 }