private void CreateSystemDatabases(ISystemeDatabaseModule databaseModule)
        {
            IDatabaseContainer databaseContainer = databaseModule.GetDatabaseContainer();

            if (!databaseContainer.ExistDatabase(SystemeConstants.SystemDatabaseName))
            {
                databaseModule.AddDatabase(DefaultDataConstructor.CreateSystemDatabase());
            }
            else
            {
                DefaultDataConstructor.CompleteSystemDatabase(databaseModule.GetDatabaseContainer().GetDatabase(SystemeConstants.SystemDatabaseName));
            }
        }
예제 #2
0
        public void ActToAdd(IDatabase database, ITable table)
        {
            ISystemeDatabaseModule databaseModule          = (ISystemeDatabaseModule)this.systeme.GetSystemeModule(SystemeConstants.SystemeDatabaseModule);
            IDatabase         systemDatabase               = databaseModule.GetDatabaseContainer().GetDatabase(SystemeConstants.SystemDatabaseName);
            ITable            profilesPrivilegesTable      = systemDatabase.GetTable(SystemeConstants.PrivilegesOfProfilesOnTablesTableName);
            ITable            tablePrivilegesTable         = systemDatabase.GetTable(SystemeConstants.PrivilegesTableName);
            ITable            adminProfileTable            = systemDatabase.GetTable(SystemeConstants.NoRemovableProfilesTableName);
            IEnumerator <Row> adminProfilesrowEnumerator   = adminProfileTable.GetRowEnumerator();
            IEnumerator <Row> tablePrivilegesRowEnumerator = tablePrivilegesTable.GetRowEnumerator();
            Row row;

            while (adminProfilesrowEnumerator.MoveNext())
            {
                while (tablePrivilegesRowEnumerator.MoveNext())
                {
                    row = profilesPrivilegesTable.CreateRowDefinition();
                    row.GetCell(SystemeConstants.PrivilegesOfProfilesOnTablesDatabaseNameColumnName).data = database.databaseName;
                    row.GetCell(SystemeConstants.PrivilegesOfProfilesOnTablesTableNameColumnName).data    = table.tableName;//If i dont use an array with lamdas with this is because of NO LIAR LA COSA MAS
                    row.GetCell(SystemeConstants.PrivilegesOfProfilesOnTablesProfileColumnName).data      = adminProfilesrowEnumerator.Current.GetCell(SystemeConstants.ProfileNameColumn).data;
                    row.GetCell(SystemeConstants.PrivilegesOfProfilesOnTablesPrivilegeColumnName).data    = tablePrivilegesRowEnumerator.Current.GetCell(SystemeConstants.PrivilegesPrivilegeNameColumnName).data;
                    profilesPrivilegesTable.AddRow(row);
                }
                tablePrivilegesRowEnumerator.Reset();
            }
        }
        private void CreateDefaultDatabase(ISystemeDatabaseModule databaseModule)
        {
            IDatabaseContainer databaseContainer = databaseModule.GetDatabaseContainer();

            if (!databaseContainer.ExistDatabase(SystemeConstants.DefaultDatabaseName))
            {
                databaseContainer.AddDatabase(new Database(SystemeConstants.DefaultDatabaseName));
            }
        }
예제 #4
0
        public void ActToAdd(IDatabase database)
        {
            ISystemeDatabaseModule databaseModule = (ISystemeDatabaseModule)this.systeme.GetSystemeModule(SystemeConstants.SystemeDatabaseModule);
            IDatabase         systemDatabase      = databaseModule.GetDatabaseContainer().GetDatabase(SystemeConstants.SystemDatabaseName);
            ITable            profilesPrivilegesOnDatabasesTable = systemDatabase.GetTable(SystemeConstants.PrivilegesOfProfilesOnDatabasesTableName);
            ITable            databasesPrivilegesTable           = systemDatabase.GetTable(SystemeConstants.DatabasesPrivilegesTableName);
            ITable            adminProfileTable                = systemDatabase.GetTable(SystemeConstants.NoRemovableProfilesTableName);
            IEnumerator <Row> adminProfilesrowEnumerator       = adminProfileTable.GetRowEnumerator();
            IEnumerator <Row> databasesPrivilegesRowEnumerator = databasesPrivilegesTable.GetRowEnumerator();
            Row row;

            while (adminProfilesrowEnumerator.MoveNext())
            {
                while (databasesPrivilegesRowEnumerator.MoveNext())
                {
                    row = profilesPrivilegesOnDatabasesTable.CreateRowDefinition();
                    row.GetCell(SystemeConstants.PrivilegesOfProfilesOnDatabasesDatabaseNameColumnName).data = database.databaseName;
                    row.GetCell(SystemeConstants.PrivilegesOfProfilesOnDatabasesProfileColumnName).data      = adminProfilesrowEnumerator.Current.GetCell(SystemeConstants.ProfileNameColumn).data;
                    row.GetCell(SystemeConstants.PrivilegesOfProfilesOnDatabasesPrivilegeColumnName).data    = databasesPrivilegesRowEnumerator.Current.GetCell(SystemeConstants.DatabasesPrivilegesPrivilegeNameColumnName).data;
                    profilesPrivilegesOnDatabasesTable.AddRow(row);
                }
                databasesPrivilegesRowEnumerator.Reset();
            }
        }