Ejemplo n.º 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();

            //if (_SqlConnectionConnection.State == System.Data.ConnectionState.Open)
            //    _SqlConnectionConnection.Close();
            //_SqlConnectionConnection.ConnectionString = Common.ConnectionString;
            //_SqlConnectionConnection.Open();

            try
            {
                myReader = null;

                myCommand.CommandText = @"SELECT * FROM [tblEllipse]  WHERE [DisplayID]= " + m_DisplayID_tblDisplay.DisplayID + " order by oIndex;";

                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++)
                {
                    tblEllipse tblellipse = new tblEllipse();
                    tblellipse.ID = id;
                    tblellipse.m_DisplayID_tblDisplay = this.m_DisplayID_tblDisplay;
                    tblellipse.Select();

                    Add(tblellipse);
                }
            }
            catch (SQLiteException ae)
            {
                System.Windows.Forms.MessageBox.Show(ae.Message);
                return(false);
            }



            return(ret);
        }
Ejemplo n.º 2
0
 public bool Contains(tblEllipse item)
 {
     return(List.Contains(item));
 }
Ejemplo n.º 3
0
 public int IndexOf(tblEllipse item)
 {
     return(List.IndexOf(item));
 }
Ejemplo n.º 4
0
 public void Insert(int index, tblEllipse item)
 {
     List.Insert(index, item);
     this.OntblEllipseChanged(EventArgs.Empty);
 }
Ejemplo n.º 5
0
 public void Remove(tblEllipse item)
 {
     List.Remove(item);
     this.OntblEllipseChanged(EventArgs.Empty);
 }
Ejemplo n.º 6
0
 public void Add(tblEllipse item)
 {
     List.Add(item);
     this.OntblEllipseChanged(EventArgs.Empty);
 }