public void RunCustomerReportBatchShouldSendReports()
        {
            // Arrange
            var customerDataMock = new Mock<ICustomerData>();
            var reportBuilderMock = new Mock<IReportBuilder>();
            var emailerMock = new Mock<IEmailer>();

            var expectedCustomer = new Customer("*****@*****.**");
            var expectedReportBody = "the report body";

            customerDataMock.Setup(x => x.GetCustomersForCustomerReport())
                .Returns(new[] { expectedCustomer });

            reportBuilderMock.Setup(x => x.CreateCustomerReport(expectedCustomer))
                .Returns(new Report(expectedCustomer.Email, expectedReportBody));

            var sut = new ReportingService(
                customerDataMock.Object,
                reportBuilderMock.Object,
                emailerMock.Object);

            // Act
            sut.RunCustomerReportBatch();

            // Assert
            emailerMock.Verify(x => x.Send(expectedCustomer.Email, expectedReportBody));
        }
Esempio n. 2
0
        public void SetUp()
        {
            Monitor.Enter(_locker);
            _embeddedReportingServer = new EmbeddedReportingServer(3000);
            _embeddedReportingServer.CleanServerData();
            _embeddedReportingServer.StartAsync().Wait();

            _reportingService = new ReportingService("http://localhost:3000");
        }
Esempio n. 3
0
        public void ReportFindStoredPaymentMethodsPaged_By_Reference()
        {
            StoredPaymentMethodSummary response = ReportingService.StoredPaymentMethodDetail(Token)
                                                  .Execute();

            Assert.IsNotNull(response?.Reference);

            PagedResult <StoredPaymentMethodSummary> result = ReportingService.FindStoredPaymentMethodsPaged(1, 25)
                                                              .Where(SearchCriteria.ReferenceNumber, response.Reference)
                                                              .Execute();

            Assert.IsNotNull(result?.Results);
            Assert.IsTrue(result.Results is List <StoredPaymentMethodSummary>);
            Assert.IsTrue(result.Results.TrueForAll(r => r.Reference == response.Reference));
        }
Esempio n. 4
0
        /// <summary>
        /// SCORM Engine Service constructor that takes a single configuration parameter
        /// </summary>
        /// <param name="config">The Configuration object to be used to configure the Scorm Engine Service client</param>
        public ScormEngineService(Configuration config)
        {
            System.Net.ServicePointManager.Expect100Continue = false;

            configuration       = config;
            courseService       = new CourseService(configuration, this);
            dispatchService     = new DispatchService(configuration, this);
            registrationService = new RegistrationService(configuration, this);
            invitationService   = new InvitationService(configuration, this);
            uploadService       = new UploadService(configuration, this);
            ftpService          = new FtpService(configuration, this);
            exportService       = new ExportService(configuration, this);
            reportingService    = new ReportingService(configuration, this);
            debugService        = new DebugService(configuration, this);
        }
Esempio n. 5
0
        public async Task <ActionResult> Print(Guid id)
        {
            var              consulta          = EntityService.GetById(id);
            RecetaViewModel  consultaDto       = Mapper.Map <RecetaViewModel>(consulta);
            ReportingService _reportingService = new ReportingService("https://simecmexico.jsreportonline.net/", "*****@*****.**", "Simec2015");
            var              report            = await _reportingService
                                                 .RenderAsync("H1e5e4IGeD", new
            {
                Consulta = consultaDto,
            });

            FileStreamResult result = new FileStreamResult(report.Content, report.ContentType.MediaType);

            return(result);
        }
