Exemple #1
0
        public override void Execute()
        {
            var parameterCollectionUI = new ParameterCollectionUI();

            ParameterCollectionUIOptionsFactory factory = new ParameterCollectionUIOptionsFactory();
            var options = factory.Create(_collector);

            parameterCollectionUI.SetUp(options);

            Activator.ShowWindow(parameterCollectionUI, true);
        }
Exemple #2
0
        private void btnImport_Click(object sender, EventArgs e)
        {
            if (_allowImportAsCatalogue)
            {
                var ui = new ConfigureCatalogueExtractabilityUI(Activator, Importer, "Existing Table", _projectSpecific)
                {
                    TargetFolder = TargetFolder
                };
                ui.ShowDialog();
                TableInfoCreatedIfAny = ui.TableInfoCreated;
            }
            else
            {
                // logic to add credentials
                // parent.SetCredentials();
                Importer.DoImport(out var ti, out var cols);

                if (ti is DatabaseEntity de)
                {
                    Activator.Publish(de);
                }

                TableInfoCreatedIfAny = ti;
            }

            try
            {
                DialogResult = DialogResult.OK;

                var ti = TableInfoCreatedIfAny;

                if (ti != null)
                {
                    if (ti.IsTableValuedFunction && ti.GetAllParameters().Any())
                    {
                        var options = new ParameterCollectionUIOptionsFactory().Create(ti);
                        ParameterCollectionUI.ShowAsDialog(Activator, options, true);
                    }
                    MessageBox.Show("Successfully imported table '" + ti + "'");
                }

                Close();
            }
            catch (SqlException exception)
            {
                MessageBox.Show("Problem importing table :" + exception.Message);
            }
        }
Exemple #3
0
        private void btnImport_Click(object sender, EventArgs e)
        {
            if (_allowImportAsCatalogue)
            {
                var ui = new ConfigureCatalogueExtractabilityUI(Activator, Importer, "Existing Table", null);
                ui.ShowDialog();
                TableInfoCreatedIfAny = ui.TableInfoCreated;
            }
            else
            {
                // logic to add credentials
                // parent.SetCredentials();
                TableInfo    ti;
                ColumnInfo[] cols;
                Importer.DoImport(out ti, out cols);
                Activator.RefreshBus.Publish(this, new RefreshObjectEventArgs(ti));
                TableInfoCreatedIfAny = ti;
            }

            try
            {
                DialogResult = DialogResult.OK;

                var ti = TableInfoCreatedIfAny;

                if (ti.IsTableValuedFunction && ti.GetAllParameters().Any())
                {
                    var options = new ParameterCollectionUIOptionsFactory().Create(ti);
                    ParameterCollectionUI.ShowAsDialog(options, true);
                }

                MessageBox.Show("Successfully imported table '" + ti + "'");
                Close();
            }
            catch (SqlException exception)
            {
                MessageBox.Show("Problem importing table :" + exception.Message);
            }
        }
Exemple #4
0
 private void btnParameters_Click(object sender, EventArgs e)
 {
     ParameterCollectionUI.ShowAsDialog(new ParameterCollectionUIOptionsFactory().Create(_tableInfo));
 }
Exemple #5
0
 private void ConfigureTableInfoParameters(TableInfo tableInfo)
 {
     ParameterCollectionUI.ShowAsDialog(new ParameterCollectionUIOptionsFactory().Create(tableInfo));
 }