Beispiel #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 [tblFBDBlock]  WHERE [pouID]= " + this.m_pouID_tblPou.pouID + ";"; // " order by oIndex;";
                myCommand.Connection  = Common.Conn;
                myReader = myCommand.ExecuteReader();
                while (myReader.Read())
                {
                    idlist.Add(myReader.GetInt64(myReader.GetOrdinal("FBDBlockID")));
                }

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

                for (int i = 0; i < idlist.Count; i++)
                {
                    tblFBDBlock tblfbdblock = new tblFBDBlock();

                    tblfbdblock.FBDBlockID     = idlist[i];
                    tblfbdblock.m_pouID_tblPou = this._pouID_tblPou;
                    tblfbdblock.Select();
                    this.Add(tblfbdblock);
                }
            }
            catch (SQLiteException ae)
            {
                System.Windows.Forms.MessageBox.Show(ae.Message);
                return(false);
            }



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