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); }
public bool Contains(tblInstrumentUnits item) { return(List.Contains(item)); }
public int IndexOf(tblInstrumentUnits item) { return(List.IndexOf(item)); }
public void Insert(int index, tblInstrumentUnits item) { List.Insert(index, item); this.OntblInstrumentUnitsChanged(EventArgs.Empty); }
public void Remove(tblInstrumentUnits item) { List.Remove(item); this.OntblInstrumentUnitsChanged(EventArgs.Empty); }
public void Add(tblInstrumentUnits item) { List.Add(item); this.OntblInstrumentUnitsChanged(EventArgs.Empty); }