diff --git a/Helios/Models/ConfiguratorResult.cs b/Helios/Models/ConfiguratorResult.cs index c32aa188eed7fec323d0d5b4302a48cb76e5e079..a7879ab946dbff3975bffb3ba6d1df5f8c96e336 100644 --- a/Helios/Models/ConfiguratorResult.cs +++ b/Helios/Models/ConfiguratorResult.cs @@ -52,6 +52,9 @@ namespace Helios.Models [DisplayName("Is Within Budget")] public bool WithinBudget { get; set; } + [DisplayName("Cost Per Watt (£ / W)")] + public double CostPerWatt { get; set; } + public PanelPerformance() { } } } diff --git a/Helios/Source/ConfiguratorService.cs b/Helios/Source/ConfiguratorService.cs index 269cc485acb3bbb9379be72183e29aafb32ae930..705f29011a70923498e40c21abebdf642ee5877b 100644 --- a/Helios/Source/ConfiguratorService.cs +++ b/Helios/Source/ConfiguratorService.cs @@ -48,6 +48,7 @@ namespace Helios.Source performance.GeneratesRequiredPower = GeneratesRequiredPower(input.PowerRequired, performance.PowerGeneratedWinter); performance.ExceedsMaximumPower = ExceedsPowerLimit(input.MaximumPower, performance.PowerGeneratedWinter); performance.WithinBudget = WithinBudget(input.Budget, performance.InstallationCost); + performance.CostPerWatt = Math.Round(panel.GetCostPerWatt(), 2); if (performance.RoofAngle != 0) { diff --git a/Helios/Views/Configurator/ConfiguratorResult.cshtml b/Helios/Views/Configurator/ConfiguratorResult.cshtml index fa31e638867d306c6199731d23a77118f793bbb4..f1a306d5415aaeb6e40a111f18a303950425065f 100644 --- a/Helios/Views/Configurator/ConfiguratorResult.cshtml +++ b/Helios/Views/Configurator/ConfiguratorResult.cshtml @@ -41,6 +41,9 @@ <th> @Html.DisplayNameFor(panelResult => panelResult.RoofResults[0].Panels[0].WithinBudget) </th> + <th> + @Html.DisplayNameFor(panelResult => panelResult.RoofResults[0].Panels[0].CostPerWatt) + </th> <th> </th> </tr> @@ -69,6 +72,9 @@ <td> @panel.WithinBudget </td> + <td> + £@panel.CostPerWatt + </td> <td> @Html.ActionLink("Details", "PanelDetails", "Configurator", panel, null) </td> diff --git a/Helios/Views/Configurator/PanelDetails.cshtml b/Helios/Views/Configurator/PanelDetails.cshtml index 510fe741bc72787fed3661652a9fdb087a77c5f6..24e82c521283ff7baffd98b41e49a9aea0808c9f 100644 --- a/Helios/Views/Configurator/PanelDetails.cshtml +++ b/Helios/Views/Configurator/PanelDetails.cshtml @@ -19,6 +19,9 @@ <li> Installation Cost: £@Model.InstallationCost </li> + <li> + Cost Per Watt: £@Model.CostPerWatt + </li> </ul> </div> <div class="roofDetails">