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 [tblEquipment] WHERE [PlantStructureID]= " + m_ID_tblPlantStructure.ID + " ;"; myCommand.Connection = Common.Conn; myReader = myCommand.ExecuteReader(); while (myReader.Read()) { idlist.Add(myReader.GetInt64(myReader.GetOrdinal("ID"))); } myReader.Close(); myCommand.Dispose(); //_SqlConnectionConnection.Close(); foreach (long id in idlist)// (int i = 0; i < count ; i++) { tblEquipment tblequipment = new tblEquipment(); tblequipment.ID = id; tblequipment.m_ID_tblPlantStructure = this.m_ID_tblPlantStructure; tblequipment.Select(); Add(tblequipment); } } catch (SQLiteException ae) { System.Windows.Forms.MessageBox.Show(ae.Message); return(false); } return(ret); }
public bool Contains(tblEquipment item) { return(List.Contains(item)); }
public int IndexOf(tblEquipment item) { return(List.IndexOf(item)); }
public void Insert(int index, tblEquipment item) { List.Insert(index, item); this.OntblEquipmentChanged(EventArgs.Empty); }
public void Remove(tblEquipment item) { List.Remove(item); this.OntblEquipmentChanged(EventArgs.Empty); }
public void Add(tblEquipment item) { List.Add(item); this.OntblEquipmentChanged(EventArgs.Empty); }