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
+4 -1
View File
@@ -1,9 +1,11 @@
@model MileageTraker.Web.ViewModels.ServiceReminder.ServiceReminderViewModel
@{
ViewBag.Title = "Create Vehicle Service Reminder";
ViewBag.Title = "Create Service Reminder";
}
@Html.Partial("_StatusMessage")
<h2 class="center-content"><i class="fa fa-clock-o"></i> @ViewBag.Title</h2>
@using (Html.BeginForm("Create", "ServiceReminder", FormMethod.Post, new { @class = "form-horizontal well center-content" }))
@@ -11,6 +13,7 @@
@Html.Partial("_ValidationSummary")
<fieldset>
<legend></legend>
@Html.DisplayFor(m => m.CurrentOdometer)
@Html.EditorForModel()
<div class="form-actions">
<input type="submit" value="Create" class="btn btn-primary" />
+1 -1
View File
@@ -1,7 +1,7 @@
@model MileageTraker.Web.ViewModels.ServiceReminder.ServiceReminderViewModel
@{
ViewBag.Title = "Vehicle Service Reminder Details" ;
ViewBag.Title = "Service Reminder Details" ;
}
@Html.Partial("_StatusMessage")
+4 -3
View File
@@ -1,19 +1,20 @@
@model MileageTraker.Web.ViewModels.ServiceReminder.ServiceReminderViewModel
@{
ViewBag.Title = "Edit Vehicle Service Reminder";
ViewBag.Title = "Edit Service Reminder";
}
@Html.Partial("_StatusMessage")
<h2 class="center-content"><i class="fa fa-clock-o"></i> @ViewBag.Title</h2>
@using (Html.BeginForm("Edit", "ServiceREminder", FormMethod.Post, new { @class = "form-horizontal well center-content" }))
@using (Html.BeginForm("Edit", "ServiceReminder", FormMethod.Post, new { @class = "form-horizontal well center-content" }))
{
@Html.Partial("_ValidationSummary")
<fieldset>
<legend></legend>
@Html.EditorForModel()
@Html.DisplayFor(m => m.CurrentOdometer)
@Html.EditorForModel()
<div class="form-actions">
<input type="submit" value="Save" class="btn btn-primary" />
</div>
+5 -3
View File
@@ -1,12 +1,13 @@
@model MileageTraker.Web.ViewModels.ServiceReminder.ServiceReminderResultsViewModel
@{
ViewBag.Title = "Vehicle Service Reminders for Vehicle Id " + Model.VehicleId;
ViewBag.Title = "Service Reminders";
}
@Html.Partial("_StatusMessage")
<h2 id="vehicle-title"><i class="fa fa-clock-o"></i> @ViewBag.Title</h2>
<h2 class="center-content"><i class="fa fa-clock-o"></i> @ViewBag.Title</h2>
<h4 class="center-content">for Vehicle @Model.VehicleId</h4>
<div class="center-content">
@foreach (var item in Model.ServiceReminderItems)
@@ -16,6 +17,7 @@
</div>
<div class="btn-toolbar center-content well">
@Html.ActionLink("Add Service Reminder", "Create", new { vehicleId = Model.VehicleId }, new{@class="btn"})
@Html.ActionLink("Add Reminder", "Create", new { vehicleId = Model.VehicleId }, new{@class="btn"})
@Html.ActionLink("Add Service", "Create", "VehicleService", new { vehicleId = Model.VehicleId }, new { @class = "btn" })
@Html.ActionLink("Vehicle Details", "Details", "Vehicle", new { id = Model.VehicleId }, new{@class="btn"})
</div>
@@ -1,7 +1,7 @@
@model MileageTraker.Web.ViewModels.ServiceReminder.ServiceReminderViewModel
<div class="well">
<h3>Service Reminder</h3>
<h4 class="center-content"><i class="fa fa-clock-o"></i> Service Reminder</h4>
@Html.DisplayForModel()
<div class='btn-toolbar'>
@Html.ActionLink("Edit", "Edit", new { id = Model.ServiceReminderId }, new { @class = "btn" })
+1 -1
View File
@@ -1,5 +1,5 @@
@if (Session["LogPage"] != null) {
<ul class="no-print breadcrumb">
<li><a href="@Session["LogPage"]">&larr; Back To Logs</a></li>
<li><a href="@Session["LogPage"]"><i class="fa fa-arrow-circle-left"></i> Back To Logs</a></li>
</ul>
}
+1 -1
View File
@@ -1,5 +1,5 @@
<ul class="no-print breadcrumb">
<li>
<a href="@Url.Action("Index", "User")">&larr; Back to Users</a>
<a href="@Url.Action("Index", "User")"><i class="fa fa-arrow-circle-left"></i> Back to Users</a>
</li>
</ul>
+1 -1
View File
@@ -1,5 +1,5 @@
<ul class="no-print breadcrumb">
<li>
<a href="@Url.Action("Index", "Vehicle")">&larr; Back to Vehicles</a>
<a href="@Url.Action("Index", "Vehicle")"><i class="fa fa-arrow-circle-left"></i> Back to Vehicles</a>
</li>
</ul>
+2 -2
View File
@@ -34,10 +34,10 @@
</a>
<ul class="dropdown-menu">
<li>
@Html.ActionLink("View Service Reminders", "Index", "ServiceReminder", new { VehicleId = Model.VehicleId }, null)
@Html.ActionLink("View Reminders", "Index", "ServiceReminder", new { VehicleId = Model.VehicleId }, null)
</li>
<li>
@Html.ActionLink("Add Completed Service", "Create", "VehicleService", new { VehicleId = Model.VehicleId }, null)
@Html.ActionLink("Add Service", "Create", "VehicleService", new { VehicleId = Model.VehicleId }, null)
</li>
</ul>
</div>
+20 -22
View File
@@ -13,7 +13,7 @@
<h2 id="vehicle-title"><i class="fa fa-car"></i> @ViewBag.Title</h2>
<div class="btn-toolbar">
@Html.ActionLink("Add Another Vehicle", "Create", null, new{@class="btn"})
@Html.ActionLink("Add Vehicle", "Create", null, new{@class="btn"})
@Html.ActionLink("Export All", "Export", null, new { @class = "btn" })
@Html.ActionLink(Model.Inactive ? "Show Active" : "Show Inactive", "Index", new {inactive = !Model.Inactive}, new { @class = "btn" })
</div>
@@ -26,13 +26,7 @@
Ethra Id
</th>
<th>
Model Yr
</th>
<th>
Make
</th>
<th>
Model
Year, Make, Model
</th>
<th>
Type
@@ -46,9 +40,12 @@
<th>
Assigned
</th>
<th>
ODO
</th>
<th>
ODO
</th>
<th>
Next Service
</th>
<th></th>
</tr>
@@ -61,13 +58,7 @@
@Html.DisplayTextFor(m => item.VehicleId)
</td>
<td>
@Html.DisplayTextFor(m => item.ModelYear)
</td>
<td>
@Html.DisplayTextFor(m => item.Make)
</td>
<td>
@Html.DisplayTextFor(m => item.CarModel)
@Html.DisplayTextFor(m => item.ModelYear) @Html.DisplayTextFor(m => item.Make) @Html.DisplayTextFor(m => item.CarModel)
</td>
<td>
<span class="label @item.Color">
@@ -85,13 +76,20 @@
<small class="muted"><em>@Html.DisplayTextFor(m => item.Notes)</em></small>
}
</td>
<td>
@Html.DisplayTextFor(m => item.CurrentOdometer)
</td>
<td>
@Html.DisplayTextFor(m => item.CurrentOdometer)
</td>
<td>
@Html.DisplayTextFor(m => item.NextServiceOdometer)
@if (item.IsNextServiceOverdue)
{
<span class="badge badge-warning" title="overdue @(-item.NextServiceDueInMiles) miles">!</span>
}
@Html.ActionLink("Reminder", "Index", "ServiceReminder", new { vehicleId = item.VehicleId }, new { @class = "btn btn-mini pull-right" })
</td>
<td>
<div class='btn-group'>
@Html.ActionLink("Details", "Details", new { id = item.VehicleId }, new { @class = "btn btn-mini" })
@Html.ActionLink("Svc Reminder", "Index", "ServiceReminder", new { vehicleId = item.VehicleId }, new { @class = "btn btn-mini" })
</div>
</td>
</tr>
+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>
}