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

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