/// <summary> /// Free Managed Ressources. Typically by calling Dispose on them /// </summary> protected override void DisposeManagedRessources() { if (_reportsService != null) { _reportsService.Dispose(); _reportsService = null; } if (_metadataService != null) { _metadataService.Dispose(); _metadataService = null; } if (_settingsService != null) { _settingsService.Dispose(); _settingsService = null; } if (_securityService != null) { _securityService.Dispose(); _securityService = null; } if (_dataService != null) { _dataService.Dispose(); _dataService = null; } base.DisposeManagedRessources(); }
public void GetPrecisionReportByPosition( [FromServices] IReportsService reportsService, [FromQuery] GetPrecisionReportQuery query) { var report = reportsService.GetPrecisionReport(query).ToList() .GroupBy(data => new { X = data.RealX, Y = data.RealY }) .Select(position => new { position.Key.X, position.Key.Y, Error = position.Average(position => position.Error), MinError = position.Min(position => position.Error), MaxError = position.Max(position => position.Error) }); var csvConfiguration = new CsvConfiguration(CultureInfo.InvariantCulture) { }; var formattedDate = DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss"); var formattedFilename = $"PrecisionPerPosition-{query.LocaleId}-N{query.Neighbours}-USW{query.UnmatchedSignalsWeight}-_{formattedDate}.csv"; this.HttpContext.Response.StatusCode = 200; this.HttpContext.Response.Headers.Add("Content-Type", "text/csv"); this.HttpContext.Response.Headers.Add("Content-Disposition", $"attachment; filename=\"{formattedFilename}\""); var streamWriter = new StreamWriter( this.HttpContext.Response.BodyWriter.AsStream()); using var csvWriter = new CsvWriter(streamWriter, csvConfiguration); csvWriter.WriteRecords(report); }
/// <summary> /// Initializes a new instance of the <see cref="ReportsController"/> class. /// </summary> /// <param name="hostingEnvironment">The hostingEnvironment<see cref="IHostingEnvironment"/></param> /// <param name="reportsService">The reportsService<see cref="IReportsService"/></param> public ReportsController( IHostingEnvironment hostingEnvironment, IReportsService reportsService) { this.hostingEnvironment = hostingEnvironment; this.reportsService = reportsService; }
public ReportsController( IReportsService service, ITimeSeriesRepository entityRepository) { this.service = service; this.repository = entityRepository; }
public ReportsExportService(UnitOfWork uow, IMapper mapper, IConfiguration configuration, IHostingEnvironment environment, IReportsService reportService) : base(uow, mapper) { _configuration = configuration; _environment = environment; _reportService = reportService; }
/// <summary> /// Validates the report when updated. /// </summary> public ReportValidator(IReportsService service) { CascadeMode = CascadeMode.StopOnFirstFailure; RuleSet("Update", () => { RuleFor(x => x.Id) .NotEmpty() .MaximumLength(128) .Matches(@"^[a-zA-Z0-9-]+$") .MustAsync((async(id, token) => (await service.ExistsIdAsync(id).ConfigureAwait(false)))) .WithMessage(Resources.Resource.NotFoundReport); RuleFor(x => x.Name) .Transform(n => n.SpaceFix()) .NotEmpty() .MinimumLength(3) .MaximumLength(128) .Matches(@"^[а-яА-ЯёЁa-zA-Z0-9.,:;&$%()-+ ]+$"); RuleFor(x => x.Description) .Transform(d => d.SpaceFix()) .MaximumLength(255) .Matches(@"(^[а-яА-ЯёЁa-zA-Z0-9.,:;&$%()-+ ]+$)|(^\s*$)"); }); }
public DashboardController(ISettingsService settingsService, IReportsService reportsService, ICoursesService coursesService, UserManager <ApplicationUser> userManager) { this.settingsService = settingsService; this.reportsService = reportsService; this.coursesService = coursesService; this.userManager = userManager; }
public SpotsService(ISpotsRepository repository, ILodgmentsService lodgmentsService, IStorageService storageService, IReportsService reportsService) { this.repository = repository; this.lodgmentsService = lodgmentsService; this.storageService = storageService; this.reportsService = reportsService; }
public ReportController(IReportsService reportsService, IRequestService requestService, ICommissionService commissionService, ICouncilService councilService) { _reportsService = reportsService; _requestService = requestService; _commissionService = commissionService; _councilService = councilService; }
/// <summary> /// Creates reports controller. /// </summary> /// <param name="reportsService"></param> /// <param name="mapper"></param> public ReportsController( IReportsService reportsService, IMapper mapper) { _reportService = reportsService; _mapper = mapper; Debug.WriteLine("+++++++++++++++ ReportsController +++++++++++++++"); }
public ReportsController(IFilterService filterService, IProjectService projectService, IReportsService reportsService) { _filterService = filterService; _projectService = projectService; _reportsService = reportsService; }
public DealsService(IRepository<Product> productsRepository, IRepository<User> sellersRepository, IRepository<Sell> sellsRepository, IRepository<Waste> wasteRepository, IReportsService reportsService) { this.productsRepository = productsRepository; this.sellersRepository = sellersRepository; this.sellsRepository = sellsRepository; this.wasteRepository = wasteRepository; this.reportsService = reportsService; }
public ProductsService(IRepository<Product> productsRepository, IRepository<Barcode> barcodesRepository, IRepository<ExpirationDate> expirationDatesRepository, IReportsService reportsService, IMissingProductsService missingProductsService) { this.productsRepository = productsRepository; this.barcodesRepository = barcodesRepository; this.expirationDatesRepository = expirationDatesRepository; this.reportsService = reportsService; this.missingProductsService = missingProductsService; }
public ReportsController( IReportsService reportService, IAdobeConnectAccountService acAccountService, ApplicationSettingsProvider settings, ILogger logger, ICache cache) : base(acAccountService, settings, logger, cache) { _reportService = reportService; }
public CreateModel(IReportsService reportsService, IFirmsService firmsService, IMapper mapper, UserManager <UnprofessionalsAppUser> userManager) { this.reportsService = reportsService; this.firmsService = firmsService; this.mapper = mapper; this.userManager = userManager; }
public RetentionReleaseEstimatePresenter(IRetentionReleaseEstimateView view, IReportsService service, IReportManager reportManager) { ArgumentChecker.ThrowIfNull(view, "view"); ArgumentChecker.ThrowIfNull(service, "repository"); ArgumentChecker.ThrowIfNull(reportManager, "reportManager"); this.reportManager = reportManager; this.view = view; this.service = service; }
public ClientActionPresenter(IClientActionView view, IReportsService service, IReportManager reportManager) { ArgumentChecker.ThrowIfNull(view, "view"); ArgumentChecker.ThrowIfNull(service, "service"); ArgumentChecker.ThrowIfNull(reportManager, "reportManager"); this.view = view; this.service = service; this.reportManager = reportManager; }
public CreditStopSuggestionsPresenter(ICreditStopSuggestionsView view, IReportsService service, IReportManager reportManager) { ArgumentChecker.ThrowIfNull(view, "view"); ArgumentChecker.ThrowIfNull(service, "repository"); ArgumentChecker.ThrowIfNull(reportManager, "reportManager"); this.view = view; this.service = service; this.reportManager = reportManager; }
public CreditLimitExceededPresenter(ICreditLimitExceededView view, IReportsService service, IReportManager reportManager) { ArgumentChecker.ThrowIfNull(view, "view"); ArgumentChecker.ThrowIfNull(service, "repository"); ArgumentChecker.ThrowIfNull(reportManager, "reportManager"); this.view = view; this.service = service; this.reportManager = reportManager; }
public StatusPresenter(IStatusView view, IReportsService service, IReportManager reportManager) { ArgumentChecker.ThrowIfNull(view, "view"); ArgumentChecker.ThrowIfNull(service, "service"); ArgumentChecker.ThrowIfNull(reportManager, "reportManager"); this.reportManager = reportManager; this.view = view; this.service = service; }
public CurrentShortPaidPresenter(ICurrentShortPaidView view, IReportsService service, IReportManager reportManager) { ArgumentChecker.ThrowIfNull(view, "view"); ArgumentChecker.ThrowIfNull(service, "repository"); ArgumentChecker.ThrowIfNull(reportManager, "reportManager"); this.reportManager = reportManager; this.view = view; this.service = service; }
public ReportsController( UserManager <SimpleSocialUser> userManager, IPostServices postServices, IReportsService reportsService, IFollowersServices followersServices) { this.userManager = userManager; this.postServices = postServices; this.reportsService = reportsService; this.followersServices = followersServices; }
public AdminController( IAdministrationServices administrationServices, ISearchServices searchServices, IUserServices userServices, IReportsService reportsService) { this.administrationServices = administrationServices; this.searchServices = searchServices; this.userServices = userServices; this.reportsService = reportsService; }
public ProjectsService(OmmDbContext context, IReportsService reportsService, IStatusesService statusesService, IEmployeesService employeesService, IProjectPositionsService projectPositionsService, IEmployeesProjectsPositionsService employeesProjectsPositionsService, IAssignmentsService assignmentsService) { this.context = context; this.reportsService = reportsService; this.statusesService = statusesService; this.employeesService = employeesService; this.projectPositionsService = projectPositionsService; this.employeesProjectsPositionsService = employeesProjectsPositionsService; this.assignmentsService = assignmentsService; }
public async Task CreateReportAsync_WithExistingProjectIdInReports_ShouldThrowArgumentException(string projectId) { var context = OmmDbContextInMemoryFactory.InitializeContext(); await SeedData(context); this.reportsService = new ReportsService(context); var ex = await Assert.ThrowsAsync <ArgumentException>(() => this.reportsService.CreateReportAsync(projectId)); Assert.Equal(string.Format(ErrorMessages.ReportInvalidProjectId, projectId), ex.Message); }
public ReportsHub( IHubContext <ReportsHub> hubContext, IValidationRulesService validationRulesService, ICollectionsService collectionsService, IPeriodService periodService, IReportsService reportsService) { _hubContext = hubContext; _validationRulesService = validationRulesService; _collectionsService = collectionsService; _periodService = periodService; _reportsService = reportsService; }
private void LoadData() { storeNamesService = Program.kernel.Get <IStoreNamesService>(); wareHousesService = Program.kernel.Get <IWareHousesService>(); reportsService = Program.kernel.Get <IReportsService>(); zoneNamesService = Program.kernel.Get <IZoneNamesService>(); storeNamesBS.Clear(); storeNamesBS.DataSource = storeNamesService.GetStoreNames().Where(sn => sn.ParentId != null).OrderBy(o => o.ParentName); zoneNamesList = zoneNamesService.GetZoneNameByStore(); zoneUnspecifiedBS.DataSource = zoneNamesService.GetZonesUnspecified(); zoneInfoList = zoneNamesService.GetCellQuantityByZones(); }
public ReportsController( IReportsService reportsService, IApartmentService apartmentService, IBuildingsService buildingService, ICalculationMonthlyFeesService calculationMonthlyFeesService, UserManager <ApplicationUser> userManager) { this.reportsService = reportsService; this.apartmentService = apartmentService; this.buildingService = buildingService; this.calculationMonthlyFeesService = calculationMonthlyFeesService; this.userManager = userManager; }
public async Task CreateReportAsync_WithValidData_ShouldCreateReportAndReturnTrue(string projectId) { string errorMessagePrefix = "ReportsService CreateReportAsync() method does not work properly."; var context = OmmDbContextInMemoryFactory.InitializeContext(); await SeedProjectData(context); this.reportsService = new ReportsService(context); bool actualResult = await this.reportsService.CreateReportAsync(projectId); Assert.True(actualResult, errorMessagePrefix); }
public async Task GetReportById_WithInvalidId_ShouldThrowNullReferenceException() { var context = OmmDbContextInMemoryFactory.InitializeContext(); await SeedData(context); this.reportsService = new ReportsService(context); string invalidId = "Invalid id"; var ex = await Assert.ThrowsAsync <NullReferenceException>(() => this.reportsService.GetReportById <ReportDetailsDto>(invalidId).SingleAsync()); Assert.Equal(string.Format(ErrorMessages.ReportIdNullReference, invalidId), ex.Message); }
public async Task CreateReportAsync_WithInvalidProjectId_ShouldThrowNullReferenceException() { var context = OmmDbContextInMemoryFactory.InitializeContext(); await SeedData(context); this.reportsService = new ReportsService(context); string invalidId = "Invalid id"; var ex = await Assert.ThrowsAsync <NullReferenceException>(() => this.reportsService.CreateReportAsync(invalidId)); Assert.Equal(string.Format(ErrorMessages.ProjectIdNullReference, invalidId), ex.Message); }
public CoursesController( ICoursesService coursesService, ICategoriesService categoriesService, ILessonsService lessonsService, IReportsService reportsService, IUsersLessonsService usersLessonsService, UserManager <ApplicationUser> userManager) { this.coursesService = coursesService; this.categoriesService = categoriesService; this.lessonsService = lessonsService; this.reportsService = reportsService; this.usersLessonsService = usersLessonsService; this.userManager = userManager; }
public ReportsController(ISessionData sessionData, IReportsService reportsService) : base(sessionData) { _reportsService = reportsService; }
public UnitsController(IReportsService reports, IKcsarContext db) : base(db) { this.reports = reports; }
private static DateTime UnixEpoch = new DateTime(1969, 12, 31, 17, 0, 0); // Jan 1, 1970 UTC in local time #endregion Fields #region Constructors public HomeController(IKcsarContext db, IReportsService reports, IAppSettings settings) : base(db, settings) { System.Data.Entity.Database.SetInitializer<MeshNodeEntities>(new System.Data.Entity.DropCreateDatabaseIfModelChanges<MeshNodeEntities>()); this.reports = reports; }
public ReportParameterService(IReportsService reportsService, IReportParameterFactory reportParameterFactory) { this._reportsService = reportsService; this._reportParameterFactory = reportParameterFactory; }
public BroadcastController(IShardService shardService, IReportsService reportsService) { this.shardService = shardService; this.reportsService = reportsService; }
public ReportsController(IReportsService reportsService) { this.reportsService = reportsService; }
public ReportController(IReportsService reportsService, IReportsContext reportsContext, IRoleService roleService) { _reportsService = reportsService; _reportsContext = reportsContext; _roleService = roleService; }
public PreviewController(IReportsService reportsService, IPlayerService playerService) { this.reportsService = reportsService; this.playerService = playerService; }