Upload project.
This commit is contained in:
49
ThAmCo.Events/Views/Events/AddCustomer.cshtml
Normal file
49
ThAmCo.Events/Views/Events/AddCustomer.cshtml
Normal file
@@ -0,0 +1,49 @@
|
||||
@model ThAmCo.Events.Models.ViewModels.Events.EventAddCustomerModel
|
||||
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "AddCustomer";
|
||||
}
|
||||
|
||||
<h2>AddCustomer</h2>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Customer.FirstOrDefault().Surname)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Customer.FirstOrDefault().FirstName)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Customer.FirstOrDefault().Email)
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in Model.Customer)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Surname)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.FirstName)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Email)
|
||||
</td>
|
||||
<td>
|
||||
<form asp-action="AddCustomer">
|
||||
<input type="hidden" asp-for="EventId" />
|
||||
@Html.Hidden("EventID", Model.EventId)
|
||||
@Html.Hidden("CustomerID", item.Id)
|
||||
<input type="submit" value="Select" />
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
48
ThAmCo.Events/Views/Events/AddMenu.cshtml
Normal file
48
ThAmCo.Events/Views/Events/AddMenu.cshtml
Normal file
@@ -0,0 +1,48 @@
|
||||
@model ThAmCo.Events.Models.ViewModels.Events.EventAddMenuModel
|
||||
@{
|
||||
ViewData["Title"] = "AddMenu";
|
||||
}
|
||||
|
||||
<h2>AddMenu</h2>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Menus.FirstOrDefault().Id)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Menus.FirstOrDefault().Items)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Menus.FirstOrDefault().Price)
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in Model.Menus)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Id)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Items)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Price)
|
||||
</td>
|
||||
<td>
|
||||
<form asp-action="AddMenu">
|
||||
<input type="hidden" asp-for="EventId" />
|
||||
@Html.Hidden("EventID", Model.EventId)
|
||||
@Html.Hidden("MenuID", item.Id)
|
||||
<input type="submit" value="Select" />
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
55
ThAmCo.Events/Views/Events/AddStaff.cshtml
Normal file
55
ThAmCo.Events/Views/Events/AddStaff.cshtml
Normal file
@@ -0,0 +1,55 @@
|
||||
@model ThAmCo.Events.Models.ViewModels.Events.EventAddStaffModel
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "AddStaff";
|
||||
}
|
||||
|
||||
<h2>AddStaff</h2>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Staff.FirstOrDefault().Surname)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Staff.FirstOrDefault().FirstName)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Staff.FirstOrDefault().Email)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Staff.FirstOrDefault().FirstAid)
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in Model.Staff)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Surname)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.FirstName)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Email)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.FirstAid)
|
||||
</td>
|
||||
<td>
|
||||
<form asp-action="AddStaff">
|
||||
<input type="hidden" asp-for="EventId" />
|
||||
@Html.Hidden("EventID", Model.EventId)
|
||||
@Html.Hidden("StaffID", item.Id)
|
||||
<input type="submit" value="Select" />
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
48
ThAmCo.Events/Views/Events/Create.cshtml
Normal file
48
ThAmCo.Events/Views/Events/Create.cshtml
Normal file
@@ -0,0 +1,48 @@
|
||||
@model ThAmCo.Events.Models.EventCreateModel
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Create";
|
||||
}
|
||||
|
||||
<h2>Create</h2>
|
||||
|
||||
<h4>Event</h4>
|
||||
<hr />
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<form asp-action="Create">
|
||||
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Title" class="control-label"></label>
|
||||
<input asp-for="Title" class="form-control" />
|
||||
<span asp-validation-for="Title" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Date" class="control-label"></label>
|
||||
<input type="date" asp-for="Date" class="form-control" />
|
||||
<span asp-validation-for="Date" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Duration" class="control-label"></label>
|
||||
<input type="time" asp-for="Duration" class="form-control" />
|
||||
<span asp-validation-for="Duration" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="TypeId" class="control-label"></label>
|
||||
<input asp-for="TypeId" class="form-control"></input>
|
||||
<span asp-validation-for="TypeId" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="submit" value="Continue" class="btn btn-default" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
|
||||
}
|
||||
46
ThAmCo.Events/Views/Events/CreateWithVenue.cshtml
Normal file
46
ThAmCo.Events/Views/Events/CreateWithVenue.cshtml
Normal file
@@ -0,0 +1,46 @@
|
||||
@model ThAmCo.Events.Data.Event
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "CreateWithVenue";
|
||||
}
|
||||
|
||||
<h2>CreateWithVenue</h2>
|
||||
|
||||
<h4>Event</h4>
|
||||
<hr />
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<form asp-action="Create">
|
||||
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Title" class="control-label"></label>
|
||||
<input asp-for="Title" class="form-control" />
|
||||
<span asp-validation-for="Title" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Date" class="control-label"></label>
|
||||
<input asp-for="Date" class="form-control" />
|
||||
<span asp-validation-for="Date" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Duration" class="control-label"></label>
|
||||
<input asp-for="Duration" class="form-control" />
|
||||
<span asp-validation-for="Duration" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="TypeId" class="control-label"></label>
|
||||
<input asp-for="TypeId" class="form-control" />
|
||||
<span asp-validation-for="TypeId" class="text-danger"></span>
|
||||
</div>
|
||||
@Html.Hidden("VenueRefernce", Model.VenueReference)
|
||||
<div class="form-group">
|
||||
<input type="submit" value="Create" class="btn btn-default" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</div>
|
||||
|
||||
45
ThAmCo.Events/Views/Events/Delete.cshtml
Normal file
45
ThAmCo.Events/Views/Events/Delete.cshtml
Normal file
@@ -0,0 +1,45 @@
|
||||
@model ThAmCo.Events.Data.Event
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Delete";
|
||||
}
|
||||
|
||||
<h2>Delete</h2>
|
||||
|
||||
<h3>Are you sure you want to delete this?</h3>
|
||||
<div>
|
||||
<h4>Event</h4>
|
||||
<hr />
|
||||
<dl class="dl-horizontal">
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.Title)
|
||||
</dt>
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.Title)
|
||||
</dd>
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.Date)
|
||||
</dt>
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.Date)
|
||||
</dd>
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.Duration)
|
||||
</dt>
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.Duration)
|
||||
</dd>
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.TypeId)
|
||||
</dt>
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.TypeId)
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<form asp-action="Delete">
|
||||
<input type="hidden" asp-for="Id" />
|
||||
<input type="submit" value="Delete" class="btn btn-default" /> |
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</form>
|
||||
</div>
|
||||
251
ThAmCo.Events/Views/Events/Details.cshtml
Normal file
251
ThAmCo.Events/Views/Events/Details.cshtml
Normal file
@@ -0,0 +1,251 @@
|
||||
@model ThAmCo.Events.Models.EventDetailsModel
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Details";
|
||||
}
|
||||
|
||||
<h2>Details</h2>
|
||||
|
||||
<div>
|
||||
<h4>Event</h4>
|
||||
<hr />
|
||||
<dl class="dl-horizontal venue-details">
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.Title)
|
||||
</dt>
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.Title)
|
||||
</dd>
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.Date)
|
||||
</dt>
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.Date)
|
||||
</dd>
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.Duration)
|
||||
</dt>
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.Duration)
|
||||
</dd>
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.TypeId)
|
||||
</dt>
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.TypeId)
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="dl-horizontal venue-details">
|
||||
<dt>
|
||||
<h4><b><u>@Html.DisplayNameFor(model => model.Reservation)</u></b></h4>
|
||||
</dt>
|
||||
|
||||
@if (Model.Reservation == null)
|
||||
{
|
||||
<dd>
|
||||
<a asp-action="SelectVenue" asp-route-id="@Model.Id">Select Venue</a>
|
||||
</dd>
|
||||
}
|
||||
else
|
||||
{
|
||||
<dd></dd>
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.Reservation.VenueCode)
|
||||
</dt>
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.Reservation.VenueCode)
|
||||
</dd>
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.Reservation.EventDate)
|
||||
</dt>
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.Reservation.EventDate)
|
||||
</dd>
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.Reservation.whenMade)
|
||||
</dt>
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.Reservation.whenMade)
|
||||
</dd>
|
||||
<dt></dt>
|
||||
<dd>
|
||||
<a asp-action="FreeReservation" asp-route-id="@Model.Id">Remove Venue</a>
|
||||
</dd>
|
||||
}
|
||||
</dl>
|
||||
|
||||
<dl class="dl-horizontal venue-details">
|
||||
<dt>
|
||||
<h4><b><u>@Html.DisplayNameFor(model => model.FoodReference)</u></b></h4>
|
||||
</dt>
|
||||
@if (Model.FoodReference == 0)
|
||||
{
|
||||
<dd>
|
||||
<a asp-action="AddMenu" asp-route-id="@Model.Id">Select Menu</a>
|
||||
</dd>
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
<dd></dd>
|
||||
<dt>
|
||||
Menu Number
|
||||
</dt>
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.FoodReference)
|
||||
</dd>
|
||||
|
||||
}
|
||||
</dl>
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<a asp-action="Edit" asp-route-id="@Model.Id">Edit</a> |
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<a asp-action="AddCustomer" asp-route-id="@Model.Id">Add Customer</a>
|
||||
</div>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Bookings.FirstOrDefault().Customer.Surname)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Bookings.FirstOrDefault().Customer.FirstName)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Bookings.FirstOrDefault().Customer.Email)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Bookings.FirstOrDefault().Attended)
|
||||
</th>
|
||||
<th>
|
||||
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in Model.Bookings)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Customer.Surname)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Customer.FirstName)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Customer.Email)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Attended)
|
||||
</td>
|
||||
<td>
|
||||
<button onclick="toggleAttendance(@item.Customer.Id, @Model.Id)">Toggle Attendance</button>
|
||||
</td>
|
||||
<td>
|
||||
<form asp-action="RemoveCustomer">
|
||||
<input type="hidden" asp-for="Id" />
|
||||
@Html.Hidden("EventID", Model.Id)
|
||||
@Html.Hidden("CustomerID", item.CustomerId)
|
||||
<input type="submit" value="Remove" />
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Total Attendees: @Model.Bookings.Count
|
||||
|
||||
<div>
|
||||
<a asp-action="AddStaff" asp-route-id="@Model.Id">Add Staff</a>
|
||||
</div>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Staffing.FirstOrDefault().Staff.Surname)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Staffing.FirstOrDefault().Staff.FirstName)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Staffing.FirstOrDefault().Staff.Email)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Staffing.FirstOrDefault().Staff.FirstAid)
|
||||
</th>
|
||||
<th>
|
||||
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in Model.Staffing)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Staff.Surname)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Staff.FirstName)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Staff.Email)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Staff.FirstAid)
|
||||
</td>
|
||||
<td>
|
||||
<form asp-action="RemoveStaff">
|
||||
<input type="hidden" asp-for="Id" />
|
||||
@Html.Hidden("EventID", Model.Id)
|
||||
@Html.Hidden("StaffID", item.StaffId)
|
||||
<input type="submit" value="Remove" />
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h4>
|
||||
@if (Model.Staffing.Count < Math.Ceiling((double)Model.Bookings.Count / 10))
|
||||
{
|
||||
@Html.Raw("⚠ Only have " + Model.Staffing.Count + " staff members, " + Math.Ceiling((double)Model.Bookings.Count / 10) + " are required. <br>")
|
||||
}
|
||||
</h4>
|
||||
<h4>
|
||||
@if (Model.Staffing == null || !Model.Staffing.Any(s => s.Staff.FirstAid))
|
||||
{
|
||||
@Html.Raw("⚠ There is no first aid staff member.")
|
||||
}
|
||||
</h4>
|
||||
|
||||
|
||||
|
||||
@section Scripts {
|
||||
|
||||
<script type="text/javascript">
|
||||
function toggleAttendance(cID, eID)
|
||||
{
|
||||
$.ajax({
|
||||
url: "http://localhost:22263/Events/RegisterAttendance?EventId=" + eID + "&CustomerId=" + cID,
|
||||
type: "POST",
|
||||
crossDomain: true,
|
||||
success: function (result) { window.location.reload(false);},
|
||||
failiure: function () { }
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
}
|
||||
39
ThAmCo.Events/Views/Events/Edit.cshtml
Normal file
39
ThAmCo.Events/Views/Events/Edit.cshtml
Normal file
@@ -0,0 +1,39 @@
|
||||
@model ThAmCo.Events.Data.Event
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Edit";
|
||||
}
|
||||
|
||||
<h2>Edit</h2>
|
||||
|
||||
<h4>Event</h4>
|
||||
<hr />
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<form asp-action="Edit">
|
||||
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
||||
<input type="hidden" asp-for="Id" />
|
||||
<div class="form-group">
|
||||
<label asp-for="Title" class="control-label"></label>
|
||||
<input asp-for="Title" class="form-control" />
|
||||
<span asp-validation-for="Title" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Duration" class="control-label"></label>
|
||||
<input asp-for="Duration" class="form-control" />
|
||||
<span asp-validation-for="Duration" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="submit" value="Save" class="btn btn-default" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
|
||||
}
|
||||
30
ThAmCo.Events/Views/Events/FindVenue.cshtml
Normal file
30
ThAmCo.Events/Views/Events/FindVenue.cshtml
Normal file
@@ -0,0 +1,30 @@
|
||||
@model ThAmCo.Events.Models.ViewModels.Events.EventFindVenueModel
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "FindVenue";
|
||||
}
|
||||
|
||||
<h2>FindVenue</h2>
|
||||
|
||||
<form asp-action="FindVenueResults">
|
||||
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
||||
<div class="form-group">
|
||||
<label asp-for="EventType" class="control-label"></label>
|
||||
<input asp-for="EventType" class="form-control" />
|
||||
<span asp-validation-for="EventType" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="StartDate" class="control-label"></label>
|
||||
<input type="date" asp-for="StartDate" class="form-control" />
|
||||
<span asp-validation-for="StartDate" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="EndDate" class="control-label"></label>
|
||||
<input type="date" asp-for="EndDate" class="form-control" />
|
||||
<span asp-validation-for="EndDate" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="submit" value="Find Venues" class="btn btn-default" />
|
||||
</div>
|
||||
</form>
|
||||
|
||||
60
ThAmCo.Events/Views/Events/FindVenueResults.cshtml
Normal file
60
ThAmCo.Events/Views/Events/FindVenueResults.cshtml
Normal file
@@ -0,0 +1,60 @@
|
||||
@model IEnumerable<ThAmCo.Events.Models.VenueDto>
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "FindVenueResults";
|
||||
}
|
||||
|
||||
<h2>FindVenueResults</h2>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.FirstOrDefault().Code)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.FirstOrDefault().Name)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.FirstOrDefault().Capacity)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.FirstOrDefault().Date)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.FirstOrDefault().CostPerHour)
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in Model)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Code)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Name)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Capacity)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Date)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.CostPerHour)
|
||||
</td>
|
||||
<td>
|
||||
<form asp-action="CreateReservation">
|
||||
@Html.Hidden("VenueDate", item.Date)
|
||||
@Html.Hidden("VenueCode", item.Code)
|
||||
<input type="submit" value="Reserve" />
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
77
ThAmCo.Events/Views/Events/Index.cshtml
Normal file
77
ThAmCo.Events/Views/Events/Index.cshtml
Normal file
@@ -0,0 +1,77 @@
|
||||
@model IEnumerable<ThAmCo.Events.Data.Event>
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Index";
|
||||
}
|
||||
|
||||
<h2>Index</h2>
|
||||
|
||||
<p>
|
||||
<a asp-action="Create">Create New</a>
|
||||
</p>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Title)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Date)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Duration)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.TypeId)
|
||||
</th>
|
||||
<th>
|
||||
BookingCount
|
||||
</th>
|
||||
<th>
|
||||
VenueReference
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in Model) {
|
||||
<tr>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Title)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Date)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Duration)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.TypeId)
|
||||
</td>
|
||||
<td>
|
||||
@item.Bookings.Count
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.VenueReference)
|
||||
</td>
|
||||
<td>
|
||||
@if (item.Staffings.Count < Math.Ceiling((double)item.Bookings.Count / 10))
|
||||
{
|
||||
@Html.Raw("⚠ Only have " + item.Staffings.Count + " staff members, " + Math.Ceiling((double)item.Bookings.Count / 10) + " are required.")
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
@if (item.Staffings == null || !item.Staffings.Any(s => s.Staff.FirstAid))
|
||||
{
|
||||
@Html.Raw("⚠ There is no first aid staff member.")
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
<a asp-action="Edit" asp-route-id="@item.Id">Edit</a> |
|
||||
<a asp-action="Details" asp-route-id="@item.Id">Details</a> |
|
||||
<a asp-action="Delete" asp-route-id="@item.Id">Delete</a>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
59
ThAmCo.Events/Views/Events/SelectVenue.cshtml
Normal file
59
ThAmCo.Events/Views/Events/SelectVenue.cshtml
Normal file
@@ -0,0 +1,59 @@
|
||||
@model ThAmCo.Events.Models.SelectVenueModel
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "SelectVenue";
|
||||
}
|
||||
|
||||
<h2>SelectVenue</h2>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Venues.FirstOrDefault().Code)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Venues.FirstOrDefault().Name)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Venues.FirstOrDefault().Capacity)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Venues.FirstOrDefault().Date)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Venues.FirstOrDefault().CostPerHour)
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in Model.Venues) {
|
||||
<tr>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Code)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Name)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Capacity)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Date)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.CostPerHour)
|
||||
</td>
|
||||
<td>
|
||||
<form asp-action="CreateReservation">
|
||||
@Html.Hidden("VenueDate", item.Date)
|
||||
@Html.Hidden("VenueCode", item.Code)
|
||||
@Html.Hidden("Id", Model.Id)
|
||||
<input type="submit" value="Reserve" />
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
Reference in New Issue
Block a user