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

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