Initial
This commit is contained in:
@@ -0,0 +1,92 @@
|
||||
@using MileageTraker.Web.Utility
|
||||
@model MileageTraker.Web.ViewModels.ConfirmCreateLogViewModel
|
||||
|
||||
@{
|
||||
ViewBag.Title = "Confirm";
|
||||
var blackBerry = Request.IsBlackBerry();
|
||||
ViewBag.PageStyle = blackBerry ? "~/Content/CreateLog/BlackBerry.css" : "~/Content/CreateLog/Index.css";
|
||||
Layout = "~/Views/Shared/_Layout.min.cshtml";
|
||||
var endOdometerStyle = Model.PreviousOdometer != null ? "style=padding-bottom:0px;" : "";
|
||||
}
|
||||
<link href="@Url.Content("~/Content/VehicleColors.css")" rel="stylesheet" type="text/css" />
|
||||
|
||||
@using (Html.BeginForm("Action", "CreateLog", FormMethod.Post))
|
||||
{
|
||||
if (!blackBerry)
|
||||
{
|
||||
@:<fieldset>
|
||||
<legend>@ViewBag.Title</legend>
|
||||
}
|
||||
<p class="warning">Please <strong>confirm</strong> - entry not complete until <strong>confirm</strong> clicked</p>
|
||||
if (Model.Miles == 0)
|
||||
{
|
||||
<p class="warning"><strong>Warning - 0 miles are logged - is this a duplicate?</strong></p>
|
||||
}
|
||||
<div class="display-field-container vehicle-id">
|
||||
<div class="display-label">
|
||||
@Html.LabelFor(model => model.VehicleId)
|
||||
</div>
|
||||
<div class="display-field @Model.VehicleColor">
|
||||
@Html.Encode(Model.VehicleId) <span class="subscript">(@Model.VehicleType)</span>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="VehicleId" value="@Html.AttributeEncode(Model.VehicleId)" />
|
||||
<div class="display-field-container endodometer" @endOdometerStyle>
|
||||
<div class="display-label">
|
||||
@Html.LabelFor(model => model.EndOdometer)
|
||||
</div>
|
||||
<div class="display-field">
|
||||
@Html.Encode(Model.EndOdometer)
|
||||
@if (Model.PreviousOdometer != null)
|
||||
{
|
||||
<br/>
|
||||
<span class="subscript @if (Model.Miles == 0)
|
||||
{ <text>warning error</text>}">@Html.Encode(Model.Miles) miles since <br />
|
||||
@Html.Encode(Model.PreviousOdometer) on @Html.Encode(Model.PreviousDate.Value.ToShortDateString())</span>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="EndOdometer" value="@Html.AttributeEncode(Model.EndOdometer)" />
|
||||
@Html.DisplayFor(model => model.LogType)
|
||||
<input type="hidden" name="LogType.Enum" value="@Html.AttributeEncode(Model.LogType.Enum)" />
|
||||
@Html.DisplayFor(model => model.EmployeeName)
|
||||
<input type="hidden" name="EmployeeName" value="@Html.AttributeEncode(Model.EmployeeName)" />
|
||||
@Html.DisplayFor(model => model.CityName)
|
||||
<input type="hidden" name="CityName" value="@Html.AttributeEncode(Model.CityName)" />
|
||||
|
||||
<div class="display-field-container gas">
|
||||
<div class="display-label">
|
||||
@Html.LabelFor(model => model.GasPurchased)
|
||||
</div>
|
||||
<div class="display-field">
|
||||
@if (!string.IsNullOrEmpty(Model.GasPurchased))
|
||||
{
|
||||
@Model.GasPurchased <span class="units">Gallons</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<text>No Gas Purchased</text>
|
||||
}
|
||||
<input type="hidden" name="GasPurchased" value="@Html.AttributeEncode(Model.GasPurchased)" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="display-field-container date">
|
||||
<div class="display-label">
|
||||
@Html.LabelFor(model => model.Date)
|
||||
</div>
|
||||
<div class="display-field">
|
||||
@Html.Encode(Model.Date)
|
||||
<span class="subscript">(@Html.Encode(Model.DateHowLongAgo))</span>
|
||||
<input type="hidden" name="Date" value="@Html.AttributeEncode(Model.Date)" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="submit">
|
||||
<input type="submit" name="Edit" value="Back" />
|
||||
<input type="submit" name="Confirm" value="Confirm" />
|
||||
</div>
|
||||
if (!blackBerry)
|
||||
{
|
||||
@:</fieldset>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
@using MileageTraker.Web.Utility
|
||||
@model MileageTraker.Web.ViewModels.CreateLogViewModel
|
||||
@{
|
||||
|
||||
ViewBag.Title = "Enter Mileage Log";
|
||||
var blackBerry = Request.IsBlackBerry();
|
||||
ViewBag.PageStyle = blackBerry ? "~/Content/CreateLog/BlackBerry.css" : "~/Content/CreateLog/Index.css";
|
||||
Layout = "~/Views/Shared/_Layout.min.cshtml";
|
||||
}
|
||||
<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>
|
||||
<script src="@Url.Content("~/Scripts/jquery.qtip-1.0.0-rc3.min.js")" type="text/javascript"></script>
|
||||
|
||||
@using (Html.BeginForm("Index", "CreateLog", FormMethod.Post))
|
||||
{
|
||||
if (!blackBerry) {
|
||||
@:<fieldset>
|
||||
<legend>@ViewBag.Title</legend>
|
||||
}
|
||||
@Html.ValidationSummary(true)
|
||||
@Html.EditorForModel()
|
||||
<div class="submit">
|
||||
<input type="submit" value="Submit" />
|
||||
</div>
|
||||
if (!blackBerry)
|
||||
{
|
||||
@:</fieldset>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
@using MileageTraker.Web.Models
|
||||
@using MileageTraker.Web.Utility
|
||||
@model IEnumerable<Log>
|
||||
|
||||
@if (Model.Any())
|
||||
{
|
||||
<h4>Recent Logs for @ViewData["employeeName"]</h4>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
Date
|
||||
</th>
|
||||
<th>
|
||||
City
|
||||
</th>
|
||||
<th>
|
||||
End ODO
|
||||
</th>
|
||||
<th>
|
||||
Type
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@foreach (var log in Model)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@Html.Encode(log.Date.ToShortDateString())
|
||||
</td>
|
||||
<td>
|
||||
@Html.Encode(log.CityName)
|
||||
</td>
|
||||
<td>
|
||||
@Html.Encode(log.EndOdometer)
|
||||
</td>
|
||||
<td>
|
||||
@Html.Encode(log.LogType.Enum.GetDisplayName())
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
}
|
||||
else
|
||||
{
|
||||
<h4>Mileage history not found for for "@ViewData["employeeName"]"</h4>
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
@using MileageTraker.Web.Utility
|
||||
@model MileageTraker.Web.ViewModels.CreateLogViewModel
|
||||
@{
|
||||
|
||||
ViewBag.Title = "Success";
|
||||
var blackBerry = Request.IsBlackBerry();
|
||||
ViewBag.PageStyle = blackBerry ? "~/Content/CreateLog/BlackBerry.css" : "~/Content/CreateLog/Index.css";
|
||||
Layout = "~/Views/Shared/_Layout.min.cshtml";
|
||||
}
|
||||
|
||||
@if (!blackBerry) {
|
||||
@:<fieldset>
|
||||
<legend>@ViewBag.Title</legend>
|
||||
}
|
||||
<p>
|
||||
You've successfully created an entry
|
||||
for <strong>@Html.Encode(Model.EmployeeName)</strong>
|
||||
traveling to <strong>@Html.Encode(Model.CityName)</strong>
|
||||
on <strong>@Html.Encode(Model.Date)</strong>
|
||||
in VehicleId <strong>@Html.Encode(Model.VehicleId)</strong>
|
||||
</p>
|
||||
<p>
|
||||
@Html.ActionLink("Create another", "Index", null, new { @class = "ui-button" })
|
||||
</p>
|
||||
@if (!blackBerry)
|
||||
{
|
||||
@:</fieldset>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user