Esempio n. 6
0
        public void ReportFindTransactionsPaged_By_Token_First6_And_Last4_And_PaymentMethod()
        {
            const string firstSix = "426397";
            const string lastFour = "5262";
            var          result   = ReportingService.FindTransactionsPaged(FIRST_PAGE, PAGE_SIZE)
                                    .OrderBy(TransactionSortProperty.TimeCreated, SortDirection.Descending)
                                    .Where(SearchCriteria.TokenFirstSix, firstSix)
                                    .And(SearchCriteria.TokenLastFour, lastFour)
                                    .And(SearchCriteria.PaymentMethodName, PaymentMethodName.DigitalWallet)
                                    .Execute();

            Assert.IsNotNull(result?.Results);
            Assert.IsTrue(result.Results is List <TransactionSummary>);
            Assert.IsTrue(result.Results.TrueForAll(t => t.TokenPanLastFour.Contains(lastFour)));
        }
Esempio n. 7
0
        public void GetTransactionByOrderId()
        {
            var response = ReportingService.FindTransactions()
                           .Where(DataServiceCriteria.StartDepositDate, DateTime.Parse("02/01/2018"))
                           .And(DataServiceCriteria.EndDepositDate, DateTime.Parse("02/01/2018"))
                           .And(DataServiceCriteria.OrderId, "1886b4049dd4")
                           .Execute();

            Assert.IsNotNull(response);

            foreach (var trans in response)
            {
                Assert.AreEqual("1886b4049dd4", trans.OrderId);
            }
        }
Esempio n. 8
0
 public void ReportFindSettlementTransactionsPaged_By_Status()
 {
     foreach (TransactionStatus transactionStatus in Enum.GetValues(typeof(TransactionStatus)))
     {
         var result = ReportingService.FindSettlementTransactionsPaged(FIRST_PAGE, PAGE_SIZE)
                      .OrderBy(TransactionSortProperty.TimeCreated, SortDirection.Descending)
                      .Where(SearchCriteria.StartDate, REPORTING_START_DATE)
                      .And(SearchCriteria.TransactionStatus, transactionStatus)
                      .Execute();
         Assert.IsNotNull(result?.Results);
         Assert.IsTrue(result.Results is List <TransactionSummary>);
         Assert.IsTrue(result.Results.TrueForAll(t =>
                                                 t.TransactionStatus == EnumConverter.GetMapping(Target.GP_API, transactionStatus)));
     }
 }
Esempio n. 9
0
        public void GetTransactionByDepositReference()
        {
            var response = ReportingService.FindTransactions()
                           .Where(DataServiceCriteria.StartDepositDate, DateTime.Parse("02/01/2018"))
                           .And(DataServiceCriteria.EndDepositDate, DateTime.Parse("02/01/2018"))
                           .And(DataServiceCriteria.DepositReference, "20180201E034974-001")
                           .Execute();

            Assert.IsNotNull(response);

            foreach (var trans in response)
            {
                Assert.AreEqual("20180201E034974-001", trans.DepositReference);
            }
        }
