Exemplo n.º 1
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);
            }
        }
Exemplo n.º 2
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);
            }
        }
Exemplo n.º 3
0
 private void btnParameters_Click(object sender, EventArgs e)
 {
     ParameterCollectionUI.ShowAsDialog(new ParameterCollectionUIOptionsFactory().Create(_tableInfo));
 }
Exemplo n.º 4
0
 private void ConfigureTableInfoParameters(TableInfo tableInfo)
 {
     ParameterCollectionUI.ShowAsDialog(new ParameterCollectionUIOptionsFactory().Create(tableInfo));
 }