Esempio n. 1
0
        }//end Find

        /// <summary>
        /// Refresh the collection of displays
        /// </summary>
        // Revision History
        // MM/DD/YY who Version Issue# Description
        // -------- --- ------- ------ ---------------------------------------
        // 06/14/07 RDB         N/A	   Created
        public void Refresh(ref DisplayDBConnection DBConnection)
        {
            //Clears the collection
            InnerList.Clear();

            string strQueryString =
                "SELECT RECORDID, DISPLAYNAME, DISPLAYTYPE, DESCRIP, DATEMODIFIED FROM DISPLAYS;";

            OleDbConnection Connection = DBConnection.Open();

            OleDbCommand Command = Connection.CreateCommand();

            Command.CommandText = strQueryString;

            // Query Database
            OleDbDataReader Reader = Command.ExecuteReader();

            while (Reader.Read())
            {
                Display.Display objDisplay = new Display.Display();

                objDisplay.ID   = Convert.ToInt32(Reader[0].ToString(), CultureInfo.CurrentCulture);
                objDisplay.Name = Reader[1].ToString();

                // Since the 16 bit and 32 bit display editors have used different display type strings
                // to identify where a display can be used, convert the display type name into an
                // equivalent device type name
                objDisplay.Type = ConvertDisplayTypeToMeterType(Reader[2].ToString());

                objDisplay.Description = Reader[3].ToString();
                objDisplay.Modified    = Convert.ToDateTime(Reader[4].ToString(), CultureInfo.CurrentCulture);

                InnerList.Add(objDisplay);
            }

            Reader.Close();

            //sort displays
            DisplayComparer comparer = new DisplayComparer();

            InnerList.Sort(comparer);
        }//end Refresh
Esempio n. 2
0
 /// <summary>
 /// Constructor
 /// </summary>
 // Revision History
 // MM/DD/YY who Version Issue# Description
 // -------- --- ------- ------ ---------------------------------------
 // 06/14/07 RDB         N/A	   Created
 public DisplayCollection(ref DisplayDBConnection DBConnection)
 {
     Refresh(ref DBConnection);
 }//end DisplayCollection