public async Task SetUp()
        {
            _localReportingService = new LocalReporting().KillRunningJsReportProcesses().UseBinary(JsReportBinary.GetBinary()).AsWebServer().Create();
            await _localReportingService.StartAsync();

            _reportingService = new ReportingService("http://localhost:5488");
        }
예제 #2
0
 public ReportsController(
     IReportingService reportingService,
     ILoggerFactory loggerFactory)
     : base(loggerFactory)
 {
     this.reportingService = reportingService.ThrowIfNull(nameof(reportingService));
 }
예제 #3
0
 public EmployeeController(IEmployeeService employeeService, IWebHostEnvironment hostEnv,
                           IReportingService reportingService)
 {
     _employeeService  = employeeService;
     _hostEnv          = hostEnv;
     _reportingService = reportingService;
 }
예제 #4
0
        public void CalculateFine_WhenCalledWithStudentId_ReturnStudentFine(string returnDateString, double fineAmount)
        {
            // Arrange
            int      studentId  = 1618017;
            DateTime issueDate  = Convert.ToDateTime("10/19/2019");
            DateTime returnDate = Convert.ToDateTime(returnDateString);
            double   Fine       = fineAmount;

            var bookIssueRepositoryMock  = _mock.Mock <IBookIssueRepository>();
            var returnBookRepositoryMock = _mock.Mock <IReturnBookRepository>();
            var studentRepositoryMock    = _mock.Mock <IStudentRepository>();
            var unitOfWorkLibraryService = _mock.Mock <IUnitOfWorkLibraryService>();

            bookIssueRepositoryMock.Setup(x => x.GetBookIssueDate(studentId)).Returns(issueDate);
            returnBookRepositoryMock.Setup(x => x.GetBookReturnDate(studentId)).Returns(returnDate);
            studentRepositoryMock.Setup(x => x.SetStudentFine(studentId, Fine));

            unitOfWorkLibraryService.Setup(x => x.BookIssueRepositor).Returns(bookIssueRepositoryMock.Object);
            unitOfWorkLibraryService.Setup(x => x.ReturnBookRepository).Returns(returnBookRepositoryMock.Object);
            unitOfWorkLibraryService.Setup(x => x.StudentRepository).Returns(studentRepositoryMock.Object);

            _reportingService = _mock.Create <ReportingService>
                                    (new TypedParameter(typeof(UnitOfWorkLibraryService), unitOfWorkLibraryService.Object));

            // Act
            var actualFine = _reportingService.CalculateFine(studentId);



            // Assert
            //actualFine.ShouldBe(Fine);
            //unitOfWorkLibraryService.VerifyAll();
            Assert.AreEqual(Fine, actualFine);
        }
예제 #5
0
        public MenuBarViewModel(IUntappdService untappdService, IInteractionRequestService interactionRequestService,
                                ISettingService settingService,
                                IModuleManager moduleManager,
                                IRegionManager regionManager,
                                IEventAggregator eventAggregator,
                                IWebDownloader webDownloader,
                                IReportingService reportingService) : base(regionManager)
        {
            this.interactionRequestService = interactionRequestService;
            this.settingService            = settingService;
            this.untappdService            = untappdService;
            this.moduleManager             = moduleManager;
            this.eventAggregator           = eventAggregator;
            this.webDownloader             = webDownloader;
            this.reportingService          = reportingService;

            GoToWelcomeCommand           = new DelegateCommand(GoToWelcome);
            RenameProjectCommand         = new DelegateCommand(RenameProject);
            SaveProjectCommand           = new DelegateCommand(SaveProject);
            SaveAsProjectCommand         = new DelegateCommand(SaveAsProject);
            DownloadProjectMediaCommand  = new DelegateCommand(DownloadProjectMedia);
            UploadProjectPhotoCommand    = new DelegateCommand(UploadProjectPhotos);
            WebDownloadProjectCommand    = new DelegateCommand(WebDownloadProject);
            CheckinsProjectReportCommand = new DelegateCommand(CheckinsProjectReport);
            HelpCommand = new DelegateCommand(Help);
        }
예제 #6
0
 static SearchCore()
 {
     Results          = new List <string>();
     SearchService    = new SearchService();
     ComputingService = new ComputingService();
     ReportingService = new ReportingService();
 }
