Ejemplo n.º 1
0
        /// <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();
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 /// <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;
 }
Ejemplo n.º 4
0
 public ReportsController(
     IReportsService service,
     ITimeSeriesRepository entityRepository)
 {
     this.service    = service;
     this.repository = entityRepository;
 }
Ejemplo n.º 5
0
 public ReportsExportService(UnitOfWork uow, IMapper mapper, IConfiguration configuration, IHostingEnvironment environment, IReportsService reportService)
     : base(uow, mapper)
 {
     _configuration = configuration;
     _environment   = environment;
     _reportService = reportService;
 }
Ejemplo n.º 6
0
        /// <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*$)");
            });
        }
Ejemplo n.º 7
0
 public DashboardController(ISettingsService settingsService, IReportsService reportsService, ICoursesService coursesService, UserManager <ApplicationUser> userManager)
 {
     this.settingsService = settingsService;
     this.reportsService  = reportsService;
     this.coursesService  = coursesService;
     this.userManager     = userManager;
 }
Ejemplo n.º 8
0
 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;
 }
Ejemplo n.º 10
0
 /// <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 +++++++++++++++");
 }
Ejemplo n.º 11
0
 public ReportsController(IFilterService filterService,
                          IProjectService projectService,
                          IReportsService reportsService)
 {
     _filterService  = filterService;
     _projectService = projectService;
     _reportsService = reportsService;
 }
Ejemplo n.º 12
0
 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;
 }
Ejemplo n.º 13
0
 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;
 }
Ejemplo n.º 14
0
 public ReportsController(
     IReportsService reportService,
     IAdobeConnectAccountService acAccountService,
     ApplicationSettingsProvider settings,
     ILogger logger, ICache cache)
     : base(acAccountService, settings, logger, cache)
 {
     _reportService = reportService;
 }
Ejemplo n.º 15
0
 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;
        }
Ejemplo n.º 17
0
        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;
        }
Ejemplo n.º 19
0
        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;
        }
Ejemplo n.º 22
0
 public ReportsController(
     UserManager <SimpleSocialUser> userManager,
     IPostServices postServices,
     IReportsService reportsService,
     IFollowersServices followersServices)
 {
     this.userManager       = userManager;
     this.postServices      = postServices;
     this.reportsService    = reportsService;
     this.followersServices = followersServices;
 }
Ejemplo n.º 23
0
 public AdminController(
     IAdministrationServices administrationServices,
     ISearchServices searchServices,
     IUserServices userServices,
     IReportsService reportsService)
 {
     this.administrationServices = administrationServices;
     this.searchServices         = searchServices;
     this.userServices           = userServices;
     this.reportsService         = reportsService;
 }
Ejemplo n.º 24
0
 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;
 }
Ejemplo n.º 25
0
        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;
 }
Ejemplo n.º 27
0
        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();
        }
Ejemplo n.º 28
0
 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;
 }
Ejemplo n.º 29
0
        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);
        }
Ejemplo n.º 30
0
        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);
        }
Ejemplo n.º 31
0
        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);
        }
Ejemplo n.º 32
0
 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;
 }
Ejemplo n.º 33
0
 public ReportsController(ISessionData sessionData, IReportsService reportsService)
     : base(sessionData) {
     _reportsService = reportsService;
 }
Ejemplo n.º 34
0
 public UnitsController(IReportsService reports, IKcsarContext db)
     : base(db)
 {
     this.reports = reports;
 }
Ejemplo n.º 35
0
        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;
 }
Ejemplo n.º 37
0
 public BroadcastController(IShardService shardService, IReportsService reportsService)
 {
     this.shardService = shardService;
     this.reportsService = reportsService;
 }
Ejemplo n.º 38
0
 public ReportsController(IReportsService reportsService)
 {
     this.reportsService = reportsService;
 }
Ejemplo n.º 39
0
 public ReportController(IReportsService reportsService, IReportsContext reportsContext, IRoleService roleService)
 {
     _reportsService = reportsService;
     _reportsContext = reportsContext;
     _roleService = roleService;
 }
Ejemplo n.º 40
0
 public PreviewController(IReportsService reportsService, IPlayerService playerService)
 {
     this.reportsService = reportsService;
     this.playerService = playerService;
 }