/// <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); }
/// <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); } }
/// <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); } } }
/// <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); }
/// <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); }
/// <summary> /// Removes the class passed in by object reference /// </summary> public bool Remove(WebStatistics item) { return(m_Items.Remove(item)); }
/// <summary> /// Adds an item to the list /// </summary> public void Add(WebStatistics item) { m_Items.Add(item.PrimaryKey, item); }