コード例 #1
0
        /// <remarks>Represents the foreign key object</remarks>
        //private tblSolution _SolutionID_tblSolution;

        //[Description("Represents the foreign key object of the type SolutionID")]
        //public tblSolution m_SolutionID_tblSolution
        //{
        //    get
        //    {
        //        return _SolutionID_tblSolution;
        //    }
        //    set
        //    {
        //        _SolutionID_tblSolution = value;
        //    }
        //}


        public override bool Load()
        {
            bool             ret    = true;
            List <long>      idlist = new List <long>();
            SQLiteConnection _SqlConnectionConnection = new SQLiteConnection(Common.ConnectionString);
            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 [tblSymbols] ";
                myCommand.Connection  = _SqlConnectionConnection;
                myReader = myCommand.ExecuteReader();
                while (myReader.Read())
                {
                    idlist.Add(myReader.GetInt64(myReader.GetOrdinal("SymbolID")));
                }

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

                foreach (long id in idlist)// (int i = 0; i < count ; i++)
                {
                    tblSymbols tblsymbols = new tblSymbols();
                    tblsymbols.SymbolID = id;
                    tblsymbols.m_SolutionID_tblSolution = this.m_SolutionID_tblSolution;
                    tblsymbols.Select();
                    //tblsymbols.m_tblSymbolStatusCollection.Load();
                    this.Add(tblsymbols);
                }
            }
            catch (SQLiteException ae)
            {
                System.Windows.Forms.MessageBox.Show(ae.Message);
                return(false);
            }



            return(ret);
        }
コード例 #2
0
 public tblSymbolStatusCollection(tblSymbols _parent)
 {
     _SymbolID_tblSymbols = _parent;
 }
コード例 #3
0
 public bool Contains(tblSymbols item)
 {
     return(List.Contains(item));
 }
コード例 #4
0
 public int IndexOf(tblSymbols item)
 {
     return(List.IndexOf(item));
 }
コード例 #5
0
 public void Insert(int index, tblSymbols item)
 {
     List.Insert(index, item);
     this.OntblSymbolsChanged(EventArgs.Empty);
 }
コード例 #6
0
 public void Remove(tblSymbols item)
 {
     List.Remove(item);
     this.OntblSymbolsChanged(EventArgs.Empty);
 }
コード例 #7
0
 public void Add(tblSymbols item)
 {
     List.Add(item);
     this.OntblSymbolsChanged(EventArgs.Empty);
 }