Esempio n. 10
0
        public void CreditSaleWithShippingAmt()
        {
            var response = card.Charge(15m)
                           .WithCurrency("USD")
                           .WithAllowDuplicates(true)
                           .WithShippingAmt(2m)
                           .Execute();

            Assert.IsNotNull(response);
            Assert.AreEqual("00", response.ResponseCode);
            TransactionSummary report = ReportingService.TransactionDetail(response.TransactionId).Execute();

            Assert.IsNotNull(report);
            Assert.AreEqual(2m, report.ShippingAmount);
        }
        public void ReportFindDisputes_By_MerchantId_And_SystemHierarchy()
        {
            string merchantId              = "8593872";
            string systemHierarchy         = "111-23-099-002-005";
            List <DisputeSummary> disputes = ReportingService.FindDisputes()
                                             .WithPaging(1, 10)
                                             .Where(DataServiceCriteria.StartStageDate, DateTime.Now.AddYears(-2).AddDays(1))
                                             .And(DataServiceCriteria.MerchantId, merchantId)
                                             .And(DataServiceCriteria.SystemHierarchy, systemHierarchy)
                                             .Execute();

            Assert.IsNotNull(disputes);
            Assert.IsTrue(disputes is List <DisputeSummary>);
            Assert.IsTrue(disputes.TrueForAll(d => d.CaseMerchantId == merchantId && d.MerchantHierarchy == systemHierarchy));
        }
        public void ReportFindTransactions_By_StartDate_And_EndDate()
        {
            DateTime startDate = DateTime.UtcNow.AddDays(-30);
            DateTime endDate   = DateTime.UtcNow.AddDays(-10);
            List <TransactionSummary> transactions = ReportingService.FindTransactions()
                                                     .OrderBy(TransactionSortProperty.TimeCreated, SortDirection.Descending)
                                                     .WithPaging(1, 10)
                                                     .Where(SearchCriteria.StartDate, startDate)
                                                     .And(SearchCriteria.EndDate, endDate)
                                                     .Execute();

            Assert.IsNotNull(transactions);
            Assert.IsTrue(transactions is List <TransactionSummary>);
            Assert.IsTrue(transactions.TrueForAll(t => t.TransactionDate?.Date >= startDate.Date && t.TransactionDate?.Date <= endDate.Date));
        }
        public void ReportFindTransactions_By_CardBrand_And_AuthCode()
        {
            string cardBrand = "VISA";
            string authCode  = "12345";
            List <TransactionSummary> transactions = ReportingService.FindTransactions()
                                                     .OrderBy(TransactionSortProperty.TimeCreated, SortDirection.Descending)
                                                     .WithPaging(1, 10)
                                                     .Where(SearchCriteria.CardBrand, cardBrand)
                                                     .And(SearchCriteria.AuthCode, authCode)
                                                     .Execute();

            Assert.IsNotNull(transactions);
            Assert.IsTrue(transactions is List <TransactionSummary>);
            Assert.IsTrue(transactions.TrueForAll(t => t.CardType == cardBrand && t.AuthCode == authCode));
        }
Esempio n. 14
0
        static void Main(string[] args)
        {
            var test = new _test_cshtml();
            var xrpt = test.TransformText();

            // Convert to byte[] for streaming etc:
            //var converter = new PdfReportConverter();
            //var buffer = converter.ConvertToBuffer(xrpt, "Test report");
            //Console.Write(buffer);

            var reportingService = new ReportingService();
            reportingService.OpenAsPdf(xrpt, "Test report");

            Console.Read();
        }
Esempio n. 15
0
        public void GetTransactionByHierarchy()
        {
            var response = ReportingService.FindTransactions()
                           .Where(DataServiceCriteria.StartDepositDate, DateTime.Parse("02/01/2018"))
                           .And(DataServiceCriteria.EndDepositDate, DateTime.Parse("02/01/2018"))
                           .And(DataServiceCriteria.Hierarchy, "052-03-001-001-BTE")
                           .Execute();

            Assert.IsNotNull(response);

            foreach (var trans in response)
            {
                Assert.AreEqual("052-03-001-001-BTE", trans.MerchantHierarchy);
            }
        }
Esempio n. 16
0
 public BookingsController(
     BookingRepository bookingRepository,
     CruiseRepository cruiseRepository,
     DeletedBookingRepository deletedBookingRepository,
     AecPaymentRepository paymentRepository,
     ProductRepository productRepository,
     ReportingService reportingService)
 {
     _bookingRepository        = bookingRepository;
     _cruiseRepository         = cruiseRepository;
     _deletedBookingRepository = deletedBookingRepository;
     _paymentRepository        = paymentRepository;
     _productRepository        = productRepository;
     _reportingService         = reportingService;
 }
