private void onLoad() { foreach (string database in globalvariables.DatabaseLocations) { using (SQLiteConnection sqlite_connection = new SQLiteConnection("Data Source=" + database + ";Version=3;")) { sqlite_connection.Open(); string sql = "select Recommendation,IA_Controls,Notes,Topic,PDI,Status,System_Name,V_Key,Cat,Discussion,Stig_ID from ComplianceEntries"; using (SQLiteCommand command = new SQLiteCommand(sql, sqlite_connection)) { using (SQLiteDataReader reader = command.ExecuteReader()) { while (reader.Read()) { ComplianceEntry complianceEntry = new ComplianceEntry(); complianceEntry.System_name = reader["System_Name"] as string ?? ""; if (!System_names.Contains(reader["System_Name"] as string)) { System_names.Add(reader["System_Name"] as string); } if (!Stig_IDs.Contains((string)reader["Stig_ID"])) { Stig_IDs.Add((string)reader["Stig_ID"]); } complianceEntry.V_key = (string)reader["V_Key"]; complianceEntry.Stig_ID = (string)reader["Stig_ID"]; complianceEntry.Cat = (long)reader["Cat"]; complianceEntry.Status = (string)reader["Status"]; complianceEntry.Discussion = (string)reader["Discussion"]; complianceEntry.Pdi = (string)reader["PDI"]; complianceEntry.Topic = (string)reader["Topic"]; complianceEntry.Notes = (string)reader["Notes"]; complianceEntry.Ia_controls = (string)reader["IA_Controls"]; complianceEntry.Recommendation = (string)reader["Recommendation"]; this.ComplianceEntries.Add(complianceEntry); } Stig_IDs.Add("All Stigs"); System_names.Add("All Systems"); reader.Close(); sqlite_connection.Close(); command.Dispose(); } } } } }
private bool V_KeyFilter(object item) { ComplianceEntry v_key = item as ComplianceEntry; return(((SelectedStig_ID == v_key.Stig_ID) && (SelectedSystem_Name == v_key.System_name)) || (SelectedStig_ID == "All Stigs" && (SelectedSystem_Name == v_key.System_name)) || (SelectedSystem_Name == "All Systems" && (SelectedStig_ID == v_key.Stig_ID))); }