private void ButtonClick(object sender, CellClickEventArgs cellClickEventArgs) { if (cellClickEventArgs.Column == olvEditInPopup) { var col = cellClickEventArgs.Model as IColumn; if (col != null) { var dialog = new SetSQLDialog(col.SelectSQL, new RDMPCommandFactory()); var querySyntaxSource = col as IHasQuerySyntaxHelper ?? _aggregate; var autoComplete = new AutoCompleteProviderFactory(Activator).Create(querySyntaxSource.GetQuerySyntaxHelper()); autoComplete.Add(col); autoComplete.Add(_aggregate); autoComplete.RegisterForEvents(dialog.QueryEditor); if (dialog.ShowDialog() == DialogResult.OK) { col.SelectSQL = dialog.Result; Save(col); } } } }
private void FigureOutGlobalsAndAutoComplete() { var factory = new FilterUIOptionsFactory(); var options = factory.Create(_extractionFilter); var autoCompleteFactory = new AutoCompleteProviderFactory(Activator); _autoCompleteProvider = autoCompleteFactory.Create(_extractionFilter.GetQuerySyntaxHelper()); foreach (var t in options.GetTableInfos()) { _autoCompleteProvider.Add(t); } foreach (var c in options.GetIColumnsInFilterScope()) { _autoCompleteProvider.Add(c); } GlobalFilterParameters = options.GetGlobalParametersInFilterScope(); foreach (ISqlParameter parameter in GlobalFilterParameters) { _autoCompleteProvider.Add(parameter); } _autoCompleteProvider.RegisterForEvents(QueryEditor); }
private void PopulateHavingText() { var autoComplete = new AutoCompleteProviderFactory(Activator).Create(_aggregate.GetQuerySyntaxHelper()); autoComplete.RegisterForEvents(QueryHaving); autoComplete.Add(_aggregate); QueryHaving.Text = _aggregate.HavingSQL; }
private void Setup(ExtractionInformation extractionInformation) { ExtractionInformation = extractionInformation; if (isFirstTimeSetupCalled) { //if the catalogue item has same name as the extraction information (alias) if (ExtractionInformation.CatalogueItem.Name.Equals(ExtractionInformation.ToString())) { _namesMatchedWhenDialogWasLaunched = true; } var autoComplete = new AutoCompleteProviderFactory(Activator).Create(ExtractionInformation.GetQuerySyntaxHelper()); autoComplete.Add(ExtractionInformation.CatalogueItem.Catalogue); autoComplete.RegisterForEvents(QueryEditor); } var colInfo = ExtractionInformation.ColumnInfo; //deal with empty values in database (shouldn't be any but could be) if (string.IsNullOrWhiteSpace(ExtractionInformation.SelectSQL) && colInfo != null) { ExtractionInformation.SelectSQL = colInfo.Name.Trim(); ExtractionInformation.SaveToDatabase(); } QueryEditor.Text = ExtractionInformation.SelectSQL + (!string.IsNullOrWhiteSpace(ExtractionInformation.Alias) ? _querySyntaxHelper.AliasPrefix + ExtractionInformation.Alias : ""); lblFromTable.Text = colInfo == null?"MISSING ColumnInfo":colInfo.TableInfo.Name; if (!pSql.Controls.Contains(QueryEditor)) { pSql.Controls.Add(QueryEditor); } }