Beispiel #1
0
        /// <summary>
        /// Removes the class passed in by primary key
        /// </summary>
        public bool Remove(SliderImage item)
        {
            bool result = false;

            result = m_Items.Remove(item.PrimaryKey);
            return(result);
        }
Beispiel #2
0
        /// <summary>
        /// Adds an item to the list
        /// </summary>
        public void Add(SliderImage item)
        {
            m_Items.Add(item);

            // Do a sort if we have a comparison delegate
            if (m_Comparison != null)
            {
                Sort(m_Comparison);
            }
        }
Beispiel #3
0
        /// <summary>
        /// Finds class by primary key
        /// </summary>
        public SliderImage Find(int imageId)
        {
            SliderImage           result = null;
            SliderImagePrimaryKey key    = new SliderImagePrimaryKey();

            key.ImageId = imageId;

            if (m_Items.ContainsKey(key))
            {
                result = m_Items[key];
            }
            return(result);
        }
Beispiel #4
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())
                {
                    SliderImage item = new SliderImage(m_db, dr);
                    this.Add(item);
                }
            }
        }
Beispiel #5
0
        /// <summary>
        /// Finds class by primary key
        /// </summary>
        public SliderImage Find(int imageId)
        {
            SliderImage           result = null;
            SliderImagePrimaryKey key    = new SliderImagePrimaryKey();

            key.ImageId = imageId;


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

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