Exemplo n.º 1
0
        /// <summary>
        /// Removes the class passed in by primary key
        /// </summary>
        public bool Remove(WebStatistics item)
        {
            bool result = false;

            result = m_Items.Remove(item.PrimaryKey);
            return(result);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Adds an item to the list
        /// </summary>
        public void Add(WebStatistics item)
        {
            m_Items.Add(item);

            // Do a sort if we have a comparison delegate
            if (m_Comparison != null)
            {
                Sort(m_Comparison);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Loads the list class based on provided sql and commands.
        /// </summary>
        public void Populate(string sql, SqlParameter[] commandParameters)
        {
            m_Items.Clear();

            using (SqlDataReader dr = m_db.ExecuteReader(System.Data.CommandType.Text, sql, commandParameters))
            {
                while (dr.Read())
                {
                    WebStatistics item = new WebStatistics(m_db, dr);
                    this.Add(item);
                }
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Finds class by primary key
        /// </summary>
        public WebStatistics Find(int id)
        {
            WebStatistics           result = null;
            WebStatisticsPrimaryKey key    = new WebStatisticsPrimaryKey();

            key.Id = id;

            if (m_Items.ContainsKey(key))
            {
                result = m_Items[key];
            }
            return(result);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Finds class by primary key
        /// </summary>
        public WebStatistics Find(int id)
        {
            WebStatistics           result = null;
            WebStatisticsPrimaryKey key    = new WebStatisticsPrimaryKey();

            key.Id = id;


            // Loop through our list until we find the match
            foreach (WebStatistics item in m_Items)
            {
                if (item.PrimaryKey.CompareTo(key) == 0)
                {
                    result = item;
                    break;
                }
            }

            return(result);
        }
Exemplo n.º 6
0
 /// <summary>
 /// Removes the class passed in by object reference
 /// </summary>
 public bool Remove(WebStatistics item)
 {
     return(m_Items.Remove(item));
 }
Exemplo n.º 7
0
 /// <summary>
 /// Adds an item to the list
 /// </summary>
 public void Add(WebStatistics item)
 {
     m_Items.Add(item.PrimaryKey, item);
 }