> expression
+ )
+ {
+ var metaData = ModelMetadata.FromLambdaExpression(expression, htmlHelper.ViewData);
+ var value = metaData.DisplayName ?? (metaData.PropertyName ?? ExpressionHelper.GetExpressionText(expression));
+ return MvcHtmlString.Create(value);
+ }
}
}
\ No newline at end of file
diff --git a/Web/Views/CreateLog/Confirm.cshtml b/Web/Views/CreateLog/Confirm.cshtml
index e5b963b..6b447c2 100644
--- a/Web/Views/CreateLog/Confirm.cshtml
+++ b/Web/Views/CreateLog/Confirm.cshtml
@@ -1,9 +1,9 @@
+@using MileageTraker.Web.Utility
@model MileageTraker.Web.ViewModels.ConfirmCreateLogViewModel
@{
ViewBag.Title = "Confirm";
Layout = "~/Views/Shared/_Layout.cshtml";
- var endOdometerStyle = Model.PreviousOdometer != null ? "style=padding-bottom:0px;" : "";
}
@section Styles
{
@@ -17,69 +17,92 @@
Please confirm - entry not complete until confirm clicked
@if (Model.Miles == 0)
{
- Warning No mileage being logged - is this a duplicate?
+ Warning No mileage being logged - is this a duplicate?
}
-
-
- @Html.LabelFor(model => model.VehicleId)
-
-
- @Html.Encode(Model.VehicleId) (@Model.VehicleType)
-
-
+
+ -
+ @Html.DisplayNameFor(m => m.VehicleId)
+
+ -
+ @Html.DisplayTextFor(m => m.VehicleId)
+ @Html.DisplayTextFor(m => m.VehicleType)
+
+
@Html.HiddenFor(m => m.VehicleId)
-
-
- @Html.LabelFor(model => model.EndOdometer)
-
-
- @Html.Encode(Model.EndOdometer)
- @if (Model.PreviousOdometer != null)
+
+ -
+ @Html.DisplayNameFor(m => m.EndOdometer)
+
+ -
+ @Html.DisplayTextFor(m => m.EndOdometer)
+ @if (Model.PreviousOdometer.HasValue)
{
- @Html.Encode(Model.Miles) miles since
- @Html.Encode(Model.PreviousOdometer) on @Html.Encode(Model.PreviousDate.Value.ToShortDateString())
+
+ @if (Model.Miles > 0)
+ {
+ @Html.DisplayTextFor(m => m.Miles) miles
+ }
+ else
+ {
+
+ @Html.DisplayTextFor(m => m.Miles) miles
+
+ }
+ since @Html.DisplayTextFor(m => m.PreviousOdometer)
+ on @Html.Encode(Model.PreviousDate.Value.ToShortDateString())
+
}
-
-
-
+
+
+ @Html.HiddenFor(m => m.EndOdometer)
+
@Html.DisplayFor(model => model.LogType)
@Html.HiddenFor(model => model.LogType.Value)
- @Html.DisplayFor(model => model.EmployeeName)
-
- @Html.DisplayFor(model => model.CityName)
-
-
-
- @Html.LabelFor(model => model.GasPurchased)
-
-
+ @Html.DisplayFor(model => model.EmployeeName)
+ @Html.HiddenFor(model => model.EmployeeName)
+
+ @Html.DisplayFor(model => model.CityName)
+ @Html.HiddenFor(model => model.CityName)
+
+
+ -
+ @Html.DisplayNameFor(m => m.GasPurchased)
+
+ -
@if (!string.IsNullOrEmpty(Model.GasPurchased))
{
- @Model.GasPurchased Gallons
+ @Html.DisplayTextFor(m => m.GasPurchased) Gallons
}
else
{
No Gas Purchased
}
-
-
-
-
-
- @Html.LabelFor(model => model.Date)
-
-
- @Html.Encode(Model.Date)
- (@Html.Encode(Model.DateHowLongAgo))
-
-
-
-
-
-
+
+
+ @Html.HiddenFor(model => model.GasPurchased)
+
+
+
+ -
+ @Html.DisplayNameFor(m => m.Date)
+
+ -
+ @Html.DisplayTextFor(m => m.Date)
+ (@Html.DisplayTextFor(m => m.DateHowLongAgo))
+
+
+ @Html.HiddenFor(model => model.Date)
+
+
+ -
+
+
+ -
+
+
+
}
diff --git a/Web/Views/CreateLog/Success.cshtml b/Web/Views/CreateLog/Success.cshtml
index a05fa7b..7ce7e23 100644
--- a/Web/Views/CreateLog/Success.cshtml
+++ b/Web/Views/CreateLog/Success.cshtml
@@ -5,24 +5,16 @@
Layout = "~/Views/Shared/_Layout.cshtml";
}
-@section Styles
-{
-
-}
-
@{
- @:
}
\ No newline at end of file
diff --git a/Web/Views/Log/MonthlyEmployeeMileage.cshtml b/Web/Views/Log/MonthlyEmployeeMileage.cshtml
index d9a23dd..2aa4561 100644
--- a/Web/Views/Log/MonthlyEmployeeMileage.cshtml
+++ b/Web/Views/Log/MonthlyEmployeeMileage.cshtml
@@ -1,4 +1,5 @@
-@model MileageTraker.Web.ViewModels.EmployeeMileageViewModel
+@using MileageTraker.Web.Utility
+@model MileageTraker.Web.ViewModels.EmployeeMileageViewModel
@{
ViewBag.Title = "Employee Mileage Report";
}
@@ -16,11 +17,11 @@
- - Year
+ - @Html.DisplayNameFor(m => m.Query.Year)
- @Html.Encode(Model.Query.Year)
- - Month
+ - @Html.DisplayNameFor(m => m.Query.Month)
- @Html.Encode(Model.Query.Month)
@if (Model.Query.LogType.HasValue)
diff --git a/Web/Views/Log/MonthlyVehicleMileage.cshtml b/Web/Views/Log/MonthlyVehicleMileage.cshtml
index 3145f39..9aa4f50 100644
--- a/Web/Views/Log/MonthlyVehicleMileage.cshtml
+++ b/Web/Views/Log/MonthlyVehicleMileage.cshtml
@@ -1,4 +1,4 @@
-@using System.Globalization
+@using MileageTraker.Web.Utility
@model MileageTraker.Web.ViewModels.VehicleMileageViewModel
@{
ViewBag.Title = "Vehicle Mileage Report";
@@ -17,11 +17,11 @@
- - Year
+ - @Html.DisplayNameFor(m => m.Query.Year)
- @Html.Encode(Model.Query.Year)
- - Month
+ - @Html.DisplayNameFor(m => m.Query.Month)
- @Html.Encode(Model.Query.Month)
@if (Model.Query.LogType.HasValue)
diff --git a/Web/Views/Vehicle/Index.cshtml b/Web/Views/Vehicle/Index.cshtml
index b63893f..0649ad2 100644
--- a/Web/Views/Vehicle/Index.cshtml
+++ b/Web/Views/Vehicle/Index.cshtml
@@ -21,7 +21,7 @@
Key
- EthraId
+ Ethra Id
|
Model Yr
@@ -36,7 +36,7 @@
Type
|
- TagNumber
+ Tag Number
|
Prog
@@ -67,8 +67,10 @@
|
@Html.DisplayTextFor(m => item.CarModel)
|
-
- @Html.DisplayTextFor(m => item.Type)
+ |
+
+ @Html.DisplayTextFor(m => item.Type)
+
|
@Html.DisplayTextFor(m => item.TagNumber)
|