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

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