Esempio n. 1
0
 private bool ValidateSystemObject()
 {
     DataManager.Manager manager = new DataManager.Manager();
     if (!manager.ValidateSystemObjects())
     {
         manager.InsertSystemObjects();
         return(manager.ValidateSystemObjects());
     }
     return(true);
 }
Esempio n. 2
0
        public void Initialize(string folder)
        {
            List <string> idpeps = new List <string>(Directory.GetFiles(folder, "*.idpep"));

            foreach (string idpep in idpeps)
            {
                DataSourcePatch dsp = new DataSourcePatch(idpep);
                dsp.Import();
                Console.WriteLine("{0} imported.", Path.GetFileName(idpep));
            }

            string[] systemDataSources = Directory.GetFiles(folder, "*system*.idpex");

            DataManager.Manager manager = new DataManager.Manager();
            foreach (string systemDataSource in systemDataSources)
            {
                DataSourceBundle dsb = new DataSourceBundle(systemDataSource);
                if (manager.ApplicationExists(dsb.DataSource.Name))
                {
                    Console.WriteLine("{0} already exists, skipped.", Path.GetFileName(systemDataSource));
                    continue;
                }

                dsb.Import();
                Console.WriteLine("{0} imported.", Path.GetFileName(systemDataSource));
            }

            List <string> dataSources = new List <string>(Directory.GetFiles(folder, "*.idpex"));

            dataSources.RemoveAll(f => f.Contains("System"));

            foreach (string dataSource in dataSources)
            {
                DataSourceBundle dsb = new DataSourceBundle(dataSource);
                if (manager.ApplicationExists(dsb.DataSource.Name))
                {
                    Console.WriteLine("{0} already exists, skipped.", Path.GetFileName(dataSource));
                    continue;
                }

                dsb.Import();
                Console.WriteLine("{0} imported.", Path.GetFileName(dataSource));
            }
        }