Esempio n. 17
0
        public void GetDepositByAmount()
        {
            var response = ReportingService.FindDeposits()
                           .Where(DataServiceCriteria.StartDepositDate, DateTime.Parse("02/01/2018"))
                           .And(DataServiceCriteria.EndDepositDate, DateTime.Parse("02/01/2018"))
                           .And(DataServiceCriteria.Amount, -12.67m)
                           .Execute();

            Assert.IsNotNull(response);

            foreach (var deposit in response)
            {
                Assert.AreEqual(-12.67m, deposit.Amount);
            }
        }
        /// <summary>
        /// SCORM Engine Service constructor that takes a single configuration parameter
        /// </summary>
        /// <param name="config">The Configuration object to be used to configure the Scorm Engine Service client</param>
        public ScormEngineService(Configuration config)
        {
            System.Net.ServicePointManager.Expect100Continue = false;

            configuration = config;
            courseService = new CourseService(configuration, this);
            dispatchService = new DispatchService(configuration, this);
            registrationService = new RegistrationService(configuration, this);
            invitationService = new InvitationService(configuration, this);
            uploadService = new UploadService(configuration, this);
            ftpService = new FtpService(configuration, this);
            exportService = new ExportService(configuration, this);
            reportingService = new ReportingService(configuration, this);
            debugService = new DebugService(configuration, this);
        }
Esempio n. 19
0
        public void GetsAnyReportingEmployees()
        {
            var service = new ReportingService();
            var manager = new Employee {
                Id = 100, Name = "Alan", ManagerId = 150
            };

            var reportingManager = new ReportingDto(manager);

            service.GetReportingEmployees(reportingManager);

            Assert.Equal(2, reportingManager.Employees.Count);
            Assert.Equal("Martin", reportingManager.Employees.First().Name);
            Assert.Equal("Alex", reportingManager.Employees.Last().Name);
        }
Esempio n. 20
0
        public void GetDepositByAccountNumber()
        {
            var response = ReportingService.FindDeposits()
                           .Where(DataServiceCriteria.StartDepositDate, DateTime.Parse("02/01/2018"))
                           .And(DataServiceCriteria.EndDepositDate, DateTime.Parse("02/01/2018"))
                           .And(DataServiceCriteria.BankAccountNumber, "21672479")
                           .Execute();

            Assert.IsNotNull(response);

            foreach (var deposit in response)
            {
                Assert.AreEqual("21672479", deposit.AccountNumber);
            }
        }
Esempio n. 21
0
        public void GetDisputeByCaseNumber()
        {
            var response = ReportingService.FindDisputes()
                           .Where(DataServiceCriteria.StartDepositDate, DateTime.Parse("02/01/2018"))
                           .And(DataServiceCriteria.EndDepositDate, DateTime.Parse("02/01/2018"))
                           .And(DataServiceCriteria.CaseNumber, "6803102066")
                           .Execute();

            Assert.IsNotNull(response);

            foreach (var dispute in response)
            {
                Assert.AreEqual("6803102066", dispute.CaseNumber);
            }
        }
Esempio n. 22
0
        public void GetTransactionByLocalDate()
        {
            var response = ReportingService.FindTransactions()
                           .Where(DataServiceCriteria.StartDepositDate, DateTime.Parse("02/01/2018"))
                           .And(DataServiceCriteria.EndDepositDate, DateTime.Parse("02/01/2018"))
                           .And(DataServiceCriteria.LocalTransactionStartTime, DateTime.Parse("1/31/2018 5:29:52 PM"))
                           .Execute();

            Assert.IsNotNull(response);

            foreach (var trans in response)
            {
                Assert.AreEqual("1/31/2018 5:29:52 PM", trans.TransactionLocalDate);
            }
        }
Esempio n. 23
0
        public void CreditAuthWithConvenienceAmt()
        {
            var response = card.Authorize(14m)
                           .WithCurrency("USD")
                           .WithAllowDuplicates(true)
                           .WithConvenienceAmount(2m)
                           .Execute();

            Assert.IsNotNull(response);
            Assert.AreEqual("00", response.ResponseCode);
            TransactionSummary report = ReportingService.TransactionDetail(response.TransactionId).Execute();

            Assert.IsNotNull(report);
            Assert.AreEqual(2m, report.ConvenienceAmount);
        }
