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

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