예제 #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();

            //if (_SqlConnectionConnection.State == System.Data.ConnectionState.Open)
            //    _SqlConnectionConnection.Close();
            //_SqlConnectionConnection.ConnectionString = Common.ConnectionString;
            //_SqlConnectionConnection.Open();

            try
            {
                myReader = null;

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

                myCommand.Connection = Common.Conn;
                myReader             = myCommand.ExecuteReader();
                while (myReader.Read())
                {
                    tblBargraph tblbargraph = new tblBargraph();
                    tblbargraph.m_DisplayID_tblDisplay = this.m_DisplayID_tblDisplay;
                    tblbargraph.AddFromRecordSet(myReader);

                    Add(tblbargraph);
                }

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

                //foreach (long id in idlist)// (int i = 0; i < count ; i++)
                //{
                //    tblBargraph tblbargraph = new tblBargraph();
                //    tblbargraph.BargraphID = id;
                //    tblbargraph.m_DisplayID_tblDisplay = this.m_DisplayID_tblDisplay;
                //    tblbargraph.Select();

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



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