Esempio n. 24
0
        public void ReportFindSettlementTransactionsPaged_By_MerchantId_And_SystemHierarchy()
        {
            const string merchantId      = "101023947262";
            const string systemHierarchy = "055-70-024-011-019";

            var result = ReportingService.FindSettlementTransactionsPaged(FIRST_PAGE, PAGE_SIZE)
                         .OrderBy(TransactionSortProperty.TimeCreated, SortDirection.Descending)
                         .Where(SearchCriteria.StartDate, REPORTING_START_DATE)
                         .And(DataServiceCriteria.MerchantId, merchantId)
                         .And(DataServiceCriteria.SystemHierarchy, systemHierarchy)
                         .Execute();

            Assert.IsNotNull(result?.Results);
            Assert.IsTrue(result.Results is List <TransactionSummary>);
            Assert.IsTrue(result.Results.TrueForAll(t => t.MerchantId == merchantId && t.MerchantHierarchy == systemHierarchy));
        }
Esempio n. 25
0
        public void UpdateDomainUserExpectSucces()
        {
            var users = ReportingService.GetDomainUsers();

            foreach (var user in users)
            {
                try
                {
                    ReportingService.UpdateSSOProvider(user.AccountSetting.Login);
                }
                catch (Exception)
                {
                    throw;
                }
            }
        }
Esempio n. 26
0
        public void ReportFindTransactionsPaged_By_Amount_And_Currency_And_Country()
        {
            const decimal amount   = 1.12M;
            const string  currency = "aud"; //This is case sensitive
            const string  country  = "AU";  //This is case sensitive
            var           result   = ReportingService.FindTransactionsPaged(FIRST_PAGE, PAGE_SIZE)
                                     .OrderBy(TransactionSortProperty.TimeCreated, SortDirection.Descending)
                                     .Where(DataServiceCriteria.Amount, amount)
                                     .And(DataServiceCriteria.Currency, currency)
                                     .And(DataServiceCriteria.Country, country)
                                     .Execute();

            Assert.IsNotNull(result?.Results);
            Assert.IsTrue(result.Results is List <TransactionSummary>);
            Assert.IsTrue(result.Results.TrueForAll(t => t.Amount == amount && t.Currency == currency && t.Country == country));
        }
Esempio n. 27
0
        public void ReportFindTransactionsPaged_By_Id()
        {
            var transactionId = ReportingService.FindTransactionsPaged(FIRST_PAGE, PAGE_SIZE)
                                .Execute().Results.Select(t => t.TransactionId).FirstOrDefault();

            Assert.IsNotNull(transactionId);

            var result = ReportingService.FindTransactionsPaged(FIRST_PAGE, PAGE_SIZE)
                         .WithTransactionId(transactionId)
                         .Execute();

            Assert.IsNotNull(result?.Results);
            Assert.IsTrue(result.Results is List <TransactionSummary>);
            Assert.IsTrue(result.Results.Count == 1);
            Assert.IsTrue(result.Results.TrueForAll(t => t.TransactionId == transactionId));
        }
Esempio n. 28
0
        public void FindRoleByTitle()
        {
            var projectId = GetTestProjectId();
            var role      = ReportingService.FindRoleByTitle(projectId, SystemRoles.DashboardOnly);

            Assert.NotNull(role);

            role = ReportingService.FindRoleByTitle(projectId, SystemRoles.Editor);
            Assert.NotNull(role);

            role = ReportingService.FindRoleByTitle(projectId, SystemRoles.Admin);
            Assert.NotNull(role);

            role = ReportingService.FindRoleByTitle(projectId, SystemRoles.Viewer);
            Assert.NotNull(role);
        }
