Ejemplo n.º 1
0
        public int Add(tblFBDBlockPin item)
        {
            int newindex = List.Add(item);

            this.OntblFBDBlockPinChanged(EventArgs.Empty);
            return(newindex);
        }
        public 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 [tblFBDBlockPin]  WHERE [FBDBlockID]= " + this.m_FBDBlockID_tblFBDBlock.FBDBlockID + ";"; // " order by oIndex;";
                myCommand.Connection  = Common.Conn;
                myReader = myCommand.ExecuteReader();
                while (myReader.Read())
                {
                    idlist.Add(myReader.GetInt64(myReader.GetOrdinal("FBDBlockPinID")));
                }

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

                for (int i = 0; i < idlist.Count; i++)
                {
                    tblFBDBlockPin tblfbdblockpin = new tblFBDBlockPin();

                    tblfbdblockpin.FBDBlockPinID            = idlist[i];
                    tblfbdblockpin.m_FBDBlockID_tblFBDBlock = this._FBDBlockID_tblFBDBlock;
                    tblfbdblockpin.Select();
                    this.Add(tblfbdblockpin);
                }
            }
            catch (SQLiteException ae)
            {
                return(false);
                // MessageBox.Show(ae.Message.ToString());
            }



            return(ret);
        }
Ejemplo n.º 3
0
 public bool Contains(tblFBDBlockPin item)
 {
     return(List.Contains(item));
 }
Ejemplo n.º 4
0
 public int IndexOf(tblFBDBlockPin item)
 {
     return(List.IndexOf(item));
 }
Ejemplo n.º 5
0
 public void Insert(int index, tblFBDBlockPin item)
 {
     List.Insert(index, item);
     this.OntblFBDBlockPinChanged(EventArgs.Empty);
 }
Ejemplo n.º 6
0
 public void Remove(tblFBDBlockPin item)
 {
     List.Remove(item);
     this.OntblFBDBlockPinChanged(EventArgs.Empty);
 }