Esempio n. 1
0
        private void OnCreateRCADDB()
        {
            if (ConnectionValid && _desiredServer != null && !string.IsNullOrEmpty(Database))
            {
                if (LocalDatabases.Contains(Database))
                {
                    IMessageVisualizer mesg = Resolve <IMessageVisualizer>();
                    mesg.Show("Error",
                              string.Format("Error: Database with name {0} exists on selected instance, please select another name or delete the existing database first.", Database),
                              MessageButtons.OK);
                    Database = null;
                    return;
                }

                CreatingDB = true;
                rCADConnection ssisOleConn = new rCADConnection();
                ssisOleConn.Database     = Database;
                ssisOleConn.Instance     = Instance;
                ssisOleConn.Host         = Host;
                ssisOleConn.SecurityType = SecurityType.WindowsAuthentication;
                ssisOleConn.Provider     = "SQLNCLI10.1";

                if (!UsingSQLExpress)
                {
                    CreateRCADDBArgs args = new CreateRCADDBArgs()
                    {
                        TargetInstance       = _desiredServer,
                        RCADConnectionString = ssisOleConn.BuildConnectionString(),
                        InstallDirectory     = _installDirectory,
                        DataDirectory        = _dataDirectory,
                        LoadRCADDBPackage    = _rCADLoaderSSISPkg,
                        RCADDatabaseName     = Database
                    };
                    StatusMessage = CREATING_RCAD_DB_MESSAGE;
                    _workerDTS.RunWorkerAsync(args);
                }
                else
                {
                    CreateRCADDBArgs args = new CreateRCADDBArgs()
                    {
                        TargetInstance   = _desiredServer,
                        RCADDatabaseName = Database,
                        TargetSQLFile    = ScriptTargetFile,
                        InstallDirectory = _installDirectory,
                        DataDirectory    = _dataDirectory
                    };
                    StatusMessage = CREATING_RCAD_DB_INSTALLSCRIPT;
                    _workerSQLCMD.RunWorkerAsync(args);
                }
            }
        }
        private void MapAlignmentToRCAD(rCADConnection connection)
        {
            string connectionString = connection.BuildConnectionString();

            MappingToRCAD     = true;
            RCADMappingStatus = MAPPING_ALIGNMENT_MESSAGE;
            CommandManager.InvalidateRequerySuggested();
            RCADMappingArgs args = new RCADMappingArgs()
            {
                ConnectionString = connectionString, Database = connection.Database
            };

            _worker                     = new BackgroundWorker();
            _worker.DoWork             += new DoWorkEventHandler(MapAlignmentToRCADWorker);
            _worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(MapAlignmentToRCADWorkerCompleted);
            _worker.RunWorkerAsync(args);
        }
Esempio n. 3
0
        private void OnUpdateTaxonomy()
        {
            UpdatingDB    = true;
            StatusMessage = UPDATING_TAXONOMY;

            rCADConnection oleConn = new rCADConnection();

            oleConn.Instance     = Instance;
            oleConn.Host         = Host;
            oleConn.SecurityType = SecurityType.WindowsAuthentication;
            oleConn.Database     = Database;
            oleConn.Provider     = "SQLNCLI10.1";

            TaxonomyLoaderArgs args = new TaxonomyLoaderArgs {
                ConnectionString = oleConn.BuildConnectionString(), DatabaseName = Database
            };

            _worker.RunWorkerAsync(args);
        }