diff --git a/Helios/Controllers/ConfiguratorController.cs b/Helios/Controllers/ConfiguratorController.cs index ac9b7e0e6560feaaaa9361337d16d911857c91c2..0fcb1b08c3fd0f6eec1fa3a3ad2895c25c455781 100644 --- a/Helios/Controllers/ConfiguratorController.cs +++ b/Helios/Controllers/ConfiguratorController.cs @@ -24,11 +24,11 @@ namespace Helios.Controllers return View(); } - public ActionResult SubmitSystem(ConfiguratorInput input) + public ActionResult ConfiguratorResult(ConfiguratorInput input) { - _service.GetResults(input); + var model = _service.GetResults(input); - return View("Index"); + return View(model); } } diff --git a/Helios/Models/ConfiguratorResult.cs b/Helios/Models/ConfiguratorResult.cs index c94ba9be5c2de98ceceedfa9210947048f521a9c..879680482aa96fb4bfa4ce46663b75ec39236515 100644 --- a/Helios/Models/ConfiguratorResult.cs +++ b/Helios/Models/ConfiguratorResult.cs @@ -1,16 +1,32 @@ using System; +using System.ComponentModel; + namespace Helios.Models { public class ConfiguratorResult { public double RoofArea { get; set; } public double RoofAngle { get; set; } + + [DisplayName("Panel Efficiency")] public double PanelEfficiency { get; set; } + + [DisplayName("Installation Cost")] public double InstallationCost { get; set; } + + [DisplayName("Power Generated in Summer")] public double PowerGeneratedSummer { get; set; } + + [DisplayName("Power Generated in Winter")] public double PowerGeneratedWinter { get; set; } + + [DisplayName("Meets Energy Requirement")] public bool GeneratesRequiredPower { get; set; } + + [DisplayName("Exceeds Max Power")] public bool ExceedsMaximumPower { get; set; } + + [DisplayName("Is Within Budget")] public bool WithinBudget { get; set; } public ConfiguratorResult() diff --git a/Helios/Views/Configurator/ConfiguratorResult.cshtml b/Helios/Views/Configurator/ConfiguratorResult.cshtml new file mode 100644 index 0000000000000000000000000000000000000000..74267a6fb5f7f55fbd0f3fb4f2331d2bb317c439 --- /dev/null +++ b/Helios/Views/Configurator/ConfiguratorResult.cshtml @@ -0,0 +1,60 @@ +@model IEnumerable<Helios.Models.ConfiguratorResult> + +@{ + ViewData["Title"] = "Configuration Results"; +} + +<table class="table"> + <tr> + <th> + @Html.DisplayNameFor(model => model.PanelEfficiency) + </th> + <th> + @Html.DisplayNameFor(model => model.InstallationCost) + </th> + <th> + @Html.DisplayNameFor(model => model.PowerGeneratedSummer) + </th> + <th> + @Html.DisplayNameFor(model => model.PowerGeneratedWinter) + </th> + <th> + @Html.DisplayNameFor(model => model.GeneratesRequiredPower) + </th> + <th> + @Html.DisplayNameFor(model => model.ExceedsMaximumPower) + </th> + <th> + @Html.DisplayNameFor(model => model.WithinBudget) + </th> + <th></th> + </tr> + + @foreach (var item in Model) + { + <tr> + <td> + @Html.DisplayFor(modelItem => item.PanelEfficiency) + </td> + <td> + @Html.DisplayFor(modelItem => item.InstallationCost) + </td> + <td> + @Html.DisplayFor(modelItem => item.PowerGeneratedSummer) + </td> + <td> + @Html.DisplayFor(modelItem => item.PowerGeneratedWinter) + </td> + <td> + @Html.DisplayFor(modelItem => item.GeneratesRequiredPower) + </td> + <td> + @Html.DisplayFor(modelItem => item.ExceedsMaximumPower) + </td> + <td> + @Html.DisplayFor(modelItem => item.WithinBudget) + </td> + </tr> + } + +</table> \ No newline at end of file diff --git a/Helios/Views/Configurator/Index.cshtml b/Helios/Views/Configurator/Index.cshtml index e95c488778e829b377d9d2f974ba8dbe0b98c951..e699b9e14178fc1c1338d3c42e0f9017a04dbb3f 100644 --- a/Helios/Views/Configurator/Index.cshtml +++ b/Helios/Views/Configurator/Index.cshtml @@ -4,7 +4,7 @@ ViewData["Title"] = "Configuration Page"; } -@using (Html.BeginForm(actionName: "SubmitSystem", controllerName: "Configurator", Model)) +@using (Html.BeginForm(actionName: "ConfiguratorResult", controllerName: "Configurator", Model)) { <div class="form-horizontal"> <h4>Configurator Input</h4>