public override bool Load()
        {
            bool        ret    = true;
            List <long> idlist = new List <long>();

            //SQLiteConnection _SqlConnectionConnection = new SQLiteConnection(Common.ConnectionString);
            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 [tblButton]  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("ButtonID")));
                }

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

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

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



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