Exemple #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();

            try
            {
                myReader = null;
                myCommand.CommandText = @"SELECT * FROM [tblAlarmGroup] order by oIndex ;";
                myCommand.Connection  = Common.Conn;
                myReader = myCommand.ExecuteReader();
                while (myReader.Read())
                {
                    tblAlarmGroup tblalarmgroup = new tblAlarmGroup();
                    tblalarmgroup.m_SolutionID_tblSolution = this.m_SolutionID_tblSolution;
                    tblalarmgroup.AddFromRecordSet(myReader);

                    this.Add(tblalarmgroup);
                }

                myReader.Close();
                myCommand.Dispose();
                //int count = idlist.Count;
                //foreach (long id in idlist)// (int i = 0; i < count ; i++)
                //{
                //    tblAlarmGroup tblalarmgroup = new tblAlarmGroup();
                //    tblalarmgroup.ID = id;// idlist[i];
                //    tblalarmgroup.m_SolutionID_tblSolution = this.m_SolutionID_tblSolution;
                //    tblalarmgroup.Select();

                //    this.Add(tblalarmgroup);
                //}
            }
            catch (SQLiteException ae)
            {
                MessageBox.Show(ae.Message.ToString());
                return(false);
                //
            }



            return(ret);
        }
 public bool Contains(tblAlarmGroup item)
 {
     return(List.Contains(item));
 }
 public int IndexOf(tblAlarmGroup item)
 {
     return(List.IndexOf(item));
 }
 public void Insert(int index, tblAlarmGroup item)
 {
     List.Insert(index, item);
     this.OntblAlarmGroupChanged(EventArgs.Empty);
 }
 public void Remove(tblAlarmGroup item)
 {
     List.Remove(item);
     this.OntblAlarmGroupChanged(EventArgs.Empty);
 }
 public void Add(tblAlarmGroup item)
 {
     List.Add(item);
     this.OntblAlarmGroupChanged(EventArgs.Empty);
 }