public void SetConfig(IDMEEditor pDMEEditor, IDMLogger plogger, IUtil putil, string[] args, PassedArgs obj, IErrorsInfo per) { Passedarg = obj; // SourceConnection = pdataSource; Logger = plogger; // Visutil = new VisUtil(Logger,putil,per); util = putil; MyDataView = (DMDataView)Passedarg.DMView; DMEEditor = pDMEEditor; ErrorObject = per; Visutil = (IVisUtil)obj.Objects.Where(c => c.Name == "VISUTIL").FirstOrDefault().obj; rdb = (RDBSource)DMEEditor.GetDataSource(Passedarg.DatasourceName); switch (obj.ObjectType) { case "RDBMSTABLE": EntityName = obj.CurrentEntity; SourceConnection = (IRDBSource)Passedarg.DataSource; break; case "CRUDENTITY": EntityName = obj.CurrentEntity; SourceConnection = DMEEditor.GetDataSource(Passedarg.DatasourceName); break; default: break; } LoadTable(EntityName); }
public void SetConfig(IDMEEditor pbl, IDMLogger plogger, IUtil putil, string[] args, PassedArgs e, IErrorsInfo per) { Passedarg = e; DMEEditor = pbl; Visutil = (IVisUtil)e.Objects.Where(c => c.Name == "VISUTIL").FirstOrDefault().obj; branch = (IBranch)e.Objects.Where(c => c.Name == "Branch").FirstOrDefault().obj; if (e.Objects.Where(c => c.Name == "ParentBranch").Any()) { Parentbranch = (IBranch)e.Objects.Where(c => c.Name == "ParentBranch").FirstOrDefault().obj; } scripHeader = new SyncDataSource(); Srcds = DMEEditor.GetDataSource(branch.BranchText); if (Srcds != null) { Srcds.Openconnection(); if (Srcds.ConnectionStatus == ConnectionState.Open) { } else { MessageBox.Show($"Error Cannot Connect to Source {branch.BranchText}"); DMEEditor.AddLogMessage("Fail", $"Error Cannot Connext to Source {branch.BranchText}", DateTime.Now, 0, null, Errors.Failed); } } else { DMEEditor.AddLogMessage("Fail", $"Error Cannot get Source {branch.BranchText}", DateTime.Now, 0, null, Errors.Failed); MessageBox.Show($"Error Cannot get Source {branch.BranchText}"); } }
public void SetConfig(IDMEEditor pbl, IDMLogger plogger, IUtil putil, string[] args, PassedArgs e, IErrorsInfo per) { Passedarg = e; Logger = plogger; ErrorObject = per; DMEEditor = pbl; Visutil = (IVisUtil)e.Objects.Where(c => c.Name == "VISUTIL").FirstOrDefault().obj; ob = (object)e.Objects.Where(c => c.Name == e.CurrentEntity).FirstOrDefault().obj; EntitybindingSource.DataSource = ob; EntitybindingSource.AllowNew = false; SaveEntitybutton.Click += SaveEntitybutton_Click; ds = DMEEditor.GetDataSource(e.DatasourceName); // ds.Dataconnection.OpenConnection(); DMEEditor.OpenDataSource(e.DatasourceName); if (ds != null && ds.ConnectionStatus == ConnectionState.Open) { EntityStructure = ds.GetEntityStructure(e.CurrentEntity, true); if (EntityStructure != null) { if (EntityStructure.Fields != null) { if (EntityStructure.Fields.Count > 0) { EntityNamelabel.Text = EntityStructure.EntityName; subtitlelabel.Text = $"From Data Source {EntityStructure.DataSourceID}"; EntityName = EntityStructure.EntityName; Visutil.controlEditor.GenerateEntityonControl(EntityName, ref panel1, GetObjectType(), ref EntitybindingSource, 150, EntityStructure.DataSourceID); } } } } }
public void SetConfig(IDMEEditor pDMEEditor, IDMLogger plogger, IUtil putil, string[] args, PassedArgs obj, IErrorsInfo per) { Passedarg = obj; Logger = plogger; util = putil; ErrorObject = per; DMEEditor = pDMEEditor; vds = (DataViewDataSource)DMEEditor.GetDataSource(obj.DMView.DataViewDataSourceID); Visutil = (IVisUtil)obj.Objects.Where(c => c.Name == "VISUTIL").FirstOrDefault().obj; branch = (IBranch)obj.Objects.Where(c => c.Name == "Branch").FirstOrDefault().obj; EntityStructure = (EntityStructure)obj.Objects.Where(c => c.Name == "EntityStructure").FirstOrDefault().obj; if (obj.Objects.Where(c => c.Name == "ParentBranch").Any()) { Parentbranch = (IBranch)obj.Objects.Where(c => c.Name == "ParentBranch").FirstOrDefault().obj; ParentEntity = vds.GetEntityStructure(Parentbranch.BranchText, true); } if (obj.CurrentEntity != null) { EntityName = obj.CurrentEntity; } else { EntityName = ""; } this.entitiesBindingNavigatorSaveItem.Click += EntitiesBindingNavigatorSaveItem_Click; this.otherentitiesbindingSource.DataSource = vds.Entities.Where(o => o.Id > 0 && o.Id != EntityStructure.Id); this.entitiesBindingSource.DataSource = EntityStructure; this.fieldsBindingSource.DataSource = this.entitiesBindingSource; //this.otherentityfieldsbindingSource.ResetBindings(true); this.ParentEntitycomboBox.SelectedIndexChanged += ParentEntitycomboBox_SelectedIndexChanged; }
public void SetConfig(IDMEEditor pbl, IDMLogger plogger, IUtil putil, string[] args, PassedArgs e, IErrorsInfo per) { Passedarg = e; Logger = plogger; ErrorObject = per; DMEEditor = pbl; Visutil = (IVisUtil)e.Objects.Where(c => c.Name == "VISUTIL").FirstOrDefault().obj; branch = (IBranch)e.Objects.Where(c => c.Name == "Branch").FirstOrDefault().obj; RootAppBranch = (IBranch)e.Objects.Where(c => c.Name == "RootAppBranch").FirstOrDefault().obj; dataViewDataSourceBindingSource.AddingNew += DataViewDataSourceBindingSource_AddingNew; entitiesBindingSource.AddingNew += EntitiesBindingSource_AddingNew; dataViewDataSourceBindingNavigatorSaveItem.Click += DataViewDataSourceBindingNavigatorSaveItem_Click; foreach (var item in Enum.GetValues(typeof(ViewType))) { this.ViewtypeComboBox.Items.Add(item); } ds = (DataViewDataSource)DMEEditor.GetDataSource(e.CurrentEntity); ds.LoadView(); dataViewDataSourceBindingSource.DataSource = ds.DataView; this.viewNameTextBox.Enabled = false; this.dataSourcesBindingSource.DataSource = DMEEditor.DataSources; this.dataConnectionsBindingSource.DataSource = DMEEditor.ConfigEditor.DataConnections; entitiesBindingSource.DataSource = dataViewDataSourceBindingSource; this.entitiesDataGridView.DataError += EntitiesDataGridView_DataError; this.ChangeDatasourceButton.Click += ChangeDatasourceButton_Click; }
public void SetConfig(IDMEEditor pbl, IDMLogger plogger, IUtil putil, string[] args, PassedArgs e, IErrorsInfo per) { Passedarg = e; Logger = plogger; ErrorObject = per; DMEEditor = pbl; Visutil = (IVisUtil)e.Objects.Where(c => c.Name == "VISUTIL").FirstOrDefault().obj; if (e.Objects.Where(c => c.Name == "Branch").Any()) { branch = (IBranch)e.Objects.Where(c => c.Name == "Branch").FirstOrDefault().obj; } foreach (ConnectionProperties c in DMEEditor.ConfigEditor.DataConnections) { var t = dataSourceIDComboBox.Items.Add(c.ConnectionName); } foreach (var item in Enum.GetValues(typeof(DataSourceType))) { var t = databaseTypeComboBox.Items.Add(item); } foreach (var item in Enum.GetValues(typeof(DatasourceCategory))) { var t = categoryComboBox.Items.Add(item); } ds = DMEEditor.GetDataSource(e.DatasourceName); if (!string.IsNullOrEmpty(e.CurrentEntity)) { this.entitiesBindingSource.DataSource = ds.Entities[ds.Entities.FindIndex(p => string.Equals(p.EntityName, e.CurrentEntity, StringComparison.OrdinalIgnoreCase))]; } }
public void SetConfig(IDMEEditor pbl, IDMLogger plogger, IUtil putil, string[] args, PassedArgs e, IErrorsInfo per) { Passedarg = e; Logger = plogger; ErrorObject = per; DMEEditor = pbl; Visutil = (IVisUtil)e.Objects.Where(c => c.Name == "VISUTIL").FirstOrDefault().obj; this.entitiesBindingNavigatorSaveItem.Click += EntitiesBindingNavigatorSaveItem_Click; EntityName = e.DatasourceName; ds = DMEEditor.GetDataSource(e.DatasourceName); this.entitiesBindingSource.AddingNew += EntitiesBindingSource_AddingNew; this.entitiesBindingSource.DataSource = ds.Entities; }
public void SetConfig(IDMEEditor pbl, IDMLogger plogger, IUtil putil, string[] args, PassedArgs e, IErrorsInfo per) { Passedarg = e; Logger = plogger; ErrorObject = per; DMEEditor = pbl; Visutil = (IVisUtil)e.Objects.Where(c => c.Name == "VISUTIL").FirstOrDefault().obj; ds = DMEEditor.GetDataSource(e.DatasourceName); // ds.Dataconnection.OpenConnection(); ds.Openconnection(); // ds.ConnectionStatus = ds.Dataconnection.ConnectionStatus; if (ds != null && ds.ConnectionStatus == ConnectionState.Open) { EntityName = e.CurrentEntity; if (e.Objects.Where(c => c.Name == "EntityStructure").Any()) { EntityStructure = (EntityStructure)e.Objects.Where(c => c.Name == "EntityStructure").FirstOrDefault().obj; } else { EntityStructure = ds.GetEntityStructure(EntityName, true); e.Objects.Add(new ObjectItem { Name = "EntityStructure", obj = EntityStructure }); } if (EntityStructure != null) { if (EntityStructure.Fields != null) { if (EntityStructure.Fields.Count > 0) { uc_filtercontrol1.SetConfig(pbl, plogger, putil, args, e, per); } } } EntityStructure.Filters = new List <ReportFilter>(); } SubmitFilterbutton.Click += SubmitFilterbutton_Click; expandbutton.Click += Expandbutton_Click; InsertNewEntitybutton.Click += InsertNewEntitybutton_Click; DeleteSelectedbutton.Click += DeleteSelectedbutton_Click; EditSelectedbutton.Click += EditSelectedbutton_Click; Printbutton.Click += Printbutton_Click; // CreateFilterGrid(); }
public void SetConfig(IDMEEditor pbl, IDMLogger plogger, IUtil putil, string[] args, PassedArgs e, IErrorsInfo per) { Logger = plogger; ErrorObject = per; DMEEditor = pbl; Visutil = (IVisUtil)e.Objects.Where(c => c.Name == "VISUTIL").FirstOrDefault().obj; ds = DMEEditor.GetDataSource(e.DatasourceName); //ds.Dataconnection.OpenConnection(); DMEEditor.OpenDataSource(e.DatasourceName); if (ds != null && ds.ConnectionStatus == ConnectionState.Open) { EntityName = e.CurrentEntity; if (e.Objects.Where(c => c.Name == "EntityStructure").Any()) { EntityStructure = (EntityStructure)e.Objects.Where(c => c.Name == "EntityStructure").FirstOrDefault().obj; } else { EntityStructure = ds.GetEntityStructure(EntityName, true); e.Objects.Add(new ObjectItem { Name = "EntityStructure", obj = EntityStructure }); } // enttype = ds.GetEntityType(EntityName); if (EntityStructure != null) { EntityStructure.Filters = new List <ReportFilter>(); if (EntityStructure.Fields != null) { if (EntityStructure.Fields.Count > 0) { // lsop = new List<FilterType>(); AddFilterTypes(); defaults = DMEEditor.ConfigEditor.DataConnections[DMEEditor.ConfigEditor.DataConnections.FindIndex(i => i.ConnectionName == ds.DatasourceName)].DatasourceDefaults; //CreateControls(this, EntityStructure, defaults); Visutil.controlEditor.CreateEntityFilterControls(this, EntityStructure, defaults); } } } } }
public void SetConfig(IDMEEditor pbl, IDMLogger plogger, IUtil putil, string[] args, PassedArgs e, IErrorsInfo per) { Passedarg = e; Logger = plogger; ErrorObject = per; DMEEditor = pbl; Visutil = (IVisUtil)e.Objects.Where(c => c.Name == "VISUTIL").FirstOrDefault().obj; branch = (IBranch)e.Objects.Where(c => c.Name == "Branch").FirstOrDefault().obj; RootCompositeLayerBranch = (IBranch)e.Objects.Where(c => c.Name == "RootCompositeLayerBranch").FirstOrDefault().obj; if (branch.DataSourceName != null) { ds = (DataViewDataSource)DMEEditor.GetDataSource(branch.DataSourceName); ds.Openconnection(); } dataViewDataSourceNameComboBox.Items.Clear(); foreach (var item in DMEEditor.ConfigEditor.DataConnections.Where(x => x.Category == DatasourceCategory.VIEWS).ToList()) { dataViewDataSourceNameComboBox.Items.Add(item.ConnectionName); } localDBDriverComboBox.Items.Clear(); localDBDriverVersionComboBox.Items.Clear(); foreach (var item in DMEEditor.ConfigEditor.DataDriversClasses.Where(x => x.CreateLocal == true && x.classHandler != null)) { localDBDriverComboBox.Items.Add(item.classHandler); localDBDriverVersionComboBox.Items.Add(item.version); } localDBDriverComboBox.SelectedValueChanged += LocalDBDriverComboBox_SelectedValueChanged; this.FolderLocationbutton.Click += FolderLocationbutton_Click; Createbutton.Click += Createbutton_Click; compositeQueryLayersBindingSource.DataSource = DMEEditor.ConfigEditor.CompositeQueryLayers; compositeQueryLayersBindingSource.AddingNew += CompositeQueryLayersBindingSource_AddingNew; compositeQueryLayersBindingSource.AddNew(); this.layerNameTextBox.TextChanged += LayerNameTextBox_TextChanged; // localDBDriverComboBox.SelectedIndex = 1; }
public void SetConfig(IDMEEditor pbl, IDMLogger plogger, IUtil putil, string[] args, PassedArgs e, IErrorsInfo per) { Passedarg = e; Logger = plogger; ErrorObject = per; DMEEditor = pbl; SourceConnection = DMEEditor.GetDataSource(e.DatasourceName); Visutil = (IVisUtil)e.Objects.Where(c => c.Name == "VISUTIL").FirstOrDefault().obj; branch = (IBranch)e.Objects.Where(c => c.Name == "Branch").FirstOrDefault().obj; if (e.Objects.Where(c => c.Name == "ParentBranch").Any()) { Parentbranch = (IBranch)e.Objects.Where(c => c.Name == "ParentBranch").FirstOrDefault().obj; //ParentEntity = SourceConnection.GetEntityStructure(Parentbranch.BranchText, true); } foreach (ConnectionProperties c in DMEEditor.ConfigEditor.DataConnections) { var t = dataSourceIDComboBox.Items.Add(c.ConnectionName); } foreach (var item in Enum.GetValues(typeof(ViewType))) { viewtypeComboBox.Items.Add(item); } this.dataSourceIDComboBox.SelectedIndexChanged += ComboBox1_SelectedIndexChanged; this.ValidateQuerybutton.Click += ValidateQuerybutton_Click; this.ValidateFKbutton.Click += ValidateFKbutton_Click; this.SaveEntitybutton.Click += SaveEntitybutton_Click; this.ValidateFieldsbutton.Click += ValidateFieldsbutton_Click; if (e.CurrentEntity != null) { EntityName = e.CurrentEntity; } else { EntityName = ""; } EntityStructure = SourceConnection.GetEntityStructure(EntityName, false); if (EntityStructure == null) { if (!string.IsNullOrEmpty(e.ParameterString1)) { EntityStructure = SourceConnection.GetEntityStructure(e.ParameterString1, false); } } if (EntityStructure == null) { if (!string.IsNullOrEmpty(e.ParameterString2)) { EntityStructure = SourceConnection.GetEntityStructure(e.ParameterString2, false); } } if (EntityStructure == null) { if (!string.IsNullOrEmpty(e.ParameterString3)) { EntityStructure = SourceConnection.GetEntityStructure(e.ParameterString3, false); } } if (EntityStructure == null) { MessageBox.Show("Cannot Find Entity in DataSource"); } else { this.dataHierarchyBindingSource.ResetBindings(true); this.fieldsBindingSource.ResetBindings(true); dataHierarchyBindingSource.DataSource = EntityStructure; //ConnectionProperties connection = DMEEditor.ConfigEditor.DataConnections.Where(o => o.ConnectionName.Equals(this.SourceConnection.DatasourceName, StringComparison.OrdinalIgnoreCase)).FirstOrDefault(); //ConnectionDriversConfig conf = DMEEditor.Utilfunction.LinkConnection2Drivers(connection); //if (conf != null) // { // dataTypesMapBindingSource.DataSource = DMEEditor.ConfigEditor.DataTypesMap.Where(p => p.DataSourceName.Equals(conf.classHandler, StringComparison.OrdinalIgnoreCase)).Distinct(); // } DMEEditor.ConfigEditor.ReadDataTypeFile(); this.fieldtypeDataGridViewTextBoxColumn.DataSource = DMEEditor.typesHelper.GetNetDataTypes2(); // fieldtypeDataGridViewTextBoxColumn.DataSource = dataTypesMapBindingSource; } this.fieldsDataGridView.DataError += FieldsDataGridView_DataError; }
public void SetConfig(IDMEEditor pDMEEditor, IDMLogger plogger, IUtil putil, string[] args, PassedArgs obj, IErrorsInfo per) { Passedarg = obj; Logger = plogger; util = putil; ErrorObject = per; DMEEditor = pDMEEditor; vds = (DataViewDataSource)DMEEditor.GetDataSource(obj.DMView.DataViewDataSourceID); Visutil = (IVisUtil)obj.Objects.Where(c => c.Name == "VISUTIL").FirstOrDefault().obj; branch = (IBranch)obj.Objects.Where(c => c.Name == "Branch").FirstOrDefault().obj; if (obj.Objects.Where(c => c.Name == "ParentBranch").Any()) { Parentbranch = (IBranch)obj.Objects.Where(c => c.Name == "ParentBranch").FirstOrDefault().obj; ParentEntity = vds.GetEntityStructure(Parentbranch.BranchText, true); } foreach (ConnectionProperties c in DMEEditor.ConfigEditor.DataConnections) { var t = dataSourceIDComboBox.Items.Add(c.ConnectionName); } foreach (var item in Enum.GetValues(typeof(ViewType))) { viewtypeComboBox.Items.Add(item); } this.dataSourceIDComboBox.SelectedIndexChanged += ComboBox1_SelectedIndexChanged; this.ValidateQuerybutton.Click += ValidateQuerybutton_Click; // this.ValidateFKbutton.Click += ValidateFKbutton_Click; this.SaveEntitybutton.Click += SaveEntitybutton_Click; // this.ValidateFieldsbutton.Click += ValidateFieldsbutton_Click; if (obj.CurrentEntity != null) { EntityName = obj.CurrentEntity; } else { EntityName = ""; } if (Passedarg.EventType == "NEWENTITY" || Passedarg.EventType == "NEWECHILDNTITY") { EntityStructure = new EntityStructure(); EntityStructure.Created = false; EntityStructure.Fields = new System.Collections.Generic.List <EntityField>(); EntityStructure.Id = vds.Entities.Max(p => p.Id) + 1; EntityStructure.DataSourceID = vds.DatasourceName; if (vds.Category == DatasourceCategory.VIEWS) { EntityStructure.ViewID = vds.ViewID; EntityStructure.Viewtype = ViewType.Query; EntityStructure.DatabaseType = DataSourceType.Json; } if (ParentEntity != null) { EntityStructure.ParentId = ParentEntity.Id; } else { EntityStructure.ParentId = -1; } EntityStructure.Drawn = false; this.nameTextBox.Enabled = true; } else { this.nameTextBox.Enabled = false; EntityStructure = (EntityStructure)obj.Objects.Where(c => c.Name == "EntityStructure").FirstOrDefault().obj; } this.dataHierarchyBindingSource.ResetBindings(true); this.fieldsBindingSource.ResetBindings(true); dataHierarchyBindingSource.DataSource = EntityStructure; }
public void SetConfig(IDMEEditor pbl, IDMLogger plogger, IUtil putil, string[] args, PassedArgs e, IErrorsInfo per) { Logger = plogger; ErrorObject = per; DMEEditor = pbl; Visutil = (IVisUtil)e.Objects.Where(c => c.Name == "VISUTIL").FirstOrDefault().obj; branch = (IBranch)e.Objects.Where(c => c.Name == "Branch").FirstOrDefault().obj; ParentBranch = (IBranch)e.Objects.Where(c => c.Name == "ParentBranch").FirstOrDefault().obj; webAPIData = DMEEditor.GetDataSource(e.DatasourceName); if (webAPIData != null) { // webAPIData.Dataconnection.OpenConnection(); DMEEditor.OpenDataSource(e.DatasourceName); CurrentEntity = e.CurrentEntity; ConnectionProperties cn = DMEEditor.ConfigEditor.DataConnections.Where(p => string.Equals(p.ConnectionName, e.DatasourceName, StringComparison.OrdinalIgnoreCase)).FirstOrDefault(); ent = webAPIData.Entities.Where(o => string.Equals(o.EntityName, e.CurrentEntity, StringComparison.OrdinalIgnoreCase)).FirstOrDefault(); ls = ent.Fields; this.dataGridView1.DataSource = DataBindingSource; DataGridView grid = dv.CreateGrid(); if (ent.Filters == null) { ent.Filters = new List <ReportFilter>(); } ent.Filters.Clear(); for (int i = 0; i <= ls.Count - 1; i++) { ReportFilter r = new ReportFilter(); r.FieldName = ls[i].fieldname; r.Operator = "="; ent.Filters.Add(r); FieldNames.Add(ls[i].fieldname); } filtersBindingSource.DataSource = ent.Filters; if (lsop == null) { lsop = new List <string> { "=", ">=", "<=", ">", "<" }; } grid.AutoGenerateColumns = false; grid.DataSource = this.filtersBindingSource; grid.Columns.Add(dv.CreateComoboBoxColumnForGrid("FieldName", "Column", FieldNames)); grid.Columns.Add(dv.CreateComoboBoxColumnForGrid("Operator", "Operator", lsop)); grid.Columns.Add(dv.CreateTextColumnForGrid("FilterValue", "Value")); grid.DataError += Grid_DataError; // grid.AllowUserToAddRows = true; grid.Left = 5; grid.Top = 50; grid.Height = 220; grid.Width = FilterPanel.Width - 25; FilterPanel.Controls.Add(grid); grid.Dock = DockStyle.Fill; } else { MessageBox.Show("Error Could not Find WebApi Datasource", "BeepDM"); } this.GetDataButton.Click += GetDataButton_Click; }