Esempio n. 29
0
        static void Main(string[] args)
        {
            var test = new _test_cshtml();
            var xrpt = test.TransformText();

            // Convert to byte[] for streaming etc:
            //var converter = new PdfReportConverter();
            //var buffer = converter.ConvertToBuffer(xrpt, "Test report");
            //Console.Write(buffer);

            var reportingService = new ReportingService();

            reportingService.OpenAsPdf(xrpt, "Test report");

            Console.Read();
        }
        public void PayrollSetup_001_GetPayrollSetupNoFranchise()
        {
            // Arrange
            SQLHelper.RunSetupScript("UnitTest_PayrollSetup", "A1");
            int?franchiseID = null;

            // Act
            // Query reporting service for PayrollSetup
            ReportingService rs = ReportingService.Create <ReportingService>(Guid.NewGuid());

            SiteBlue.Business.Reporting.PayrollSetup[] arrPayrollSetup = rs.GetPayrollSetupData(franchiseID);

            // Assert
            // I should at least get a non-null array, may not have anything in it
            Assert.IsNotNull(arrPayrollSetup);
        }
Esempio n. 31
0
        public void CreateProjectMySql_ExpectSucces()
        {
            var title     = DateTime.Now.Ticks.ToString();
            var projectId = ReportingService.CreateProject(title, "Summary" + title, null, SystemPlatforms.MySql);

            var projects = ReportingService.FindProjectByTitle(title);

            Assert.NotNull(projects);
            Assert.AreEqual("mysql", projects.Content.Driver);

            ReportingService.DeleteProject(projectId);

            projects = ReportingService.FindProjectByTitle(title);

            Assert.IsNull(projects);
        }
Esempio n. 32
0
        public ApiClient(CheckoutConfiguration configuration, IApiHttpClient httpClient)
        {
            CheckoutConfiguration = configuration;
            ApiHttpClient         = httpClient;

            CardService              = new CardService(ApiHttpClient, CheckoutConfiguration);
            ChargeService            = new ChargeService(ApiHttpClient, CheckoutConfiguration);
            CustomerService          = new CustomerService(ApiHttpClient, CheckoutConfiguration);
            LookupsService           = new LookupsService(ApiHttpClient, CheckoutConfiguration);
            PayoutsService           = new PayoutsService(ApiHttpClient, CheckoutConfiguration);
            RecurringPaymentsService = new RecurringPaymentsService(ApiHttpClient, CheckoutConfiguration);
            ReportingService         = new ReportingService(ApiHttpClient, CheckoutConfiguration);
            TokenService             = new TokenService(ApiHttpClient, CheckoutConfiguration);

            ContentAdaptor.Setup();
        }
Esempio n. 33
0
        public void ReportFindSettlementDisputesByDpositIdPaged_Order_By_Id()
        {
            const string depositId = "DEP_2342423423";

            var result = ReportingService.FindSettlementDisputesPaged(FIRST_PAGE, PAGE_SIZE)
                         .OrderBy(DisputeSortProperty.Id, SortDirection.Descending)
                         .Where(DataServiceCriteria.DepositReference, depositId)
                         .Execute();

            Assert.IsNotNull(result?.Results);
            Assert.IsTrue(result.Results is List <DisputeSummary>);
            foreach (var disputes in result.Results)
            {
                Assert.AreEqual(disputes.DepositReference, depositId);
            }
        }
Esempio n. 34
0
        public void ReportFindSettlementTransactionsPaged_By_Number_First6_And_Number_Last4()
        {
            const string firstSix = "543458";
            const string lastFour = "7652";

            var result = ReportingService.FindSettlementTransactionsPaged(FIRST_PAGE, PAGE_SIZE)
                         .OrderBy(TransactionSortProperty.TimeCreated, SortDirection.Descending)
                         .Where(SearchCriteria.StartDate, REPORTING_START_DATE)
                         .And(SearchCriteria.CardNumberFirstSix, firstSix)
                         .And(SearchCriteria.CardNumberLastFour, lastFour)
                         .Execute();

            Assert.IsNotNull(result?.Results);
            Assert.IsTrue(result.Results is List <TransactionSummary>);
            Assert.IsTrue(result.Results.TrueForAll(t => t.MaskedCardNumber.StartsWith(firstSix) && t.MaskedCardNumber.EndsWith(lastFour)));
        }
