コード例 #1
0
        /// <summary>
        /// Loads a collection of ShipmentMethod objects from the database.
        /// </summary>
        /// <returns>A collection containing all of the ShipmentMethod objects in the database.</returns>
        public static ShipmentMethodCollection LoadCollection(string spName, SqlParameter[] parms)
        {
            ShipmentMethodCollection result = new ShipmentMethodCollection();

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