From 679ef75152181b09aac7c3cf808cc39cb4286d55 Mon Sep 17 00:00:00 2001 From: James Kolpack Date: Fri, 16 Sep 2016 12:22:50 -0400 Subject: [PATCH] Start adding MonthlyInventory --- InventoryTraker.Web/Controllers/ReportController.cs | 11 +++++++++++ InventoryTraker.Web/InventoryTraker.Web.csproj | 2 ++ .../Views/Report/MonthlyInventory.cshtml | 6 +++--- InventoryTraker.Web/Views/Shared/_Navigation.cshtml | 2 +- .../js/report/MonthlyInventoryReportController.js | 11 +++++++++++ InventoryTraker.Web/js/report/reportSvc.js | 11 ++++++++++- 6 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 InventoryTraker.Web/js/report/MonthlyInventoryReportController.js diff --git a/InventoryTraker.Web/Controllers/ReportController.cs b/InventoryTraker.Web/Controllers/ReportController.cs index 8d247ba..0ceeaee 100644 --- a/InventoryTraker.Web/Controllers/ReportController.cs +++ b/InventoryTraker.Web/Controllers/ReportController.cs @@ -57,5 +57,16 @@ namespace InventoryTraker.Web.Controllers return BetterJson(report.ToArray()); } + + [HttpGet] + public ActionResult MonthlyInventory() + { + return View(); + } + + public ActionResult MonthlyInventory(DateTime month) + { + return BetterJson(true); + } } } \ No newline at end of file diff --git a/InventoryTraker.Web/InventoryTraker.Web.csproj b/InventoryTraker.Web/InventoryTraker.Web.csproj index ceca3f0..908f56b 100644 --- a/InventoryTraker.Web/InventoryTraker.Web.csproj +++ b/InventoryTraker.Web/InventoryTraker.Web.csproj @@ -246,6 +246,7 @@ + @@ -395,6 +396,7 @@ + Web.config diff --git a/InventoryTraker.Web/Views/Report/MonthlyInventory.cshtml b/InventoryTraker.Web/Views/Report/MonthlyInventory.cshtml index 3d09ae2..0a7e2d6 100644 --- a/InventoryTraker.Web/Views/Report/MonthlyInventory.cshtml +++ b/InventoryTraker.Web/Views/Report/MonthlyInventory.cshtml @@ -11,14 +11,14 @@
- +
-
+
- +
diff --git a/InventoryTraker.Web/Views/Shared/_Navigation.cshtml b/InventoryTraker.Web/Views/Shared/_Navigation.cshtml index 191e644..3589a0b 100644 --- a/InventoryTraker.Web/Views/Shared/_Navigation.cshtml +++ b/InventoryTraker.Web/Views/Shared/_Navigation.cshtml @@ -39,7 +39,7 @@ Distribution
  • - Monthly Inventory + Monthly Inventory
  • diff --git a/InventoryTraker.Web/js/report/MonthlyInventoryReportController.js b/InventoryTraker.Web/js/report/MonthlyInventoryReportController.js new file mode 100644 index 0000000..635ee47 --- /dev/null +++ b/InventoryTraker.Web/js/report/MonthlyInventoryReportController.js @@ -0,0 +1,11 @@ +(function () { + 'use strict'; + + window.app.controller('MonthlyInventoryReportController', MonthlyInventoryReportController); + + MonthlyInventoryReportController.$inject = ['$scope', 'reportSvc']; + function MonthlyInventoryReportController($scope, reportSvc) { + var vm = this; + vm.monthlyInventoryData = reportSvc.monthlyInventoryData; + } +})(); \ No newline at end of file diff --git a/InventoryTraker.Web/js/report/reportSvc.js b/InventoryTraker.Web/js/report/reportSvc.js index 2b9147b..cecaaeb 100644 --- a/InventoryTraker.Web/js/report/reportSvc.js +++ b/InventoryTraker.Web/js/report/reportSvc.js @@ -4,13 +4,15 @@ reportSvc.$inject = ['$http']; function reportSvc($http) { var distributionData = []; + var monthlyInventoryData = []; var svc = { distributionData: distributionData, + monthlyInventoryData: monthlyInventoryData, loadDistributionReport: loadDistributionReport }; - //loadDistributionReport({ startDate: '2015-06-01', endDate: '2016-01-01' }); + loadDistributionReport({ startDate: '2015-05-01', endDate: '2016-01-01' }); return svc; function loadDistributionReport(query) { @@ -19,5 +21,12 @@ angular.copy(data, distributionData); }); } + + function loadMonthlyInventoryData(query) { + return $http.post('/Report/MonthlyInventory', query) + .success(function (data) { + angular.copy(data, monthlyInventoryData); + }); + } } })(); \ No newline at end of file