예제 #7
0
 public DataController(
     IEndpointService endpointService,
     IReportingService reportingService)
 {
     _endpointService  = endpointService;
     _reportingService = reportingService;
 }
예제 #8
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            DbInterception.Add(new SchoolInterceptorTransientErrors());
            DbInterception.Add(new SchoolInterceptorLogging());

            //its important to set RelativePathToServer otherwise jsreport will run from bin folder
            //that would cause application recycle with every generated report
            var EmbeddedReportingServer = new EmbeddedReportingServer()
            {
                RelativePathToServer = "../App_Data", StartTimeout = new TimeSpan(0, 0, 20)
            };

            //wait for nodejs server to start
            EmbeddedReportingServer.StartAsync().Wait();
            //synchronize local *.jsrep files with embedded server
            EmbeddedReportingServer.ReportingService.SynchronizeTemplatesAsync().Wait();
            ReportingService = EmbeddedReportingServer.ReportingService;

            //alternatively you can also use a remote jsreport server on prem or even jsreportonline
            //ReportingService = new ReportingService("https://test.jsreportonline.net", "username", "password");
            //ReportingService.SynchronizeTemplatesAsync().Wait();
        }
예제 #9
0
        public void SetUp()
        {
            Monitor.Enter(_locker);
            _embeddedReportingServer = new EmbeddedReportingServer(3000)
            {
                Configuration = new
                {
                    authentication = new
                    {
                        cookieSession = new
                        {
                            secret = "dasd321as56d1sd5s61vdv32"
                        },
                        admin = new
                        {
                            username = "******",
                            password = "******"
                        }
                    },
                },
                Username = "******",
                Password = "******"
            };
            _embeddedReportingServer.StartAsync().Wait();

            _reportingService = _embeddedReportingServer.ReportingService;
        }
예제 #10
0
        public CustomerActivityPageViewModel(INavigationService navigationService,
                                             IProductService productService,
                                             ITerminalService terminalService,
                                             IReportingService reportingService,
                                             IDialogService dialogService
                                             ) : base(navigationService,
                                                      productService,
                                                      reportingService,
                                                      dialogService)
        {
            Title         = "客户活跃度";
            this.PageType = Enums.ChartPageEnum.CustomerActivity_Template;

            _terminalService = terminalService;

            this.WhenAnyValue(x => x.RankSeries).Subscribe(x => { this.IsNull = x.Count == 0; }).DisposeWith(DeactivateWith);
            this.Load = ReactiveCommand.CreateFromTask(async() =>
            {
                try
                {
                    var result = await _terminalService.GetCustomerActivityRankingAsync(Settings.UserId, Filter.TerminalId, this.ForceRefresh, new System.Threading.CancellationToken());
                    if (result != null)
                    {
                        Refresh(result.ToList());
                    }
                }
                catch (Exception ex)
                {
                    Crashes.TrackError(ex);
                }
            });

            this.BindBusyCommand(Load);
        }
예제 #11
0
        public void GetAverageScoreForInstructorByInstructorId_WhereInstructorExists_ReturnsAverageOfAllRatingsForInstructor([Values(1, 2, 3)] int instructorId)
        {
            //arrange
            var expectedScore =
                _ratingsList.Where(x => x.InstructorId == instructorId).Select(x => x.InstructorRating).Average();
            var expectedResponse = new OverallInstructorRatingDTO()
            {
                InstructorId            = instructorId,
                OverallInstructorRating = expectedScore
            };

            IReportingService reportingService = Mock.Create <IReportingService>();

            Mock.Arrange(() => reportingService.GetAverageRatingForInstructor(instructorId)).Returns(expectedResponse);

            var reportingController = new ReportingController(reportingService);

            //act
            var actual        = reportingController.GetAverageRatingForInstructor(instructorId) as OkNegotiatedContentResult <OverallInstructorRatingDTO>;
            var actualContent = actual.Content;

            //assert
            Mock.Assert(reportingService);
            Assert.That(actual, Is.Not.Null);
            Assert.That(actual, Is.TypeOf(typeof(OkNegotiatedContentResult <OverallInstructorRatingDTO>)));
            Assert.That(actualContent, Is.EqualTo(expectedResponse));
        }
