예제 #1
0
        /// <summary>
        /// Loads a collection of InvtLedgerDetails objects from the database.
        /// </summary>
        /// <returns>A collection containing all of the InvtLedgerDetails objects in the database.</returns>
        public static InvtLedgerDetailsCollection LoadCollection(string spName, SqlParameter[] parms)
        {
            InvtLedgerDetailsCollection result = new InvtLedgerDetailsCollection();

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