diff --git a/HHWMS.Web/Controllers/HomeController.cs b/HHWMS.Web/Controllers/HomeController.cs index bfa625e..3e3f887 100644 --- a/HHWMS.Web/Controllers/HomeController.cs +++ b/HHWMS.Web/Controllers/HomeController.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Reflection; using System.Text; using System.Web; +using HHWMS.Web.Models; using HHWMS.Web.Support; using HHWMS.Web.ViewModels.HomeVMs; using Microsoft.AspNetCore.Authentication; @@ -126,6 +127,27 @@ namespace HHWMS.Web.Controllers var rv = data.ToChartData(); return Json(rv); } + + [AllowAnonymous] + public IActionResult GetLocationChart() + { + var data = new List(); + var locations = Wtm.DC.Set().AsEnumerable() + .GroupBy(x => x.Status).ToList() + .Select(x => new { status = x.Key, count = x.Count() }); + foreach (var item in locations) + { + data.Add(new ChartData + { + Value = item.count, + Category = item.status, + Series = "locations" + }); + } + + var rv = data.ToChartData(); + return Json(rv); + } [AllRights] [ActionDescription("Layout")] diff --git a/HHWMS.Web/Views/Home/FrontPage.cshtml b/HHWMS.Web/Views/Home/FrontPage.cshtml index e69de29..fef9b14 100644 --- a/HHWMS.Web/Views/Home/FrontPage.cshtml +++ b/HHWMS.Web/Views/Home/FrontPage.cshtml @@ -0,0 +1,110 @@ +@model WalkingTec.Mvvm.Core.BaseVM +@using System.Text.Json + +
+
+
+
+
+
ShortCut
+ +
+
+ +
+
+
Controllers
+
+ +
+
+
+
+
+
Models
+
+ +
+
+
+
+
+
Mock data
+
+ + +
+
+
+
+
+
+