Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @model IEnumerable<ARTex.Core.Models.Reservation>
- @using ARTex.Core.Models
- @{
- ViewBag.Title = "Index";
- }
- <table class="IndexActionLinks">
- <tr>
- @if (User.IsInRole("Admin"))
- {
- <td>
- @Html.ActionLink("Nieuwe reservatie", "Create", "Reservation", null, new { @class = "inline", id = "newReservation" })    </td>
- }
- <td>
- @Html.ActionLink("Legende", "LegendList", "Reservation", null, new { @class = "inline" })   </td>
- @if (User.IsInRole("Admin"))
- {
- <td>
- @Html.ActionLink("Geblokkeerde datums", "BlockedDate", "Reservation", null, new { @class = "inlineBlockedDate" })
- </td>
- }
- </tr>
- </table>
- @if (Model.Count() > 0)
- {
- <div class="tableDiv">
- <table class="tableReservations">
- <col width="92" />
- <col width="91" />
- <col width="91" />
- <col width="95" />
- <col width="136" />
- <col width="91" />
- <col width="45" />
- <col width="136" />
- <col width="136" />
- <col width="17" />
- <thead>
- <tr>
- <th>
- Dag
- </th>
- <th>
- Datum
- </th>
- <th>
- Tijd
- </th>
- <th>
- Rondleiding
- </th>
- <th>
- Type
- </th>
- <th>
- Gids
- </th>
- <th class="tdCenter">
- Aantal
- </th>
- <th class="tdCenter">
- Taal
- </th>
- <th class="tdCenter headerIconsReservation">
- @if (!ViewBag.deleted)
- {
- @Html.ActionLink(" ", "IndexDeleted", "Reservation", null, new { @class = "showDeletedReservation tooltip", title = "Toon oude reservaties" })
- }
- else
- {
- @Html.ActionLink(" ", "Index", "Reservation", null, new { @class = "showRegularReservation tooltip", title = "Toon reservaties" })
- }
- @Html.ActionLink(DateTime.Now.Day.ToString(), "Agenda", "Reservation", null, new { @class = "agendaBig tooltip", title = "Agenda" })
- @*@Html.ActionLink(" ", "Excel", "Reservation", null, new { @class = "excel tooltip", title = "Genereer Excel" })*@
- </th>
- <th>
- </th>
- </tr>
- </thead>
- </table>
- <div class="tableBodyDiv">
- <table class="tableReservations">
- <col width="92">
- <col width="91">
- <col width="91">
- <col width="95">
- <col width="136">
- <col width="91">
- <col width="45">
- <col width="136">
- <col width="136">
- <tbody class="tableBody">
- @foreach (var item in Model)
- {
- bool isBlocked = false;
- foreach (BlockedDate blockedDate in ViewBag.Blocked)
- {
- if (item.DateTime.Date >= blockedDate.FromDate.Date && item.DateTime.Date <= blockedDate.UntilDate.Date)
- {
- isBlocked = true;
- }
- }
- <tr class="@(item.Cancelled ? "cancelled tooltip" : item.Confirmed ? isBlocked ? "blocked tooltip" : "" : "resNotConfirmed tooltip") reservationListRow" id="@(item.Id)" @Html.Raw(item.Cancelled ? "title=\"Geannuleerd\"" : item.Confirmed ? isBlocked ? "title=\"Geblokeerde dag\"" : "" : "title=\"Bevestiging nodig\"")>
- <td>
- @item.DateTime.ToString("dddd")
- </td>
- <td>
- @item.DateTime.ToString("dd/MM/yyyy")
- </td>
- <td>
- @item.DateTime.ToString("HH:mm")
- </td>
- <td>
- @Html.DisplayFor(modelItem => item.TourType.Name)
- </td>
- <td>
- @if (item.Groups.Count != 0)
- {
- if (item.Groups.First().GroupName == null || item.Groups.First().GroupName.Trim().Equals(""))
- {
- @Html.DisplayFor(modelItem => item.ReservationType)
- }
- else
- {
- @Html.DisplayFor(modelItem => item.Groups.First().GroupName)
- }
- }
- else
- {
- @Html.DisplayFor(modelItem => item.ReservationType)
- }
- </td>
- <td>
- @if (item.GuideReservations.Count != 0)
- {
- foreach (GuideReservation GR in item.GuideReservations)
- {
- if (User.IsInRole("Admin") && !item.Deleted)
- {
- @Html.ActionLink(GR.Guide.Name, "ConfirmGuides", "Reservation", new { id = item.Id }, new { @class = "inline " + (GR.Confirmed ? "" : "guideNotConfirmed") })
- }
- else
- {
- <span class = "@(GR.Confirmed ? "" : "guideNotConfirmed")">@GR.Guide.Name</span>
- }
- <br />
- }
- }
- else
- {
- <img class="tooltip" src="@Url.Content("~/Content/images/icon_warning.png")" title="Geen" />
- }
- </td>
- <td class="tdCenter">
- @{var total = 0;
- foreach (var groep in item.Groups)
- {
- total += groep.Amount;
- }
- foreach (var individual in item.Individuals)
- {
- total += individual.Amount;
- }
- }
- @total
- </td>
- <td class="tdCenter">
- @{var languages = new HashSet<String>();
- var languageString = "";
- foreach (var groep in item.Groups)
- {
- languages.Add(groep.Language.language);
- }
- foreach (var individual in item.Individuals)
- {
- languages.Add(individual.Language.language);
- }
- foreach (var language in languages)
- {
- switch (language)
- {
- case "Nederlands": languageString += "NL"; break;
- case "Frans": languageString += "FR"; break;
- case "Duits": languageString += "DE"; break;
- case "Engels": languageString += "EN"; break;
- }
- languageString += " | ";
- }
- int Place = languageString.LastIndexOf(" | ");
- if (Place > 0)
- {
- languageString = languageString.Remove(Place, 3);
- }
- }
- @languageString
- </td>
- <td class="tdCenter bodyIcons iconTd iconsReservation">
- @if (User.IsInRole("Admin"))
- {
- @Html.ActionLink(" ", "Edit", "Reservation", new { id = item.Id }, new { @class = "tooltip inline edit icons " + (ViewBag.deleted ? "hide" : ""), title = "Wijzig" })
- @Html.ActionLink(" ", "Details", new { id = item.Id }, new { @class = "details tooltip icons", title = "Details" })
- @Html.ActionLink(" ", "Cancel", "Reservation", new { id = item.Id }, new { @class = "tooltip inline icons " + (ViewBag.deleted ? "hide" : "") + (!item.Cancelled ? "cancel" : "accept"), title = (item.Cancelled ? "Maak annulatie ongedaan" : "Annuleer") })
- }
- else
- {
- @Html.ActionLink(" ", "Details", new { id = item.Id }, new { @class = "details tooltip ", title = "Details" })
- }
- </td>
- </tr>
- }
- </tbody>
- </table>
- </div>
- </div>
- }
- else
- {
- <p>
- Er zijn momenteel geen reservaties toegevoegd.</p>
- }
Advertisement
Add Comment
Please, Sign In to add comment