Exemplo n.º 1
0
        public int Add(tblRoundRect item)
        {
            int newindex = List.Add(item);

            this.OntblRoundRectChanged(EventArgs.Empty);
            return(newindex);
        }
Exemplo n.º 2
0
        public 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 [tblRoundRect]  WHERE [DisplayID]= " + m_DisplayID_tblDisplay.DisplayID + " order by oIndex;";

                myCommand.Connection = _SqlConnectionConnection;
                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++)
                {
                    tblRoundRect tblroundrect = new tblRoundRect();
                    tblroundrect.RoundRectID            = id;
                    tblroundrect.m_DisplayID_tblDisplay = this.m_DisplayID_tblDisplay;
                    tblroundrect.Select();

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



            return(ret);
        }
Exemplo n.º 3
0
 public bool Contains(tblRoundRect item)
 {
     return(List.Contains(item));
 }
Exemplo n.º 4
0
 public int IndexOf(tblRoundRect item)
 {
     return(List.IndexOf(item));
 }
Exemplo n.º 5
0
 public void Insert(int index, tblRoundRect item)
 {
     List.Insert(index, item);
     this.OntblRoundRectChanged(EventArgs.Empty);
 }
Exemplo n.º 6
0
 public void Remove(tblRoundRect item)
 {
     List.Remove(item);
     this.OntblRoundRectChanged(EventArgs.Empty);
 }