public int SendReports() { IList <Report> reports = _reportBuilder.CreateReports(); if (HasNoReports(reports)) { _reportSender.Send(_reportBuilder.CreateSpecialReport()); } foreach (var report in reports) { _reportSender.Send(report); } return(reports.Count); }
public int SendReports() { IList <Report> reports = reportBuilder.CreateRegularReports(); if (reports.Count == 0) { reportSender.Send(reportBuilder.CreateSpecialReport()); } foreach (Report report in reports) { reportSender.Send(report); } return(reports.Count); }
public void SendReports() { IList <Report> reports = reportBuilder.CreateReports(); foreach (Report report in reports) { reportSender.Send(report); } }
public int SendReports(int clientId) { var reports = _reportBuilder.BuildReports(clientId).ToList(); if (reports.Count == 0) { var specialReport = _reportBuilder.BuildSpecialReport(); _reportSender.Send(specialReport); } else { foreach (var report in reports) { _reportSender.Send(report); } } return(reports.Count); }
public ActionResult Index(IndexViewModel model) { var orders = orderRepository.WithMinDate(model.MinDate ?? DateTime.MinValue).WithMaxDate(model.MaxDate ?? DateTime.MaxValue); var report = reportExporter.Export(orders); reportSender.Send(report, model.From, model.To); ViewBag.Success = true; return(View(model)); }
public void SendReports() { IList <Report> reports = reportbuilder.CreateReports(); if (reports.Count == 0) { throw new Exception(); } foreach (Report report in reports) { reportSender.Send(report); } }
public void SendReports() { IList <Report> reports = _reportBuilder.CreateReports(); if (reports.Count == 0) { throw new NoReportsException(); } foreach (var report in reports) { _reportSender.Send(report); } }