示例#1
0
        /// <summary>
        /// Loads all the data from the current workstation
        /// </summary>
        public ArrayList LoadByType(string type)
        {
            ArrayList result = new ArrayList();

            using (SqlConnection connection = new SqlConnection(connectionData.GetConnectionString()))
            {
                connection.Open();
                SqlCommand selectCommand = new SqlCommand(@"SELECT computer_name, ip, version, type, last_version_update, description, carrier, OEM, model, [user], has_vnc, test_equipment_sn,is_admin FROM " + TABLE_NAME + " WHERE type=@type;", connection);
                selectCommand.Parameters.AddWithValue("@type", type);

                try
                {
                    SqlDataReader reader = selectCommand.ExecuteReader();
                    while (reader.Read())
                    {
                        StationSummaryFile summaryItem = new StationSummaryFile();
                        summaryItem.Workstation           = reader.GetString(0);
                        summaryItem.ip                    = reader.GetString(1);
                        summaryItem.version               = reader.GetString(2);
                        summaryItem.type                  = reader.GetString(3);
                        summaryItem.lastUpdate            = reader.GetDateTime(4).ToString();
                        summaryItem.description           = reader.GetString(5);
                        summaryItem.carrier               = reader.GetString(6);
                        summaryItem.oem                   = reader.GetString(7);
                        summaryItem.model                 = reader.GetString(8);
                        summaryItem.user                  = reader.GetString(9);
                        summaryItem.vncAvailable          = reader.GetBoolean(10);
                        summaryItem.equipmentSerialNumber = reader.GetString(11);
                        summaryItem.isAdmin               = reader.GetBoolean(12);
                        result.Add(summaryItem);
                    }
                    reader.Close();
                }
                catch (SqlException)
                {
                }
                connection.Close();
            }
            return(result);
        }
示例#2
0
 public StationSummary()
 {
     summaryThread = new Thread(new ThreadStart(UploadInfo));
     summaryData   = new StationSummaryFile();
 }