Files
MileageTraker/Web/Views/CreateLog/RecentLogs.cshtml
T

54 lines
894 B
Plaintext

@using MileageTraker.Web.Models
@using MileageTraker.Web.Utility
@model IEnumerable<Log>
@if (Model.Any())
{
<h5>Recent Logs for @ViewData["employeeName"]</h5>
<table class="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
{
if (!string.IsNullOrEmpty(ViewData["employeeName"].ToString()))
{
<h5>Mileage history not found for employee "@ViewData["employeeName"]"</h5>
}
else
{
<h5>Please enter employee name</h5>
}
}