Guest User

HTML

a guest
Jul 16th, 2012
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 10.46 KB | None | 0 0
  1.  
  2. @model IEnumerable<ARTex.Core.Models.Reservation>
  3. @using ARTex.Core.Models
  4. @{
  5.     ViewBag.Title = "Index";
  6. }
  7. <table class="IndexActionLinks">
  8. <tr>
  9.  
  10. @if (User.IsInRole("Admin"))
  11. {
  12.     <td>
  13.     @Html.ActionLink("Nieuwe reservatie", "Create", "Reservation", null, new { @class = "inline", id = "newReservation" }) &nbsp &nbsp</td>
  14.     }
  15.     <td>
  16. @Html.ActionLink("Legende", "LegendList", "Reservation", null, new { @class = "inline" })&nbsp &nbsp</td>
  17.     @if (User.IsInRole("Admin"))
  18.     {
  19.     <td>
  20.     @Html.ActionLink("Geblokkeerde datums", "BlockedDate", "Reservation", null, new { @class = "inlineBlockedDate" })
  21.    </td>
  22.     }  
  23.  
  24.  
  25. </tr>
  26. </table>
  27. @if (Model.Count() > 0)
  28. {
  29.    
  30.     <div class="tableDiv">
  31.         <table class="tableReservations">
  32.             <col width="92" />
  33.             <col width="91" />
  34.             <col width="91" />
  35.             <col width="95" />
  36.             <col width="136" />
  37.             <col width="91" />
  38.             <col width="45" />
  39.             <col width="136" />
  40.             <col width="136" />
  41.             <col width="17" />
  42.             <thead>
  43.                 <tr>
  44.                     <th>
  45.                         Dag
  46.                     </th>
  47.                     <th>
  48.                         Datum
  49.                     </th>
  50.                     <th>
  51.                         Tijd
  52.                     </th>
  53.                     <th>
  54.                         Rondleiding
  55.                     </th>
  56.                     <th>
  57.                         Type
  58.                     </th>
  59.                     <th>
  60.                         Gids
  61.                     </th>
  62.                     <th class="tdCenter">
  63.                         Aantal
  64.                     </th>
  65.                     <th class="tdCenter">
  66.                         Taal
  67.                     </th>
  68.                    
  69.                     <th class="tdCenter headerIconsReservation">
  70.                         @if (!ViewBag.deleted)
  71.                         {
  72.                             @Html.ActionLink(" ", "IndexDeleted", "Reservation", null, new { @class = "showDeletedReservation tooltip", title = "Toon oude reservaties" })
  73.                         }
  74.                         else
  75.                         {
  76.                             @Html.ActionLink(" ", "Index", "Reservation", null, new { @class = "showRegularReservation tooltip", title = "Toon reservaties" })
  77.                         }
  78.                         @Html.ActionLink(DateTime.Now.Day.ToString(), "Agenda", "Reservation", null, new { @class = "agendaBig tooltip", title = "Agenda" })
  79.                         @*@Html.ActionLink(" ", "Excel", "Reservation", null, new { @class = "excel tooltip", title = "Genereer Excel" })*@
  80.                     </th>
  81.                     <th>
  82.                     </th>
  83.                 </tr>
  84.             </thead>
  85.         </table>
  86.         <div class="tableBodyDiv">
  87.             <table class="tableReservations">
  88.                 <col width="92">
  89.                 <col width="91">
  90.                 <col width="91">
  91.                 <col width="95">
  92.                 <col width="136">
  93.                 <col width="91">
  94.                 <col width="45">
  95.                 <col width="136">
  96.                 <col width="136">
  97.                 <tbody class="tableBody">
  98.                     @foreach (var item in Model)
  99.                     {
  100.                         bool isBlocked = false;
  101.  
  102.                         foreach (BlockedDate blockedDate in ViewBag.Blocked)
  103.                         {
  104.  
  105.  
  106.                             if (item.DateTime.Date >= blockedDate.FromDate.Date && item.DateTime.Date <= blockedDate.UntilDate.Date)
  107.                             {
  108.                                 isBlocked = true;
  109.  
  110.                             }
  111.  
  112.  
  113.                         }
  114.                         <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\"")>
  115.  
  116.          
  117.                             <td>
  118.                            
  119.                                 @item.DateTime.ToString("dddd")
  120.                             </td>
  121.                             <td>
  122.                                 @item.DateTime.ToString("dd/MM/yyyy")
  123.                             </td>
  124.                             <td>
  125.                                 @item.DateTime.ToString("HH:mm")
  126.                             </td>
  127.                             <td>
  128.                                 @Html.DisplayFor(modelItem => item.TourType.Name)
  129.                             </td>
  130.                             <td>
  131.                                 @if (item.Groups.Count != 0)
  132.                                 {
  133.                                     if (item.Groups.First().GroupName == null || item.Groups.First().GroupName.Trim().Equals(""))
  134.                                     {
  135.                                     @Html.DisplayFor(modelItem => item.ReservationType)            
  136.                                     }
  137.                                     else
  138.                                     {
  139.                                     @Html.DisplayFor(modelItem => item.Groups.First().GroupName)
  140.                                     }
  141.                                 }
  142.                                 else
  143.                                 {
  144.                                     @Html.DisplayFor(modelItem => item.ReservationType)    
  145.                                 }
  146.                             </td>
  147.                             <td>
  148.                             @if (item.GuideReservations.Count != 0)
  149.                             {
  150.                                 foreach (GuideReservation GR in item.GuideReservations)
  151.                                 {
  152.                                     if (User.IsInRole("Admin") && !item.Deleted)
  153.                                     {
  154.                                     @Html.ActionLink(GR.Guide.Name, "ConfirmGuides", "Reservation", new { id = item.Id }, new { @class = "inline " + (GR.Confirmed ? "" : "guideNotConfirmed") })
  155.                                     }
  156.                                     else
  157.                                     {
  158.                                         <span class = "@(GR.Confirmed ? "" : "guideNotConfirmed")">@GR.Guide.Name</span>
  159.                                     }
  160.                                     <br />
  161.                                 }
  162.                             }
  163.                             else
  164.                             {
  165.                                     <img class="tooltip" src="@Url.Content("~/Content/images/icon_warning.png")" title="Geen" />
  166.                             }
  167.                             </td>
  168.                             <td class="tdCenter">
  169.                                 @{var total = 0;
  170.                                   foreach (var groep in item.Groups)
  171.                                   {
  172.                                       total += groep.Amount;
  173.                                   }
  174.                                   foreach (var individual in item.Individuals)
  175.                                   {
  176.                                       total += individual.Amount;
  177.                                   }
  178.                                 }
  179.                                 @total
  180.                             </td>
  181.                             <td class="tdCenter">
  182.                                 @{var languages = new HashSet<String>();
  183.                                   var languageString = "";
  184.                                   foreach (var groep in item.Groups)
  185.                                   {
  186.                                       languages.Add(groep.Language.language);
  187.                                   }
  188.                                   foreach (var individual in item.Individuals)
  189.                                   {
  190.                                       languages.Add(individual.Language.language);
  191.                                   }
  192.                                   foreach (var language in languages)
  193.                                   {
  194.                                       switch (language)
  195.                                       {
  196.                                           case "Nederlands": languageString += "NL"; break;
  197.                                           case "Frans": languageString += "FR"; break;
  198.                                           case "Duits": languageString += "DE"; break;
  199.                                           case "Engels": languageString += "EN"; break;
  200.                                       }
  201.                                       languageString += " | ";
  202.                                   }
  203.                                   int Place = languageString.LastIndexOf(" | ");
  204.                                   if (Place > 0)
  205.                                   {
  206.                                       languageString = languageString.Remove(Place, 3);
  207.                                   }
  208.                                 }
  209.                                 @languageString
  210.                             </td>
  211.                             <td class="tdCenter bodyIcons iconTd iconsReservation">
  212.                             @if (User.IsInRole("Admin"))
  213.                             {  
  214.                                     @Html.ActionLink(" ", "Edit", "Reservation", new { id = item.Id }, new { @class = "tooltip inline edit icons " + (ViewBag.deleted ? "hide" : ""), title = "Wijzig" })
  215.                                     @Html.ActionLink(" ", "Details", new { id = item.Id }, new { @class = "details tooltip icons", title = "Details" })    
  216.                                     @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") })  
  217.                             }
  218.                             else
  219.                             {
  220.                             @Html.ActionLink(" ", "Details", new { id = item.Id }, new { @class = "details tooltip ", title = "Details" })
  221.                             }
  222.                            </td>
  223.                         </tr>  
  224.                     }
  225.                 </tbody>
  226.             </table>
  227.         </div>
  228.     </div>
  229. }
  230. else
  231. {
  232.     <p>
  233.         Er zijn momenteel geen reservaties toegevoegd.</p>
  234. }
Advertisement
Add Comment
Please, Sign In to add comment