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();

            try
            {
                myReader = null;
                myCommand.CommandText = @"SELECT * FROM [tblInstrumentUnits]  WHERE [GroupID]= " + m_ID_tblInstrumentUnitsGrp.ID + " ;";
                myCommand.Connection  = Common.Conn;
                myReader = myCommand.ExecuteReader();
                while (myReader.Read())
                {
                    idlist.Add(myReader.GetInt64(myReader.GetOrdinal("ID")));
                }

                myReader.Close();
                myCommand.Dispose();
                int count = idlist.Count;
                foreach (long id in idlist)// (int i = 0; i < count ; i++)
                {
                    tblInstrumentUnits tblinstrumentunits = new tblInstrumentUnits();
                    tblinstrumentunits.ID = id;// idlist[i];
                    tblinstrumentunits.m_ID_tblInstrumentUnitsGrp = this.m_ID_tblInstrumentUnitsGrp;
                    tblinstrumentunits.Select();

                    this.Add(tblinstrumentunits);
                }
            }
            catch (SQLiteException ae)
            {
                MessageBox.Show(ae.Message.ToString());
                return(false);
            }



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