This commit is contained in:
2012-11-30 21:35:06 -05:00
commit 3963d6363a
346 changed files with 351799 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
@model MileageTraker.Web.Models.Log
@{
ViewBag.Title = "Create Log";
}
<h2>@ViewBag.Title</h2>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
@using (Html.BeginForm()) {
@Html.ValidationSummary(true)
<fieldset>
<legend>Log</legend>
@Html.EditorForModel()
<p>
<input type="submit" value="Create" />
</p>
</fieldset>
}
<p>
@Html.ActionLink("Back to List", "Index", null, new { @class = "ui-button" })
</p>
+19
View File
@@ -0,0 +1,19 @@
@model MileageTraker.Web.Models.Log
@{
ViewBag.Title = "Delete Log";
}
<h2>@ViewBag.Title</h2>
<h3>Are you sure you want to delete this?</h3>
<fieldset>
<legend>Log</legend>
@Html.DisplayForModel()
</fieldset>
@using (Html.BeginForm()) {
<p>
<input type="submit" value="Delete" />
@Html.ActionLink("Back to List", "Index", null, new { @class = "ui-button" })
</p>
}
+23
View File
@@ -0,0 +1,23 @@
@model MileageTraker.Web.Models.Log
@{
ViewBag.Title = "Log Details";
}
<h2>@ViewBag.Title</h2>
<p>
@Html.ActionLink("Previous", "PreviousDetails", new { id = Model.LogId }, new { @class = "ui-button" })
@Html.ActionLink("Next", "NextDetails", new { id = Model.LogId }, new { @class = "ui-button" })
@if(TempData["Message"] != null) {
<span class="ui-message ui-state-highlight ui-corner-all">@TempData["Message"]</span>
}
</p>
<fieldset>
<legend>Log</legend>
@Html.DisplayForModel()
</fieldset>
<p>
@Html.ActionLink("Edit", "Edit", new { id = Model.LogId }, new { @class = "ui-button" })
@Html.ActionLink("Back to List", "Index", null, new { @class = "ui-button" })
</p>
+10
View File
@@ -0,0 +1,10 @@
@using MileageTraker.Web.ViewModels
@model LogPartialDetails
@{
Layout = null;
}
<h5>Previous Log</h5>
@Html.DisplayForModel()
<p>
@Html.ActionLink("Details", "Details", new { id = Model.LogId })
</p>
+27
View File
@@ -0,0 +1,27 @@
@model MileageTraker.Web.Models.Log
@{
ViewBag.Title = "Edit Log";
}
<h2>@ViewBag.Title</h2>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
@using (Html.BeginForm()) {
@Html.ValidationSummary(true)
<fieldset>
<legend>Log</legend>
@Html.EditorForModel()
<p>
<input type="submit" value="Save" />
</p>
</fieldset>
}
<p>
@Html.ActionLink("Back to List", "Index", null, new { @class = "ui-button" })
</p>
+8
View File
@@ -0,0 +1,8 @@
@{
ViewBag.Title = "No Logs";
}
<h2>@ViewBag.Title</h2>
<div>
No logs have been added. @Html.ActionLink("Create Log", "Create", null, new { @class = "ui-button" }).
</div>
+56
View File
@@ -0,0 +1,56 @@
@using MileageTraker.Web.Utility
@using MileageTraker.Web.ViewModels
@model LogResultsViewModel
@{
ViewBag.Title = "Logs";
var grid = new WebGrid(Model.Logs, rowsPerPage: 45);
}
<h2>@ViewBag.Title</h2>
@section Styles {
<link href="@Url.Content("~/Content/VehicleColors.css")" rel="stylesheet" type="text/css" />
}
<script src="@Url.Content("~/Scripts/jquery.qtip-1.0.0-rc3.min.js")" type="text/javascript"></script>
<p>
@using (Html.BeginForm("Index", "Log", FormMethod.Get, new { id = "filter" }))
{
@Html.EditorForModel()
<input type="submit" value="Filter" />
}
</p>
<p>
<div id="newLog">
@Html.ActionLink("Vehicle Mileage", "MonthlyVehicleMileage", new { Year = Model.SelectedYear, Month = Model.SelectedMonth, LogType = Model.SelectedLogType }, new { @class = "ui-button" })
@Html.ActionLink("Employee Mileage", "MonthlyEmployeeMileage", new { Year = Model.SelectedYear, Month = Model.SelectedMonth, LogType = Model.SelectedLogType }, new { @class = "ui-button" })
@Html.ActionLink("Add New Log", "Create", null, new { @class = "ui-button" })
@Html.ActionLink("Export", "Export", new { Year = Model.SelectedYear, Month = Model.SelectedMonth, LogType = Model.SelectedLogType }, new { @class = "ui-button" })
</div>
</p>
<div>
@grid.GetHtml(columns:
grid.Columns(
grid.Column("VehicleId", "Vehicle ID", item => Html.ActionLink((string)item.VehicleId, "DetailsPartial", "Vehicle", new { id = item.VehicleId }, new { @class = "qtip-modal" })),
grid.Column("EndOdometer", "End ODO"),
grid.Column("Miles", canSort: false, format: item =>
{
if (item.PreviousLogId != null)
{
string miles = (item.EndOdometer - item.PreviousLogEndOdometer).ToString();
return Html.ActionLink(miles, "DetailsPartial", new { id = item.PreviousLogId }, new { @class = "qtip-modal" });
}
return Html.Raw("<span class='miles-unknown'>?</span>");
}),
grid.Column("LogType", "Type", item => ((Enum)item.LogType).GetDisplayShortName()),
grid.Column("GasPurchased", "Gas", item => item.GasPurchased > 0 ? String.Format("{0:0.000}", item.GasPurchased) : string.Empty),
grid.Column("Date", format: item => item.Date.ToString("d")),
grid.Column("CityName", "City Name"),
grid.Column("EmployeeName", "Employee Name"),
grid.Column(format: item => Html.ActionLink("Edit", "Edit", new { id = item.LogId })),
grid.Column(format: item => Html.ActionLink("Details", "Details", new { id = item.LogId })),
grid.Column(format: item => Html.ActionLink("Delete", "Delete", new { id = item.LogId }))
)
)
</div>
+48
View File
@@ -0,0 +1,48 @@
@using System.Globalization
@using MileageTraker.Web.Models
@model IEnumerable<Tuple<Log, Log>>
<div class="report-calculation">
<table>
<thead><tr><th>Date</th><th>City</th><th>End ODO</th><th>Start ODO</th><th>Miles</th></tr></thead>
@foreach (var log in Model)
{
<tr>
<td>
@Html.Encode(log.Item2.Date.ToShortDateString())
</td>
<td>
@Html.Encode(log.Item2.CityName)
</td>
<td>
@Html.ActionLink(log.Item2.EndOdometer.ToString(CultureInfo.InvariantCulture), "Details", "Log", new {id = log.Item2.LogId}, null)
</td>
@if (log.Item1 != null)
{
<td>
@Html.ActionLink(log.Item1.EndOdometer.ToString(CultureInfo.InvariantCulture), "Details", "Log", new {id = log.Item1.LogId}, null)
</td>
<td>
@(log.Item2.EndOdometer - log.Item1.EndOdometer)
</td>
}
else
{
<td colspan="2">
<span class="ui-state-error">?</span>
</td>
}
</tr>
}
<tfoot>
<tr>
<td colspan="4">
Total:</td>
<td>
@Model.Sum(log => log.Item1 != null ? log.Item2.EndOdometer - log.Item1.EndOdometer : 0)
</td>
</tr>
</tfoot>
</table>
</div>
@@ -0,0 +1,54 @@
@model MileageTraker.Web.ViewModels.EmployeeMileageViewModel
@{
ViewBag.Title = "Employee Mileage Report";
}
<h2>@ViewBag.Title</h2>
<script src="@Url.Content("~/Scripts/jquery.qtip-1.0.0-rc3.min.js")" type="text/javascript"></script>
<p class="no-print">
@Html.ActionLink("Logs", "Index", "Log", Model.Query, new { @class = "ui-button" })
</p>
@Html.DisplayFor(m => m.Query.Year)
@Html.DisplayFor(m => m.Query.Month)
@if (Model.Query.LogType.HasValue)
{
@Html.DisplayFor(m => m.Query.LogType)
}
<table>
<tr>
<th>
Employee
</th>
<th>
Trips
</th>
<th>
Total Miles
</th>
<th>
Total Gas Purchased
</th>
</tr>
@foreach (var item in Model.Items)
{
<tr>
<td>
@Html.DisplayTextFor(i => item.EmployeeName)
</td>
<td>
@Html.DisplayTextFor(i => item.TripCount)
</td>
<td @if (item.LogPairs.Any(lp => lp.Item1 == null)){
@:class="ui-state-error"
}>
<span class="report-miles">@Html.DisplayTextFor(i => item.Miles) <span class="ui-icon ui-icon-triangle-1-n"></span></span>
@Html.Partial("LogsSummary", item.LogPairs)
</td>
<td>
@Html.DisplayTextFor(i => item.GasPurchased)
</td>
</tr>
}
<tfoot><tr><td colspan="2">Total:</td><td>@Html.DisplayTextFor(m => m.TotalMiles)</td><td>@Html.DisplayTextFor(m => m.TotalGasPurchased)</td></tr></tfoot>
</table>
@@ -0,0 +1,55 @@
@using System.Globalization
@model MileageTraker.Web.ViewModels.VehicleMileageViewModel
@{
ViewBag.Title = "Vehicle Mileage Report";
}
<h2>@ViewBag.Title</h2>
<script src="@Url.Content("~/Scripts/jquery.qtip-1.0.0-rc3.min.js")" type="text/javascript"></script>
<p class="no-print">
@Html.ActionLink("Logs", "Index", "Log", Model.Query, new { @class = "ui-button" })
</p>
@Html.DisplayFor(m => m.Query.Year)
@Html.DisplayFor(m => m.Query.Month)
@if (Model.Query.LogType.HasValue)
{
@Html.DisplayFor(m => m.Query.LogType)
}
<table>
<tr>
<th>
Vehicle Id
</th>
<th>
Prog
</th>
<th>
Total Miles
</th>
<th>
Total Gas Purchased
</th>
</tr>
@foreach (var item in Model.Items)
{
<tr>
<td>
@Html.ActionLink(item.VehicleId, "Details", "Vehicle", new { id = item.VehicleId }, null)
</td>
<td>
@Html.DisplayTextFor(i => item.Prog)
</td>
<td @if (item.LogPairs.Any(lp => lp.Item1 == null)){
@:class="ui-state-error"
}>
<span class="report-miles">@Html.DisplayTextFor(i => item.Miles) <span class="ui-icon ui-icon-triangle-1-n"></span></span>
@Html.Partial("LogsSummary", item.LogPairs)
</td>
<td>
@Html.DisplayTextFor(i => item.GasPurchased)
</td>
</tr>
}
<tfoot><tr><td colspan="2">Total:</td><td>@Html.DisplayTextFor(m => m.TotalMiles)</td><td>@Html.DisplayTextFor(m => m.TotalGasPurchased)</td></tr></tfoot>
</table>