Exemple #1
0
        /// <summary>
        /// Removes class from list by primary key
        /// </summary>
        public bool Remove(int id)
        {
            bool result = false;
            WebStatisticsPrimaryKey key = new WebStatisticsPrimaryKey();

            key.Id = id;

            if (m_Items.ContainsKey(key))
            {
                result = Remove(m_Items[key]);
            }
            return(result);
        }
Exemple #2
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);
        }
Exemple #3
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);
        }
Exemple #4
0
        /// <summary>
        /// Removes class from list by primary key values
        /// </summary>
        public bool Remove(int id)
        {
            bool result = false;
            WebStatisticsPrimaryKey key = new WebStatisticsPrimaryKey();

            key.Id = id;


            // Loop through our list until we find the match
            for (int i = 0; i < m_Items.Count; i++)
            {
                if (m_Items[i].PrimaryKey.CompareTo(key) == 0)
                {
                    m_Items.RemoveAt(i);
                    result = true;
                    break;
                }
            }

            return(result);
        }