public override void SetDatabaseObject(IActivateItems activator, ANOTable databaseObject) { _anoTable = databaseObject; base.SetDatabaseObject(activator, databaseObject); llServer.Text = _anoTable.Server.Name; CommonFunctionality.AddChecks(databaseObject); CommonFunctionality.StartChecking(); SetEnabledness(); CommonFunctionality.AddHelp(tbSuffix, "ANOTable.Suffix"); CommonFunctionality.AddHelp(llServer, "ANOTable.Server_ID"); CommonFunctionality.AddHelpString(tbInputDataType, "DataType", "Datatype for private identifiers being mapped e.g. varchar(100)"); CommonFunctionality.AddHelp(nIntegers, "ANOTable.NumberOfIntegersToUseInAnonymousRepresentation"); CommonFunctionality.AddHelp(nCharacters, "ANOTable.NumberOfCharactersToUseInAnonymousRepresentation"); if (!_anoTable.Server.WasCreatedBy(new ANOStorePatcher())) { _serverErrorProvider.SetError(llServer, "Server is not an ANO server"); } else { _serverErrorProvider.Clear(); } }
public override void SetDatabaseObject(IActivateItems activator, ExtractionInformation databaseObject) { _isLoading = true; ExtractionInformation = databaseObject; base.SetDatabaseObject(activator, databaseObject); Setup(databaseObject); ObjectSaverButton1.BeforeSave += objectSaverButton1OnBeforeSave; CommonFunctionality.Add(ragSmiley1); CommonFunctionality.AddHelp(cbHashOnDataRelease, "IColumn.HashOnDataRelease", "Hash on Data Release"); CommonFunctionality.AddHelp(cbIsExtractionIdentifier, "IColumn.IsExtractionIdentifier", "Is Extraction Identifier"); CommonFunctionality.AddHelp(cbIsPrimaryKey, "IColumn.IsPrimaryKey", "Is Extraction Primary Key"); CommonFunctionality.AddHelpString(lblIsTransform, "Transforms Data", "When the extraction SQL is different from the column SQL then it is considered to 'transform' the data. For example 'UPPER([mydb].[mycol]) as mycol'. Transforms must always have an alias."); lblIsTransform.Text = $"Transforms Data: {(ExtractionInformation.IsProperTransform() ? "Yes" : "No")}"; _isLoading = false; }
private void Initialize(IActivateItems activator, string initialDescription, Project projectSpecificIfAny) { CommonFunctionality.SetItemActivator(activator); var cols = _tableInfo.ColumnInfos; var forwardEngineer = new ForwardEngineerCatalogue(_tableInfo, cols, false); ExtractionInformation[] eis; forwardEngineer.ExecuteForwardEngineering(out _catalogue, out _catalogueItems, out eis); tbDescription.Text = initialDescription + " (" + Environment.UserName + " - " + DateTime.Now + ")"; tbTableName.Text = _tableInfo.Name; _catalogue.SaveToDatabase(); objectSaverButton1.SetupFor(this, _catalogue, activator); if (_binder == null) { _binder = new BinderWithErrorProviderFactory(activator); _binder.Bind(tbCatalogueName, "Text", _catalogue, "Name", false, DataSourceUpdateMode.OnPropertyChanged, c => c.Name); _binder.Bind(tbAcronym, "Text", _catalogue, "Acronym", false, DataSourceUpdateMode.OnPropertyChanged, c => c.Acronym); _binder.Bind(tbDescription, "Text", _catalogue, "Description", false, DataSourceUpdateMode.OnPropertyChanged, c => c.Description); } //Every CatalogueItem is either mapped to a ColumnInfo (not extractable) or a ExtractionInformation (extractable). To start out with they are not extractable foreach (CatalogueItem ci in _catalogueItems) { olvColumnExtractability.AddObject(new ColPair(ci, cols.Single(col => ci.ColumnInfo_ID == col.ID))); } _extractionCategories = new object[] { NotExtractable, ExtractionCategory.Core, ExtractionCategory.Supplemental, ExtractionCategory.SpecialApprovalRequired, ExtractionCategory.Internal, ExtractionCategory.Deprecated }; ddCategoriseMany.Items.AddRange(_extractionCategories); olvExtractionCategory.AspectGetter += ExtractionCategoryAspectGetter; olvColumnExtractability.AlwaysGroupByColumn = olvExtractionCategory; olvColumnExtractability.CellEditStarting += TlvColumnExtractabilityOnCellEditStarting; olvColumnExtractability.CellEditFinishing += TlvColumnExtractabilityOnCellEditFinishing; olvColumnExtractability.CellEditActivation = ObjectListView.CellEditActivateMode.SingleClick; olvIsExtractionIdentifier.AspectPutter += IsExtractionIdentifier_AspectPutter; olvIsExtractionIdentifier.AspectGetter += IsExtractionIdentifier_AspectGetter; olvColumnInfoName.ImageGetter = ImageGetter; olvColumnExtractability.RebuildColumns(); if (Activator.RepositoryLocator.DataExportRepository == null) { gbProjectSpecific.Enabled = false; } else { SelectProject(projectSpecificIfAny); pbProject.Image = activator.CoreIconProvider.GetImage(RDMPConcept.Project); } ddIsExtractionIdentifier.Items.Add("<<None>>"); ddIsExtractionIdentifier.Items.AddRange(olvColumnExtractability.Objects.OfType <ColPair>().ToArray()); CommonFunctionality.AddHelp(btnPickProject, "IExtractableDataSet.Project_ID", "Project Specific Datasets"); CommonFunctionality.AddHelpString(btnAddToExisting, "Add to existing catalogue", "Use this option if you want to create a Catalogue which extracts from multiple tables (via a JOIN). Once used you will still need to configure a JoinInfo between column(s) in all the tables the Catalogue draws data from."); }