Correct reports not having all query parameters

Other small corrections
This commit is contained in:
2014-05-21 10:55:24 -04:00
parent 365aa47328
commit 750450f1f9
10 changed files with 54 additions and 43 deletions
+3 -1
View File
@@ -4,8 +4,10 @@
ViewBag.Title = "Cities by County";
}
@Html.Partial("_StatusMessage")
@{ Html.RenderPartial("BackToLogs"); }
@Html.Partial("_StatusMessage")
<h2>@ViewBag.Title</h2>
<div>
+4 -3
View File
@@ -4,6 +4,7 @@
@{
ViewBag.Title = "Logs";
var grid = new WebGrid(Model.Logs, rowsPerPage: 45);
var parameters = new {Model.Year, Model.Month, Model.LogType, Model.MonthRange, Model.VehicleId, Model.EmployeeName};
}
@section Styles {
<link href="@Url.Content("~/Content/VehicleColors.css")" rel="stylesheet" type="text/css" />
@@ -34,7 +35,7 @@
<div class="btn-toolbar clearfix">
@Html.ActionLink("Add New Log", "Create", null, new { @class = "btn" })
@Html.ActionLink("Export", "Export", new { Model.Year, Model.Month, Model.LogType, Model.MonthRange, Model.VehicleId, Model.EmployeeName }, new { @class = "btn" })
@Html.ActionLink("Export", "Export", parameters, new { @class = "btn" })
@Html.ActionLink("Purposes", "Index", "Purpose", null, new { @class = "btn" })
@Html.ActionLink("Cities", "Index", "City", null, new { @class = "btn" })
@Html.ActionLink("Import", "ImportUpload", null, new { @class = "btn"})
@@ -43,10 +44,10 @@
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">Report <span class="caret"></span></a>
<ul class="dropdown-menu">
<li>
@Html.ActionLink("Vehicle Mileage", "MonthlyVehicleMileage", new { Year = Model.Year, Month = Model.Month, LogType = Model.LogType })
@Html.ActionLink("Vehicle Mileage", "MonthlyVehicleMileage", parameters)
</li>
<li>
@Html.ActionLink("Driver Mileage", "MonthlyDriverMileage", new { Year = Model.Year, Month = Model.Month, LogType = Model.LogType })
@Html.ActionLink("Driver Mileage", "MonthlyDriverMileage", parameters)
</li>
</ul>
</div>
+1 -17
View File
@@ -9,23 +9,7 @@
<h2>@ViewBag.Title</h2>
<div>
<dl class="inline">
<dt>@Html.DisplayNameFor(m => m.Query.Year)</dt>
<dd>@Html.Encode(Model.Query.Year)</dd>
</dl>
<dl class="inline">
<dt>@Html.DisplayNameFor(m => m.Query.Month)</dt>
<dd>@Html.Encode(Model.Query.Month)</dd>
</dl>
@if (Model.Query.LogType.HasValue)
{
<dl class="inline">
<dt>Type</dt>
<dd>@Html.Encode(Model.Query.LogType)</dd>
</dl>
}
</div>
@Html.DisplayFor(m => m.Query)
<table class="table">
<tr>
+1 -17
View File
@@ -9,23 +9,7 @@
<h2>@ViewBag.Title</h2>
<div>
<dl class="inline">
<dt>@Html.DisplayNameFor(m => m.Query.Year)</dt>
<dd>@Html.Encode(Model.Query.Year)</dd>
</dl>
<dl class="inline">
<dt>@Html.DisplayNameFor(m => m.Query.Month)</dt>
<dd>@Html.Encode(Model.Query.Month)</dd>
</dl>
@if (Model.Query.LogType.HasValue)
{
<dl class="inline">
<dt>Type</dt>
<dd>@Html.Encode(Model.Query.LogType)</dd>
</dl>
}
</div>
@Html.DisplayFor(m => m.Query)
<table class="table">
<tr>
+2
View File
@@ -5,6 +5,8 @@
var grid = new WebGrid(Model, canSort: false, canPage: false);
}
@{ Html.RenderPartial("BackToLogs"); }
@Html.Partial("_StatusMessage")
<h2>@ViewBag.Title</h2>
@@ -0,0 +1,37 @@
@model MileageTraker.Web.ViewModels.Log.LogQueryViewModel
<div>
<dl class="inline">
<dt>@Html.DisplayNameFor(m => m.Year)</dt>
<dd>@Html.Encode(Model.Year)</dd>
</dl>
<dl class="inline">
<dt>@Html.DisplayNameFor(m => m.Month)</dt>
<dd>@Html.Encode(Model.Month)</dd>
</dl>
<dl class="inline">
<dt>@Html.DisplayNameFor(m => m.MonthRange)</dt>
<dd>@Html.Encode(Model.MonthRange)</dd>
</dl>
@if (Model.LogType.HasValue)
{
<dl class="inline">
<dt>Type</dt>
<dd>@Html.Encode(Model.LogType)</dd>
</dl>
}
@if (!string.IsNullOrEmpty(Model.VehicleId))
{
<dl class="inline">
<dt>Vehicle</dt>
<dd>@Html.Encode(Model.VehicleId)</dd>
</dl>
}
@if (!string.IsNullOrEmpty(Model.EmployeeName))
{
<dl class="inline">
<dt>Driver</dt>
<dd>@Html.Encode(Model.EmployeeName)</dd>
</dl>
}
</div>
@@ -1,5 +1,4 @@
@using System.Xml
@using MileageTraker.Web.Models
@using MileageTraker.Web.Models
@using MileageTraker.Web.Utility
@model MileageTraker.Web.ViewModels.Log.LogResultsViewModel
@{
@@ -33,7 +32,7 @@
@Html.TextBoxFor(m => m.VehicleId, new {@class="search-query input-mini", placeholder="Vehicle"})
</div>
<div class="span4">
@Html.Label("EmployeeName", "User")
@Html.Label("EmployeeName", "Driver")
@Html.TextBoxFor(m => m.EmployeeName, new {@class="search-query input-small", placeholder="User"})
</div>
</div>