Update automapper

This commit is contained in:
2016-09-24 00:06:34 -04:00
parent f473c64540
commit 6789c1b3b5
32 changed files with 254 additions and 206 deletions
@@ -9,10 +9,17 @@ namespace InventoryTraker.Web.Controllers
public class ReportController : ControllerBase
{
private readonly ReportService _reportService;
private readonly DistributionReportWriter _distributionReportWriter;
private readonly MovementReportWriter _movementReportWriter;
public ReportController(ReportService reportService)
public ReportController(
ReportService reportService,
DistributionReportWriter distributionReportWriter,
MovementReportWriter movementReportWriter)
{
_reportService = reportService;
_distributionReportWriter = distributionReportWriter;
_movementReportWriter = movementReportWriter;
}
[HttpGet]
@@ -32,8 +39,7 @@ namespace InventoryTraker.Web.Controllers
{
var report = _reportService.GetDistributionReport(startDate, endDate);
var writer = new DistributionReportWriter();
var excel = writer.Write(report);
var excel = _distributionReportWriter.Write(report);
var filename = $"InventoryDistributionReport{startDate:yyyyMMdd}-{endDate:yyyyMMdd}.xlsx";
@@ -61,8 +67,7 @@ namespace InventoryTraker.Web.Controllers
{
var report = _reportService.GetMovementReport(month);
var writer = new MovementReportWriter();
var excel = writer.Write(report);
var excel = _movementReportWriter.Write(report);
var filename = $"MonthlyInventoryReport{report.Month:MMMMyyyy}.xlsx";