private async Task AddToSolution(bool withSelect, string solutionUniqueName) { var entitiesList = GetSelectedEntitiesList().Select(e => e.Id); if (!entitiesList.Any()) { return; } var service = await GetService(); if (service == null) { return; } try { this._iWriteToOutput.ActivateOutputWindow(service.ConnectionData); await SolutionController.AddSolutionComponentsGroupToSolution(_iWriteToOutput, service, null, _commonConfig, solutionUniqueName, ComponentType.Report, entitiesList, null, withSelect); } catch (Exception ex) { this._iWriteToOutput.WriteErrorToOutput(service.ConnectionData, ex); } }
private async Task AddToSolution(bool withSelect, string solutionUniqueName) { var entity = GetSelectedEntity(); if (entity == null) { return; } _commonConfig.Save(); var service = await GetService(); var descriptor = GetDescriptor(service); try { this._iWriteToOutput.ActivateOutputWindow(service.ConnectionData); await SolutionController.AddSolutionComponentsGroupToSolution(_iWriteToOutput, service, descriptor, _commonConfig, solutionUniqueName, ComponentType.PluginAssembly, new[] { entity.Id }, null, withSelect); } catch (Exception ex) { this._iWriteToOutput.WriteErrorToOutput(service.ConnectionData, ex); } }
private async Task AddMessageToSolution(bool withSelect, string solutionUniqueName) { var messagesList = GetSelectedEntitiesList() .Where(e => e.SdkMessageId != null) .Select(e => e.SdkMessageId.Id) .Distinct() .ToList(); if (!messagesList.Any()) { return; } var service = await GetService(); if (service == null) { return; } var descriptor = GetSolutionComponentDescriptor(service); _commonConfig.Save(); try { this._iWriteToOutput.ActivateOutputWindow(service.ConnectionData); await SolutionController.AddSolutionComponentsGroupToSolution(_iWriteToOutput, service, descriptor, _commonConfig, solutionUniqueName, ComponentType.SdkMessage, messagesList, null, withSelect); } catch (Exception ex) { this._iWriteToOutput.WriteErrorToOutput(service.ConnectionData, ex); } }
private async Task AddAssemblyStepsToSolution(bool withSelect, string solutionUniqueName) { var entity = GetSelectedEntity(); if (entity == null) { return; } var service = await GetService(); var repository = new SdkMessageProcessingStepRepository(service); var steps = await repository.GetAllStepsByPluginAssemblyAsync(entity.Id); if (!steps.Any()) { return; } _commonConfig.Save(); try { this._iWriteToOutput.ActivateOutputWindow(service.ConnectionData); await SolutionController.AddSolutionComponentsGroupToSolution(_iWriteToOutput, service, null, _commonConfig, solutionUniqueName, ComponentType.SdkMessageProcessingStep, steps.Select(s => s.Id), null, withSelect); } catch (Exception ex) { this._iWriteToOutput.WriteErrorToOutput(service.ConnectionData, ex); } }
static void Main(string[] args) { var json = File.ReadAllText(args[0]); var resultFileNameCSV = args[1]; SolutionController controller = JsonConvert.DeserializeObject <SolutionController>(json); var titles = controller.GetAlternativesTitles(); var grid = controller.GetSolutionsAsDataGrid(); var line = string.Join(";", titles.ToArray()); File.WriteAllLines(resultFileNameCSV, new[] { line }); Console.WriteLine(line); foreach (var row in grid) { line = ""; var first = true; foreach (var cell in row.Cells) { var c = (DataGridViewTextBoxCell)cell; if (!first) { line += ";"; } line += $"{c.Value}"; first = false; } Console.WriteLine(line); File.AppendAllLines(resultFileNameCSV, new[] { line }); } }
private async Task AddToSolutionAsync(bool withSelect, string solutionUniqueName) { var solutionImageComponents = lstVwComponents.SelectedItems.OfType <SolutionImageComponent>().ToList(); if (!solutionImageComponents.Any()) { return; } var service = await GetService(); var descriptor = GetDescriptor(service); var solutionComponents = await descriptor.GetSolutionComponentsListAsync(solutionImageComponents); if (!solutionComponents.Any()) { _iWriteToOutput.WriteToOutput(service.ConnectionData, Properties.OutputStrings.SolutionComponentNotFoundInConnectionFormat1, service.ConnectionData.Name); _iWriteToOutput.ActivateOutputWindow(service.ConnectionData); return; } _commonConfig.Save(); try { this._iWriteToOutput.ActivateOutputWindow(service.ConnectionData); await SolutionController.AddSolutionComponentsCollectionToSolution(_iWriteToOutput, service, descriptor, _commonConfig, solutionUniqueName, solutionComponents, withSelect); } catch (Exception ex) { this._iWriteToOutput.WriteErrorToOutput(null, ex); } }
/// <summary> /// Provides a list of Connectors for All the three roles - LoginContentManager, LoginContentEditor and LoginCommunityManager /// </summary> public static IList <IWebApiConnector> AllLogins() { return(SolutionController.IsSocial() ? new List <IWebApiConnector> { LoginContentManager(), LoginCommunityManager(), LoginContentManager() } : new List <IWebApiConnector> { LoginContentManager(), LoginContentManager() }); }
private async Task AddAssemblyStepsToSolution(bool withSelect, string solutionUniqueName) { var entitiesList = GetSelectedEntitiesList() .Where(e => e.PluginAssemblyId != null) .Select(e => e.PluginAssemblyId.Id) .Distinct() .ToList() ; if (!entitiesList.Any()) { return; } var service = await GetService(); if (service == null) { return; } var steps = new List <SdkMessageProcessingStep>(); var repository = new SdkMessageProcessingStepRepository(service); foreach (var id in entitiesList) { steps.AddRange(await repository.GetAllStepsByPluginAssemblyAsync(id)); } if (!steps.Any()) { return; } _commonConfig.Save(); try { this._iWriteToOutput.ActivateOutputWindow(service.ConnectionData); await SolutionController.AddSolutionComponentsGroupToSolution(_iWriteToOutput, service, null, _commonConfig, solutionUniqueName, ComponentType.SdkMessageProcessingStep, steps.Select(s => s.Id), null, withSelect); } catch (Exception ex) { this._iWriteToOutput.WriteErrorToOutput(service.ConnectionData, ex); } }
private void LoadConfigFromFile() { try { if (openFileDialog.ShowDialog() == DialogResult.Cancel) { return; } string filename = openFileDialog.FileName; string fileText = System.IO.File.ReadAllText(filename); SolutionController NewController = JsonConvert.DeserializeObject <SolutionController>(fileText); controller = NewController; FillTablesFromLoadedFile(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
protected override async Task AddEntityMetadataToSolution( ConnectionData connectionData , IEnumerable <Guid> idsEntityMetadataEnum , bool withSelect , string solutionUniqueName , SolutionComponent.Schema.OptionSets.rootcomponentbehavior rootComponentBehavior ) { if (idsEntityMetadataEnum == null || !idsEntityMetadataEnum.Any()) { return; } _commonConfig.Save(); var service = await GetOrganizationService(connectionData); var descriptor = GetSolutionComponentDescriptor(service); try { this._iWriteToOutput.ActivateOutputWindow(service.ConnectionData); await SolutionController.AddSolutionComponentsGroupToSolution( _iWriteToOutput , service , descriptor , _commonConfig , solutionUniqueName , ComponentType.Entity , idsEntityMetadataEnum , rootComponentBehavior , withSelect ); } catch (Exception ex) { this._iWriteToOutput.WriteErrorToOutput(service.ConnectionData, ex); } }
private async Task AddAttributeToSolution(bool withSelect, string solutionUniqueName) { var attributeList = GetSelectedAttributes(); if (attributeList == null || !attributeList.Any()) { return; } var commonConfig = CommonConfiguration.Get(); try { this._iWriteToOutput.ActivateOutputWindow(_service.ConnectionData); await SolutionController.AddSolutionComponentsGroupToSolution(_iWriteToOutput, _service, null, commonConfig, solutionUniqueName, ComponentType.Attribute, attributeList.Select(item => item.AttributeMetadata.MetadataId.Value).ToList(), null, withSelect); } catch (Exception ex) { this._iWriteToOutput.WriteErrorToOutput(_service.ConnectionData, ex); } }
private async Task AddComponentsToSolution(ComponentType componentType, IEnumerable <Guid> idList, SolutionComponent.Schema.OptionSets.rootcomponentbehavior?rootComponentBehavior, bool withSelect, string solutionUniqueName) { if (!idList.Any()) { return; } _commonConfig.Save(); var service = await GetService(); try { this._iWriteToOutput.ActivateOutputWindow(service.ConnectionData); await SolutionController.AddSolutionComponentsGroupToSolution(_iWriteToOutput, service, null, _commonConfig, solutionUniqueName, componentType, idList, rootComponentBehavior, withSelect); } catch (Exception ex) { this._iWriteToOutput.WriteErrorToOutput(service.ConnectionData, ex); } }
private async Task AddEntityRelationshipToSolution(bool withSelect, string solutionUniqueName) { var entityRelationshipList = GetSelectedEntityRelationships(); if (entityRelationshipList == null || !entityRelationshipList.Any()) { return; } _commonConfig.Save(); var service = await GetService(); try { this._iWriteToOutput.ActivateOutputWindow(service.ConnectionData); await SolutionController.AddSolutionComponentsGroupToSolution(_iWriteToOutput, service, null, _commonConfig, solutionUniqueName, ComponentType.EntityRelationship, entityRelationshipList.Select(item => item.ManyToManyRelationshipMetadata.MetadataId.Value).ToList(), null, withSelect); } catch (Exception ex) { this._iWriteToOutput.WriteErrorToOutput(service.ConnectionData, ex); } }
private async Task AddApplicationRibbonToSolution(bool withSelect, string solutionUniqueName) { var service = await GetService(); var repository = new RibbonCustomizationRepository(service); var ribbonCustomization = await repository.FindApplicationRibbonCustomizationAsync(); if (ribbonCustomization != null) { _commonConfig.Save(); try { this._iWriteToOutput.ActivateOutputWindow(service.ConnectionData); await SolutionController.AddSolutionComponentsGroupToSolution(_iWriteToOutput, service, null, _commonConfig, solutionUniqueName, ComponentType.RibbonCustomization, new[] { ribbonCustomization.Id }, null, withSelect); } catch (Exception ex) { this._iWriteToOutput.WriteErrorToOutput(service.ConnectionData, ex); } } }
private async Task AddToSolution(bool withSelect, string solutionUniqueName) { var entity = GetSelectedEntity(); if (entity == null) { return; } _commonConfig.Save(); var service = await GetService(); try { this._iWriteToOutput.ActivateOutputWindow(service.ConnectionData); await SolutionController.AddSolutionComponentsGroupToSolution(_iWriteToOutput, service, null, _commonConfig, solutionUniqueName, ComponentType.OptionSet, new[] { entity.OptionSetMetadata.MetadataId.Value }, null, withSelect); } catch (Exception ex) { this._iWriteToOutput.WriteErrorToOutput(service.ConnectionData, ex); } }
private async Task AddToSolution(bool withSelect, string solutionUniqueName, SolutionComponent.Schema.OptionSets.rootcomponentbehavior rootComponentBehavior) { var entityList = GetSelectedEntities(); if (entityList == null || !entityList.Any()) { return; } _commonConfig.Save(); var service = await GetService(); try { this._iWriteToOutput.ActivateOutputWindow(service.ConnectionData); await SolutionController.AddSolutionComponentsGroupToSolution(_iWriteToOutput, service, null, _commonConfig, solutionUniqueName, ComponentType.Entity, entityList.Select(item => item.EntityMetadata.MetadataId.Value).ToList(), rootComponentBehavior, withSelect); } catch (Exception ex) { this._iWriteToOutput.WriteErrorToOutput(service.ConnectionData, ex); } }
public void Int() { MockDbRepository = new MockDbRepository(); AutoMapperConfiguration.Configure(); solutionController = new SolutionController(MockDbRepository.Repository); }