Beispiel #1
0
        public static bool NoteisGlobal()
        {
            using (AdoDataConnection connection = new AdoDataConnection("systemSettings"))
            {
                GSF.Data.Model.TableOperations <DataSensitivity> tableOperations = new GSF.Data.Model.TableOperations <DataSensitivity>(connection);

                int uniqueDataSensitivityNotes = tableOperations.QueryRecordsWhere("Note NOT NULL AND Note <> ''").Select(record => record.Note.ToLower()).Distinct().Count();

                if (uniqueDataSensitivityNotes == 1)
                {
                    return(true);
                }
            }
            return(false);
        }
        public static bool CodeisGlobal()
        {
            string dataprovider     = "AssemblyName={System.Data.SQLite, Version=1.0.109.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139}; ConnectionType=System.Data.SQLite.SQLiteConnection; AdapterType=System.Data.SQLite.SQLiteDataAdapter";
            string localAppData     = $"{Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)}{Path.DirectorySeparatorChar}PQio{Path.DirectorySeparatorChar}DataBase.db";
            string connectionstring = $"Data Source={localAppData}; Version=3; Foreign Keys=True; FailIfMissing=True";

            using (AdoDataConnection connection = new AdoDataConnection(connectionstring, dataprovider))
            {
                GSF.Data.Model.TableOperations <DataSensitivity> tableOperations = new GSF.Data.Model.TableOperations <DataSensitivity>(connection);

                int uniqueDataSensitivity = tableOperations.QueryRecordsWhere("DataSensitivityCode NOT NULL")
                                            .Select(record => record.DataSensitivityCode).Distinct().Count();

                if (uniqueDataSensitivity == 1)
                {
                    return(true);
                }
            }
            return(false);
        }