Service reminder implemented.

This commit is contained in:
2015-10-21 20:32:37 -04:00
parent e42fcd16fa
commit 93065de77f
26 changed files with 652 additions and 89 deletions
+38 -10
View File
@@ -26,22 +26,50 @@
}
</div>
<div class="pull-right" style="width:400px">
<h4>Upcoming Services</h4>
<table class="table table-striped table-bordered table-hover table-condensed">
<tr>
<th>Vehicle ID</th>
<th>ODO</th>
<th>Next Service</th>
<th>Description</th>
<th></th>
</tr>
@foreach (var sr in Model.UpcomingServiceReminders)
{
<tr>
<td>@Html.DisplayTextFor(m => sr.VehicleId)</td>
<td>@Html.DisplayTextFor(m => sr.CurrentOdometer)</td>
<td>@Html.DisplayTextFor(m => sr.TargetOdometer)
@if (sr.IsServiceOverdue)
{
<span class="badge badge-warning" title="overdue @(-sr.ServiceDueInMiles) miles">!</span>
}
</td>
<td>@Html.DisplayTextFor(m => sr.Description)</td>
<td>@Html.ActionLink("Add Service", "Create", "VehicleService", new { vehicleId = sr.VehicleId }, new { @class = "btn btn-mini" })</td>
</tr>
}
</table>
</div>
<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", queryParams, new{@class="btn"})
@Html.ActionLink("Add Service", "Create", null, new { @class = "btn" })
@Html.ActionLink("Export", "Export", queryParams, new { @class = "btn" })
</div>
@grid.GetHtml(columns:
grid.Columns(
grid.Column("InvoiceDate", "Invoice Date", item => item.InvoiceDate.ToString("d")),
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'>
grid.Columns(
grid.Column("InvoiceDate", "Invoice Date", item => item.InvoiceDate.ToString("d")),
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", "Details", new { id = item.VehicleServiceId }, new { @class = "btn btn-mini" })
</div>)
),
@@ -0,0 +1,32 @@
@model MileageTraker.Web.ViewModels.VehicleService.UpdateServiceRemindersViewModel
@{
ViewBag.Title = "Update Service Reminders";
}
@Html.Partial("_StatusMessage")
<h2 class="center-content"><i class="fa fa-clock-o"></i> @ViewBag.Title</h2>
<h5 class="center-content">Add the next service for this vehicle and remove existing reminders.</h5>
@using (Html.BeginForm("UpdateServiceReminders", "VehicleService", FormMethod.Post, new { @class = "form-horizontal well center-content" }))
{
@Html.Partial("_ValidationSummary")
@Html.HiddenFor(m => m.VehicleId)
if (Model.DeleteServiceReminders.Available.Count > 0)
{
<fieldset>
<legend>Delete Reminders for this Vehicle?</legend>
@Html.EditorFor(m => m.DeleteServiceReminders)
</fieldset>
}
<fieldset>
<legend>Add a new Reminder?</legend>
@Html.DisplayFor(m => m.CurrentOdometer)
@Html.EditorFor(m => m.TargetOdometer)
@Html.EditorFor(m => m.Description)
</fieldset>
<div class="form-actions">
<input type="submit" value="Update" class="btn btn-primary" />
</div>
}