public void GenerateReports(int orderNumber) { var order = Orders.FirstOrDefault(o => o.OrderNumber == orderNumber); _reportGenerator.Generate(Report.Invoice, order); _reportGenerator.Generate(Report.CuttingList, order); _reportGenerator.Generate(Report.Painting, order); }
public void WillCallAllComponentPassingDataAsExpected() { _reportGenerator.Generate(_reportFolder); _log.Received(1).Info("ReportGenerator started"); _dateCalculator.Received(1).Calculate(); _log.Received().InfoFormat("Report ExtractDateTime: {0}, PowerService request date: {1}", _dates.ExtractDateTime, _dates.RequestDate); _powerService.Received(1).GetTrades(_dates.RequestDate); _log.Received(1).InfoFormat("{0} trade returned", _powerTrades.Length); _positionAggregator.Received(1).Aggregate(_dates.RequestDate, Arg.Is <List <PowerTrade> >(x => x.Count == 2 && x[0] == _powerTradeOne && x[1] == _powerTradeTwo)); _fileNameGenerator.Received(1).Generate(_dates.ExtractDateTime); _reportContentWriter.Received(1).Write(_powerPosition); _file.Received(1).WriteAllText(_reportFolder + _fileName, _content); _log.Received(1).InfoFormat("ReportGenerator complete: {0}", _reportFolder + _fileName); }
public void Initialize() { _timer.Elapsed += async(sender, e) => { _timer.Stop(); DateTime curDateTime = DateTime.UtcNow; DateTime dateTime = _intervalHelper.GetLastDate(1, curDateTime); if (_isFirst) { _isFirst = false; try { await _reportGenerator.GenerateIfNotExist(dateTime); } catch (Exception exception) { Trace.TraceError("Failed to save initial report: {0}", exception); } } else { try { await _reportGenerator.Generate(dateTime); } catch (Exception exception) { Trace.TraceError("Failed to save report: {0}", exception); } } _timer.Interval = _intervalHelper.GetMillisecondsToEndDay(new TimeSpan(0, 1, 1, 0), DateTime.UtcNow); _timer.Start(); }; _timer.Start(); }
private async void BtnGenerateReportClick(object sender, EventArgs e) { if (!Verify()) { return; } if (!string.IsNullOrEmpty(Properties.Settings.Default.ExcludedWords)) { var words = Properties.Settings.Default.ExcludedWords.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Select(_ => _.Trim()).ToArray(); _reportGenerator.ExcludedWords = words; } if ((int)RdGroupReportType.EditValue == (int)ReportType.LastWeek) { var startDate = GetLatestMonday(); var endDate = startDate.AddDays(7); var intervals = await Task.Run(() => _fogBugzClient.GetIntervals(startDate, endDate)); var report = _reportGenerator.Generate(intervals); BrwReport.DocumentText = report; Clipboard.SetText(report, TextDataFormat.Html); LblStatus.Text = "Report has been generated and copied to clipboard!"; } if ((int)RdGroupReportType.EditValue == (int)ReportType.ThisWeek) { var cases = await Task.Run(() => _fogBugzClient.GetCases(CurrentWeekFilter)); var report = _reportGenerator.Generate(cases); BrwReport.DocumentText = report; Clipboard.SetText(report, TextDataFormat.Html); LblStatus.Text = "Report has been generated and copied to clipboard!"; } }
private BalanceReport GetFromRequest(AccountBalanceRequest request) { if (!validator.IsValid(request, out string reason)) { Logger.Error($"Can't generate report from {request} because of the following reason: {reason}"); throw new InvalidOperationException($"Can't generate report from {request} because of the following reason: {reason}"); } return(reportGenerator.Generate(request.Accounts.SingleOrDefault(), request.RequestDate)); }
/// <summary> /// Runs the report generation. /// </summary> public void Run() { foreach (var targetAssembly in _arguments.Get(ArgumentKeys.TargetAssemblies)) { var reportModel = _modelBuilder.BuildModel(targetAssembly); Debug.Assert(reportModel != null); _reportGenerator.Generate(reportModel); } }
private void OnNext(long ticks) { try { _reportGenerator.Generate(_reportFolder); } catch (Exception ex) { _log.ErrorFormat("ReportService Exception: {0}.", ex); } }
public static List <object> GeneratePerFolder(this IReportGenerator reportGenerator, List <FileDescriptor> files, DirectorySearchMask directorySearchMask, FileSearchFilter fileSearchFilter, ReportExtendedInfo reportExtendedInfo) { //TODO: here we need to group by folder ILookup <string, FileDescriptor> fileGroups = null; List <object> result = new List <object>(); foreach (IGrouping <string, FileDescriptor> fileGroup in fileGroups) { object report = reportGenerator.Generate(fileGroup.ToList(), directorySearchMask, fileSearchFilter, reportExtendedInfo); result.Add(report); } return(result); }
public IActionResult Download(int year, int month) { var report = _reportGenerator.Generate(year, month); if (report == null) { return(Content("Неверные входные данные")); } var file = System.IO.File.ReadAllBytes(report.Name); var response = File(file, "application/octet-stream", "report.txt"); return(response); }
public static List <object> GeneratePerFolder(this IReportGenerator reportGenerator, FileDescriptor destination, List <FileContainer> files, ReportExtendedInfo reportExtendedInfo) { //TODO: here we need to group by folder ILookup <string, FileDescriptor> fileGroups = null; var result = new List <object>(); foreach (IGrouping <string, FileContainer> fileGroup in fileGroups) { var report = new FileContainer(fileGroup.Key, reportGenerator.Extension, destination.Directory); report = reportGenerator.Generate(report, fileGroup.ToList(), reportExtendedInfo); result.Add(report); } return(result); }
/// <inheritdoc cref="BaseAsyncReportGenerator.PrepareReport(UserConnection, ReportGeneratorConfiguration)"/> protected override ReportData PrepareReport(UserConnection userConnection, ReportGeneratorConfiguration configuration) { return(_wordReportGenerator.Generate(userConnection, configuration)); }
ReportDTO Generate(IReportGenerator <TimeInterval> reportGenerator, TimeInterval timeInterval) => _reportConverter.ConvertEntityToDTO(reportGenerator.Generate(timeInterval));
public void GenerateReport(string projectsJson) { var projects = JsonConvert.DeserializeObject <TestProject[]>(projectsJson); reportGenerator.Generate(projects); }