예제 #12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                ReportViewer1.ProcessingMode = ProcessingMode.Remote;

                var serviceName = Request.QueryString["service"];
                var reportName  = Request.QueryString["report"];

                var application = ((MvcApplication)HttpContext.Current.ApplicationInstance);
                IReportingService reportingService = (IReportingService)application.Kernel.GetService(typeof(IReportingService));
                if (!reportingService.CanAccess(serviceName))
                {
                    Response.Clear();
                    Response.Write("<h2>No access.</h2>");
                    return;
                }


                ReportViewer1.ServerReport.ReportServerUrl = new Uri(GetReportingServiceUrl());
                ReportViewer1.ServerReport.ReportPath      = reportingService.GetReportPath(serviceName, reportName);

                //ReportParameter[] param = new ReportParameter[1];
                //param[0] = new ReportParameter("CustomerID", txtparam.Text);
                //ReportViewer1.ServerReport.SetParameters(param);

                ReportViewer1.ServerReport.Refresh();
            }
        }
예제 #13
0
        }                                             // I give up.

        public Provider(
            IAuthorizationService authorization,
            ILoggingService log,
            IControlService control,
            IDataService data,
            IBillingService billing,
            IInventoryService inventory,
            IOrderingService ordering,
            IStoreService store,
            IMailService mail,
            IPhysicalAccessService physicalAccess,
            ISchedulerService scheduler,
            IFeedbackService feedback,
            IReportingService reporting,
            IWorkerService worker,
            IProviderUtility utility,
            IDataAccessService dataAccess)
        {
            Authorization  = authorization;
            Log            = log;
            Control        = control;
            Data           = data;
            Billing        = billing;
            Inventory      = inventory;
            Ordering       = ordering;
            Store          = store;
            Mail           = mail;
            PhysicalAccess = physicalAccess;
            Scheduler      = scheduler;
            Feedback       = feedback;
            Reporting      = reporting;
            Worker         = worker;
            Utility        = utility;
            DataAccess     = dataAccess;
        }
        public async Task SetUp()
        {
            Console.WriteLine("Set up");
            _localReportingService = new LocalReporting().KillRunningJsReportProcesses().UseBinary(JsReportBinary.GetBinary()).Configure(cfg => cfg.Authenticated("admin", "password")).AsWebServer().Create();
            await _localReportingService.StartAsync();

            _reportingService = new ReportingService("http://localhost:5488", "admin", "password");
        }
예제 #15
0
 public ReportingServiceWithLogging(IReportingService decorated)
 {
     if (decorated == null)
     {
         throw new ArgumentNullException(paramName: nameof(decorated));
     }
     this.decorated = decorated;
 }
예제 #16
0
        public void SetUp()
        {
            Monitor.Enter(_locker);
            _embeddedReportingServer = new EmbeddedReportingServer(3000);
            _embeddedReportingServer.StartAsync().Wait();

            _reportingService = _embeddedReportingServer.ReportingService;
        }
예제 #17
0
        public void SetUp()
        {
            Monitor.Enter(_locker);
            _embeddedReportingServer = new EmbeddedReportingServer(3000);
            _embeddedReportingServer.StartAsync().Wait();

            _reportingService = _embeddedReportingServer.ReportingService;
        }
예제 #18
0
 public ProjectsController(IDashboardService dashboardService_, IUserService userService_,
                           IProjectService projectService_, IReportingService reportingService_, ICentralService centralService_)
 {
     this.dashboardService_ = dashboardService_;
     this.userService_      = userService_;
     this.projectService_   = projectService_;
     this.reportingService_ = reportingService_;
     this.centralService_   = centralService_;
 }
예제 #19
0
 public ReportsModel(IOptionsMonitor <General> configuration, IHttpContextAccessor contextAccessor, ILogger <ReportsModel> logger, IReportingService reportingService, ILoggerManager loggerManager = null) : base(configuration, contextAccessor)
 {
     _logger           = logger;
     _reportingService = reportingService;
     if (null != loggerManager)
     {
         _loggerManager = loggerManager;
     }
 }
예제 #20
0
 public CreateReportWorker(
     IReportingService reportingService,
     ICommandLineOptionsParserService commandLineOptionsParserService,
     ILogger logger)
 {
     _reportingService = reportingService;
     _commandLineOptionsParserService = commandLineOptionsParserService;
     _logger = logger;
 }
