Add vehicle filtering for fuellog and vehicle service

This commit is contained in:
2015-10-26 10:09:12 -04:00
parent ad0b04695d
commit 9177a8dbb3
10 changed files with 63 additions and 9 deletions
+2 -2
View File
@@ -5,7 +5,7 @@
@{
ViewBag.Title = "Fuel Logs";
var grid = new WebGrid(Model.FuelLogs, rowsPerPage: 45);
var queryParams = new {FiscalYear = Model.Year, Model.Month, Model.Unmatched};
var queryParams = new {FiscalYear = Model.Year, Model.Month, Model.Unmatched, Model.TagNumber};
}
@section Scripts {
@@ -21,7 +21,7 @@
@Html.Partial("_StatusMessage")
<div class="btn-toolbar pull-right" style="width:400px">
<div class="btn-toolbar pull-right" style="width:600px">
@using (Html.BeginForm("Index", "FuelLog", FormMethod.Get, new { id = "filter", @class = "form" }))
{
@Html.EditorForModel()
@@ -3,7 +3,7 @@
@model MileageTraker.Web.ViewModels.FuelLog.FuelLogResultsViewModel
<div class="row-fluid">
<div class="span3">
<div class="span2">
@Html.Label("Year", "Year")
@Html.DropDownList("Year", new SelectList(Model.AvailableYearMonths.Keys, Model.Year), "Select Year", new { @class = "input-small" })
</div>
@@ -15,7 +15,11 @@
@Html.Label("MonthRange", "Range")
@Html.DropDownList("MonthRange", new SelectList(Enumerable.Range(1,12), Model.MonthRange), new { @class = "input-mini" })
</div>
<div class="span3" >
<div class="span2">
@Html.Label("TagNumber", "Tag Number")
@Html.TextBoxFor(m => m.TagNumber, new {@class="search-query input-mini", placeholder="Vehicle"})
</div>
<div class="span2" >
@Html.Label("Unmatched", "Unmatched Only", new{style = "padding-top:22px"})
<input id="Unmatched" name="Unmatched" type="checkbox" @(Model.Unmatched ? "checked='checked'" : "" ) value="true" />
</div>
@@ -3,11 +3,11 @@
@model MileageTraker.Web.ViewModels.VehicleService.VehicleServiceResultsViewModel
<div class="row-fluid">
<div class="span4">
<div class="span2">
@Html.Label("Year", "Year")
@Html.DropDownList("Year", new SelectList(Model.AvailableYearMonths.Keys, Model.Year), "Select Year", new { @class = "input-small" })
</div>
<div class="span3">
<div class="span2">
@Html.Label("Month", "Month")
@Html.DropDownList("Month", new SelectList(Model.SelectedYearMonths, Model.Month), "All Months", new { @class = "input-small" })
</div>
@@ -15,6 +15,10 @@
@Html.Label("MonthRange", "Range")
@Html.DropDownList("MonthRange", new SelectList(Enumerable.Range(1,12), Model.MonthRange), new { @class = "input-mini" })
</div>
<div class="span3">
@Html.Label("VehicleId", "Vehicle Id")
@Html.TextBoxFor(m => m.VehicleId, new {@class="search-query input-mini", placeholder="Vehicle"})
</div>
<div class="span2">
<input type="submit" value="Filter" class="btn" style="margin-top:1.75em" />
</div>
+2 -2
View File
@@ -3,7 +3,7 @@
@{
ViewBag.Title = "Vehicle Service";
var grid = new WebGrid(Model.ServiceItems, rowsPerPage: 45);
var queryParams = new { Model.Year, Model.Month, Model.MonthRange };
var queryParams = new { Model.Year, Model.Month, Model.MonthRange, Model.VehicleId };
}
@section Scripts {
@@ -19,7 +19,7 @@
@Html.Partial("_StatusMessage")
<div class="btn-toolbar pull-right" style="width:400px">
<div class="btn-toolbar pull-right" style="width:600px">
@using (Html.BeginForm("Index", "VehicleService", FormMethod.Get, new { id = "filter", @class = "form" }))
{
@Html.EditorForModel()