public async Task <OperationResult> UpdateSettings(ItemsPlanningBaseSettings itemsPlanningBaseSettings) { try { await _options.UpdateDb(settings => { settings.LogLevel = itemsPlanningBaseSettings.LogLevel; settings.LogLimit = itemsPlanningBaseSettings.LogLimit; settings.MaxParallelism = itemsPlanningBaseSettings.MaxParallelism; settings.NumberOfWorkers = itemsPlanningBaseSettings.NumberOfWorkers; settings.SdkConnectionString = itemsPlanningBaseSettings.SdkConnectionString; settings.SiteIds = itemsPlanningBaseSettings.SiteIds; }, _dbContext, UserId); return(new OperationResult(true, _itemsPlanningLocalizationService.GetString("SettingsHaveBeenUpdatedSuccessfully"))); } catch (Exception e) { Trace.TraceError(e.Message); _logger.LogError(e.Message); return(new OperationResult(false, _itemsPlanningLocalizationService.GetString("ErrorWhileUpdatingSettings"))); } }
public async Task <OperationResult> UpdateSettings(ItemsPlanningBaseSettings itemsPlanningBaseSettings) { try { await _options.UpdateDb(settings => { settings.StartTime = itemsPlanningBaseSettings.StartTime; settings.EndTime = itemsPlanningBaseSettings.EndTime; settings.ReportHeaderName = itemsPlanningBaseSettings.ReportHeaderName; settings.ReportSubHeaderName = itemsPlanningBaseSettings.ReportSubHeaderName; settings.ReportImageName = itemsPlanningBaseSettings.ReportImageName; }, _dbContext, UserId); return(new OperationResult(true, _itemsPlanningLocalizationService.GetString("SettingsHaveBeenUpdatedSuccessfully"))); } catch (Exception e) { Trace.TraceError(e.Message); _logger.LogError(e.Message); return(new OperationResult(false, _itemsPlanningLocalizationService.GetString("ErrorWhileUpdatingSettings"))); } }
public async Task <OperationResult> UpdateSettings([FromBody] ItemsPlanningBaseSettings itemsPlanningBaseSettings) { return(await _itemsPlanningPnSettingsService.UpdateSettings(itemsPlanningBaseSettings)); }