예제 #21
0
 public LibraryController(IUserService userService, IBookService bookService, IRecommendationService recommendationService,
                          IReportingService reportingService, IReviewService reviewService)
 {
     _userService           = userService;
     _bookService           = bookService;
     _recommendationService = recommendationService;
     _reportingService      = reportingService;
     _reviewService         = reviewService;
 }
예제 #22
0
 public BooksController(IBookService bookService,
                        IReportingService reportingService,
                        IReviewService reviewService,
                        IMapper mapper)
 {
     this.bookService      = bookService;
     this.reportingService = reportingService;
     this.reviewService    = reviewService;
     this.mapper           = mapper;
 }
예제 #23
0
        public LeadTimeDeploymentFrequencyControllerTests()
        {
            _reportingService = Substitute.For <IReportingService>();

            var myProfile     = new MetricsRequestProfiles();
            var configuration = new MapperConfiguration(cfg => cfg.AddProfile(myProfile));

            _mapper     = new Mapper(configuration);
            _controller = new LeadTimeDeploymentFrequencyController(_reportingService, _mapper);
        }
예제 #24
0
 public AppReportsService(IReportingService reportingService, IRepository <Document> docRepo,
                          IRepository <DocumentHistoryEntry> historyRepo, IRepository <AppUser> userRepo,
                          IDocumentFilteringService filteringService, IMapper mapper)
 {
     this.reportingService = reportingService;
     this.docRepo          = docRepo;
     this.historyRepo      = historyRepo;
     this.userRepo         = userRepo;
     this.filteringService = filteringService;
     this.mapper           = mapper;
 }
예제 #25
0
 public ReportController(
     IReportingService reportingService,
     ICatalogService catalogService,
     IEnumMappingService enumMappingService,
     IAuthorizationService authorizationService)
     : base(authorizationService, enumMappingService)
 {
     _reportingService     = reportingService;
     _enumMappingService   = enumMappingService;
     _authorizationService = authorizationService;
     _catalogService       = catalogService;
 }
예제 #26
0
 private void AddRoleMapping(SPSite site, SPWeb web)
 {
     try
     {
         IReportingService reportingService = ReportingService.GetInstance(site);
         reportingService.AddRoleMapping(web.SiteGroups, web.SiteUserInfoList);
     }
     catch (Exception exception)
     {
         bErrors  = true;
         sErrors += exception.ToString();
     }
 }
예제 #27
0
 private void SyncReports(SPSite site, SPWeb web)
 {
     try
     {
         IReportingService reportingService = ReportingService.GetInstance(site);
         reportingService.SyncReports(web.Lists["Report Library"] as SPDocumentLibrary);
     }
     catch (Exception exception)
     {
         bErrors  = true;
         sErrors += exception.ToString();
     }
 }
예제 #28
0
 private void DeleteReport(SPSite site, SPWeb web, string data)
 {
     try
     {
         IReportingService reportingService = ReportingService.GetInstance(site);
         reportingService.DeleteReport(data);
     }
     catch (Exception exception)
     {
         bErrors  = true;
         sErrors += exception.ToString();
     }
 }
예제 #29
0
        public LibraryController(IBookService bookService, IUserService userService, IRecommendationService recommendationService,
                                 IReportingService reportingService, IReviewService reviewService)
        {
            _bookService = bookService;
            _bookService.BooksLoadJson();

            _userService = userService;
            _userService.PersonsLoadJson();

            _recommendationService = recommendationService;
            _reportingService      = reportingService;
            _reviewService         = reviewService;
        }
예제 #30
0
 private void DeleteSiteCollectionMappedFolder(SPSite site, SPWeb web)
 {
     try
     {
         IReportingService reportingService = ReportingService.GetInstance(site);
         reportingService.DeleteSiteCollectionMappedFolder();
     }
     catch (Exception exception)
     {
         bErrors  = true;
         sErrors += exception.ToString();
     }
 }
