Exemple #1
0
        public override 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 [tblHMI] ";
                myCommand.Connection  = Common.Conn;
                myReader = myCommand.ExecuteReader();
                while (myReader.Read())
                {
                    idlist.Add(myReader.GetInt64(myReader.GetOrdinal("HMIID")));
                }

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

                foreach (long id in idlist)// (int i = 0; i < count ; i++)
                {
                    tblHMI tblhmi = new tblHMI();
                    tblhmi.HMIID = id;
                    tblhmi.m_SolutionID_tblSolution = this.m_SolutionID_tblSolution;
                    tblhmi.SolutionID = this.m_SolutionID_tblSolution.SolutionID;
                    tblhmi.Select();
                    this.Add(tblhmi);
                }
            }
            catch (SQLiteException ae)
            {
                System.Windows.Forms.MessageBox.Show(ae.Message);
                return(false);
            }



            return(ret);
        }
 public bool IsHMIName(string _name, ref tblHMI _tblhmi)
 {
     foreach (tblHMI tblhmi in m_tblHMICollection)
     {
         if (tblhmi.HMIName.ToLower() == _name.ToLower())
         {
             _tblhmi = tblhmi;
             return(true);
         }
     }
     return(false);
 }
Exemple #3
0
 public bool Contains(tblHMI item)
 {
     return(List.Contains(item));
 }
Exemple #4
0
 public int IndexOf(tblHMI item)
 {
     return(List.IndexOf(item));
 }
Exemple #5
0
 public void Insert(int index, tblHMI item)
 {
     List.Insert(index, item);
     this.OntblHMIChanged(EventArgs.Empty);
 }
Exemple #6
0
 public void Remove(tblHMI item)
 {
     List.Remove(item);
     this.OntblHMIChanged(EventArgs.Empty);
 }
Exemple #7
0
 public void Add(tblHMI item)
 {
     List.Add(item);
     this.OntblHMIChanged(EventArgs.Empty);
 }