public int Add(tblDomain item) { int newindex = List.Add(item); this.OntblDomainChanged(EventArgs.Empty); return(newindex); }
public bool Load() { bool ret = true; List <long> idlist = new List <long>(); //SQLiteConnection _SqlConnectionConnection = new SQLiteConnection(Common.ConnectionString); 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 [tblDomain] "; myCommand.Connection = Common.Conn; myReader = myCommand.ExecuteReader(); while (myReader.Read()) { idlist.Add(myReader.GetInt64(myReader.GetOrdinal("DomainID"))); } myReader.Close(); myCommand.Dispose(); //_SqlConnectionConnection.Close(); foreach (long id in idlist)// (int i = 0; i < count ; i++) { tblDomain tbldomain = new tblDomain(); tbldomain.DomainID = id; tbldomain.m_SolutionID_tblSolution = this.m_SolutionID_tblSolution; tbldomain.SolutionName = this.m_SolutionID_tblSolution.SolutionName; tbldomain.Select(); //tbldomain.m_tblControllerCollection.m_DomainID_tblDomain = tbldomain; // tbldomain.m_tblDisplayCollection.m_DomainID_tblDomain = tbldomain; //tbldomain.m_tblControllerCollection.Load( /*tbldomain.DomainID*/); //tbldomain.m_tblDisplayCollection.Load( /*tbldomain.DomainID*/); this.Add(tbldomain); } } catch (SQLiteException ae) { return(false); // MessageBox.Show(ae.Message.ToString()); } return(ret); }
public bool Contains(tblDomain item) { return(List.Contains(item)); }
public int IndexOf(tblDomain item) { return(List.IndexOf(item)); }
public void Insert(int index, tblDomain item) { List.Insert(index, item); this.OntblDomainChanged(EventArgs.Empty); }
public void Remove(tblDomain item) { List.Remove(item); this.OntblDomainChanged(EventArgs.Empty); }