Add vehicle service controller and view

This commit is contained in:
2015-10-07 23:29:10 -04:00
parent 306381b3c6
commit b962ecb119
11 changed files with 269 additions and 2 deletions
+7 -1
View File
@@ -36,7 +36,13 @@
@if (User.IsInRole("Developer") || User.IsInRole("Administrator"))
{
<li id="log-nav">@Html.ActionLink("Logs", "Index", "Log")</li>
<li id="vehicle-nav">@Html.ActionLink("Vehicles", "Index", "Vehicle")</li>
<li id="vehicle-nav" class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Vehicles <span class="caret"></span></a>
<ul class="dropdown-menu">
<li>@Html.ActionLink("Vehicles", "Index", "Vehicle")</li>
<li>@Html.ActionLink("Vehicle Service", "Index", "VehicleService")</li>
</ul>
</li>
<li id="fuellog-nav">@Html.ActionLink("Fuel Logs", "Index", "FuelLog")</li>
<li id="user-nav">@Html.ActionLink("Users", "Index", "User")</li>
<li id="config-nav" class="dropdown">
+19
View File
@@ -0,0 +1,19 @@
@model MileageTraker.Web.ViewModels.VehicleService.VehicleServiceViewModel
@{
ViewBag.Title = "Create Vehicle Service";
}
<h2 class="center-content"><i class="fa fa-wrench"></i> @ViewBag.Title</h2>
@using (Html.BeginForm("Create", "VehicleService", FormMethod.Post, new { @class = "form-horizontal well center-content" }))
{
@Html.Partial("_ValidationSummary")
<fieldset>
<legend></legend>
@Html.EditorForModel()
<div class="form-actions">
<input type="submit" value="Create" class="btn btn-primary" />
</div>
</fieldset>
}
+31
View File
@@ -0,0 +1,31 @@
@model MileageTraker.Web.ViewModels.VehicleService.VehicleServiceResultsViewModel
@{
ViewBag.Title = "Vehicle Service";
var grid = new WebGrid(Model.ServiceItems, rowsPerPage: 45);
}
@Html.Partial("_StatusMessage")
<h2 id="vehicle-title"><i class="fa fa-wrench"></i> @ViewBag.Title</h2>
<div class="btn-toolbar pull-left">
@Html.ActionLink("Add Service", "Create", null, new{@class="btn"})
@Html.ActionLink("Export", "Export", null, new{@class="btn"})
</div>
@grid.GetHtml(columns:
grid.Columns(
grid.Column("InvoiceDate", "Invoice Date"),
grid.Column("VehicleID", "Vehicle Id"),
grid.Column("ServiceCenterName", "Service Center Name"),
grid.Column("Price", "Price"),
grid.Column("Description", "Description"),
grid.Column(format:
@<div class='btn-group'>
@Html.ActionLink("Details / Edit", "Details", new { id = item.VehicleServiceId }, new { @class = "btn btn-mini" })
</div>)
),
htmlAttributes: new { @class = "table table-striped table-bordered table-hover table-condensed"},
numericLinksCount: 20
)