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 [tblFBDAlarmOrder]  WHERE [FunctionID]= " + this._FunctionID_tblFunction.FunctionID + " 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();

                for (int i = 0; i < idlist.Count; i++)
                {
                    tblFBDAlarmOrder tblfbdalarmorder = new tblFBDAlarmOrder();

                    tblfbdalarmorder.ID = idlist[i];
                    tblfbdalarmorder.m_FunctionID_tblFunction = m_FunctionID_tblFunction;
                    tblfbdalarmorder.Select();
                    this.Add(tblfbdalarmorder);
                }
            }
            catch (SQLiteException ae)
            {
                System.Windows.Forms.MessageBox.Show(ae.Message);
                return(false);
            }



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