Esempio n. 35
0
        public static void Main()
        {
            var embededReportingServer = new EmbeddedReportingServer() { PingTimeout = new TimeSpan(0, 0, 100) };
            embededReportingServer.StartAsync().Wait();

            var reportingService = new ReportingService(embededReportingServer.EmbeddedServerUri);
            reportingService.SynchronizeTemplatesAsync().Wait();

            var rs = new ReportingService("http://localhost:2000");
            var r = rs.GetServerVersionAsync().Result;


            var result = rs.RenderAsync("Report1", null).Result;

            Console.WriteLine("Done");
            embededReportingServer.StopAsync().Wait();

        }
Esempio n. 36
0
        public static void Main()
        {
            //var embededReportingServer = new EmbeddedReportingServer();
            //embededReportingServer.StartAsync().Wait();

            //var reportingService = new ReportingService(embededReportingServer.EmbeddedServerUri);
            //reportingService.SynchronizeTemplatesAsync().Wait();


            //var settings = new ODataClientSettings { UrlBase = "http://localhost:1337/odata" };
            //var client = new ODataClient(settings);
            //var res = client.GetEntryAsync("users").Result;


            //http://localhost:1337/odata

            var rs = new ReportingService("http://localhost:4000", "admin", "password");

            Parallel.ForEach(Enumerable.Range(1, 1000), new ParallelOptions() {
                MaxDegreeOfParallelism = 3 }, i =>
            {
                Console.WriteLine(i);
                var rep = rs.RenderAsync("X1ltdPq7t", null).Result;
            });

            Console.WriteLine("Done");
            

            //rs.SynchronizeTemplatesAsync().Wait();
            //rs.SynchronizeTemplatesAsync().Wait();
            //rs.SynchronizeTemplatesAsync().Wait();


            //var result = rs.RenderAsync("Report1", null).Result;

            Console.WriteLine("Done");
            //embededReportingServer.StopAsync().Wait();
        }
Esempio n. 37
0
        /// <summary>
        /// Represents the asynchronous entry point to the application, which allows us to use asynchorous methods.
        /// </summary>
        public static async Task MainAsync()
        {
            // Asks the user to specify a file name
            System.Console.Write("Specify file name (default is My Documents): ");
            string fileName = System.Console.ReadLine();
            if (string.IsNullOrWhiteSpace(fileName))
                fileName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Export.pdf");

            // Asks the user for his name
            System.Console.Write("What is your name: ");
            string documentAuthor = System.Console.ReadLine();

            // Creates the report, renders, and exports it
            System.Console.WriteLine("Generating document...");
            IIocContainer iocContainer = new SimpleIocContainer();
            ReportingService reportingService = new ReportingService(iocContainer);
            DocumentFormat documentFormat = Path.GetExtension(fileName).ToUpperInvariant() == ".XPS" ? DocumentFormat.Xps : DocumentFormat.Pdf;
            await reportingService.ExportAsync<Document>(documentFormat, fileName, string.IsNullOrWhiteSpace(documentAuthor) ? null : new { Author = documentAuthor });
            System.Console.WriteLine("Finished generating document");
            
            // Waits for a key stroke, before the application is quit
            System.Console.WriteLine("Press any key to quit...");
            System.Console.ReadKey();
        }
Esempio n. 38
0
 public void getAllVisitsFromCurrentMonth()
 {
     var rs = new ReportingService();
     rs.GetVisitsFromCurrentMonth();
 }
 /// <summary>
 /// Initializes a new <see cref="MainWindowViewModel"/> instance.
 /// </summary>
 /// <param name="reportingService">The reporting service, which is used to render reports using XAML.</param>
 public MainWindowViewModel(ReportingService reportingService)
 {
     this.reportingService = reportingService;
 }