예제 #1
0
        public override bool Load()
        {
            bool        ret    = true;
            List <long> idlist = new List <long>();

            if (Common.Conn == null)
            {
                Common.Conn = new SQLiteConnection(Common.ConnectionString);
                Common.Conn.Open();
            }
            SQLiteDataReader myReader  = null;
            SQLiteCommand    myCommand = new SQLiteCommand();


            try
            {
                myReader = null;

                myCommand.CommandText = @"SELECT * FROM [tblTrend]  WHERE [DisplayID]= " + m_DisplayID_tblDisplay.DisplayID + " order by oIndex;";

                myCommand.Connection = Common.Conn;
                myReader             = myCommand.ExecuteReader();
                while (myReader.Read())
                {
                    idlist.Add(myReader.GetInt64(myReader.GetOrdinal("ID")));
                }

                myReader.Close();
                myCommand.Dispose();

                foreach (long id in idlist)// (int i = 0; i < count ; i++)
                {
                    tblTrend tbltrend = new tblTrend();
                    tbltrend.ID = id;
                    tbltrend.m_DisplayID_tblDisplay = this.m_DisplayID_tblDisplay;
                    tbltrend.Select();

                    Add(tbltrend);
                }
            }
            catch (SQLiteException ae)
            {
                System.Windows.Forms.MessageBox.Show(ae.Message);
                return(false);
            }



            return(ret);
        }
예제 #2
0
 public bool Contains(tblTrend item)
 {
     return(List.Contains(item));
 }
예제 #3
0
 public int IndexOf(tblTrend item)
 {
     return(List.IndexOf(item));
 }
예제 #4
0
 public void Insert(int index, tblTrend item)
 {
     List.Insert(index, item);
     this.OntblTrendChanged(EventArgs.Empty);
 }
예제 #5
0
 public void Remove(tblTrend item)
 {
     List.Remove(item);
     this.OntblTrendChanged(EventArgs.Empty);
 }
예제 #6
0
 public void Add(tblTrend item)
 {
     List.Add(item);
     this.OntblTrendChanged(EventArgs.Empty);
 }