예제 #31
0
        public CustomerRankingPageViewModel(INavigationService navigationService,
                                            IProductService productService,
                                            IReportingService reportingService,
                                            IDialogService dialogService
                                            ) : base(navigationService,
                                                     productService,
                                                     reportingService,
                                                     dialogService)
        {
            Title = "客户排行榜";

            this.PageType = Enums.ChartPageEnum.CustomerRanking_Template;

            this.WhenAnyValue(x => x.RankSeries)
            .Subscribe(x => { this.IsNull = x.Count == 0; })
            .DisposeWith(DeactivateWith);

            this.Load = ReactiveCommand.CreateFromTask(() => Task.Run(async() =>
            {
                try
                {
                    int?terminalId     = Filter.TerminalId;
                    int?districtId     = Filter.DistrictId;
                    int?businessUserId = Filter.BusinessUserId;
                    DateTime?startTime = Filter.StartTime;
                    DateTime?endTime   = Filter.EndTime;

                    var result = await _reportingService.GetCustomerRankingAsync(terminalId,
                                                                                 districtId,
                                                                                 businessUserId,
                                                                                 startTime,
                                                                                 endTime,
                                                                                 this.ForceRefresh,
                                                                                 new System.Threading.CancellationToken());

                    if (result != null)
                    {
                        Refresh(result.ToList());
                    }
                }
                catch (Exception ex)
                {
                    Crashes.TrackError(ex);
                }
            }));

            //绑定页面菜单
            BindFilterDateMenus(true);

            this.BindBusyCommand(Load);
        }
예제 #32
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            DbInterception.Add(new SchoolInterceptorTransientErrors());
            DbInterception.Add(new SchoolInterceptorLogging());
            
            //its important to set RelativePathToServer otherwise jsreport will run from bin folder
            //that would cause application recycle with every generated report
            var EmbeddedReportingServer = new EmbeddedReportingServer(){ RelativePathToServer = "../App_Data", StartTimeout = new TimeSpan(0,0,20)};

            //wait for nodejs server to start
            EmbeddedReportingServer.StartAsync().Wait();
            //synchronize local *.jsrep files with embedded server
            EmbeddedReportingServer.ReportingService.SynchronizeTemplatesAsync().Wait();
            ReportingService = EmbeddedReportingServer.ReportingService;

            //alternatively you can also use a remote jsreport server on prem or even jsreportonline
            //ReportingService = new ReportingService("https://test.jsreportonline.net", "username", "password");
            //ReportingService.SynchronizeTemplatesAsync().Wait();
        }
예제 #33
0
 public Game(IReportingService reportingService)
     : this()
 {
     this.reportingService = reportingService;
 }
예제 #34
0
 public JsReportFilterAttribute(IReportingService reportingService)
 {
     ReportingService = reportingService;
 }
예제 #35
0
 public ReportsController(IReportingService reportingService, ISecurityService securityService)
 {
     _reportingService = reportingService;
     _securityService = securityService;
 }
예제 #36
0
 public ReportingController(IReportingService reportService)
 {
     _service = reportService;
 }
예제 #37
0
        public void SetUp()
        {
            Monitor.Enter(_locker);
            _embeddedReportingServer = new EmbeddedReportingServer(3000)
            {
                Configuration = new
                {
                    authentication = new
                    {
                        cookieSession = new
                        {
                            secret = "dasd321as56d1sd5s61vdv32"
                        },
                        admin = new
                        {
                            username = "******",
                            password = "******"
                        }
                    },

                },
                Username = "******",
                Password = "******"
            };
            _embeddedReportingServer.StartAsync().Wait();

            _reportingService = _embeddedReportingServer.ReportingService;
        }
 public ReportingServiceTests()
 {
     factory = DatabaseTestInitializer.GetConnectionFactory();
     service = new ReportingService(factory);
 }
        public EmployeeCostReportViewModel(IReportingService service)
        {
            InitializeCommands();

            this.service = service;
        }
 public UsageSummaryController(IReportingService service)
 {
     this.service = service;
 }
 public EmployeeCostSummaryController(IReportingService service)
 {
     this.service = service;
 }
 public EggProductionReportController(IReportingService service)
 {
     this.service = service;
 }
예제 #43
0
 public static void Dispose()
 {
     ErrorHandler.Dispose();
     ErrorHandler = null;
     Instance = null;
 }
예제 #44
0
 public HomeController(ILoggingService logService, IDatabaseService<BaseModel> dbService, IReportingService reportService)
 {
     _loggingService = logService;
     _databaseService = dbService;
     _reportingService = reportService;
 }
        public UsageReportViewModel(IReportingService service)
        {
            InitializeCommands();

            this.service = service;
        }
        public EggProductionReportViewModel(IReportingService service)
        {
            InitializeCommands();

            this.service = service;
        }