示例#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();
            }
            //SQLiteConnection _SqlConnectionConnection = new SQLiteConnection(Common.ConnectionString);
            SQLiteDataReader myReader  = null;
            SQLiteCommand    myCommand = new SQLiteCommand();

            //if (_SqlConnectionConnection.State == System.Data.ConnectionState.Open)
            //    _SqlConnectionConnection.Close();
            //_SqlConnectionConnection.ConnectionString = Common.ConnectionString;
            //_SqlConnectionConnection.Open();
            //tblBoard] WHERE [BoardID
            try
            {
                myReader = null;
                myCommand.CommandText = @"SELECT * FROM [tblBoard]  WHERE [ControllerID]= " + m_ControllerID_tblController.ControllerID + " order by oIndex;";
                myCommand.Connection  = Common.Conn;
                myReader = myCommand.ExecuteReader();
                while (myReader.Read())
                {
                    idlist.Add(myReader.GetInt64(myReader.GetOrdinal("BoardID")));
                }

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

                foreach (long id in idlist)// (int i = 0; i < count ; i++)
                {
                    tblBoard tblboard = new tblBoard();
                    tblboard.BoardID = id;
                    tblboard.m_ControllerID_tblController = this._ControllerID_tblController;
                    tblboard.Select();
                    // tblpou.m_tblVariableCollection.Load( tblpou.pouID);
                    this.Add(tblboard);
                }
            }
            catch (SQLiteException ae)
            {
                System.Windows.Forms.MessageBox.Show(ae.Message);
                return(false);
            }



            return(ret);
        }
示例#2
0
 public tblChannelCollection(tblBoard _parent)
 {
     _BoardID_tblBoard = _parent;
 }
示例#3
0
 public bool Contains(tblBoard item)
 {
     return(List.Contains(item));
 }
示例#4
0
 public int IndexOf(tblBoard item)
 {
     return(List.IndexOf(item));
 }
示例#5
0
 public void Insert(int index, tblBoard item)
 {
     List.Insert(index, item);
     this.OntblBoardChanged(EventArgs.Empty);
 }
示例#6
0
 public void Remove(tblBoard item)
 {
     List.Remove(item);
     this.OntblBoardChanged(EventArgs.Empty);
 }
示例#7
0
 public void Add(tblBoard item)
 {
     List.Add(item);
     this.OntblBoardChanged(EventArgs.Empty);
 }