PageRenderTime 43ms CodeModel.GetById 19ms RepoModel.GetById 1ms app.codeStats 0ms

/MvcApplication1/Views/Viaje/Index.aspx

https://github.com/twisted-proyecto/twisted
ASP.NET | 153 lines | 141 code | 12 blank | 0 comment | 14 complexity | 9fe133794162a18cb5ac78d11d5cb8a9 MD5 | raw file
  1. <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/TwoColumn.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<MvcApplication1.Dominio.Model.Viaje>>" %>
  2. <asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
  3. Gestion de Viajes
  4. </asp:Content>
  5. <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
  6. <script src="http://cdn.jquerytools.org/1.2.5/full/jquery.tools.min.js"></script>
  7. <table style=" width:700px;">
  8. <th style=" text-align: left">
  9. <h2> Gestion de Viajes </h2>
  10. </th>
  11. </table>
  12. <br />
  13. <% if (Model.Count() == 0)
  14. { %>
  15. No existe ningun Viaje disponible.
  16. <% }
  17. else
  18. {%>
  19. <table>
  20. <tr>
  21. <th></th>
  22. <th></th>
  23. <th>
  24. Nombre del Viaje
  25. </th>
  26. <th>
  27. Fecha de Inicio
  28. </th>
  29. <th></th>
  30. <th></th>
  31. </tr>
  32. <%
  33. foreach (var item in Model)
  34. {
  35. %>
  36. <tr>
  37. <td>
  38. <details> <a title="Detalles" href="#" rel="#petrol<%= item.IdViaje%>">
  39. <img src="<%=Url.Content("~/Content/consultar.png")%>" height="25px" width="25px" /></a></details>
  40. <div class="apple_overlay" id="petrol<%= item.IdViaje%>"><fieldset>
  41. <legend><h1><b>Detalles:</b></h1></legend>
  42. <h2>
  43. <b>Nombre:</b>
  44. <%= Html.Encode(item.Nombre) %>
  45. </h2>
  46. <h2>
  47. <b>Destino:</b>
  48. <%= Html.Encode(item.Destino) %>
  49. </h2>
  50. <h2>
  51. <b>Hospedaje:</b>
  52. <%= Html.Encode(item.Hospedaje) %>
  53. </h2>
  54. <h2>
  55. <div class="display-field"><b>Fecha Inicio:</b> <%: String.Format("{0:dd/MM/yyyy}", item.FechaInicio)%></div>
  56. </h2>
  57. <h2>
  58. <div class="display-field"><b>Fecha Fin:</b> <%: String.Format("{0:dd/MM/yyyy}", item.FechaFin)%></div>
  59. </h2>
  60. <h2>
  61. <b>Privacidad:</b>
  62. <%= Html.Encode(item.Privacidad) %>
  63. </h2>
  64. <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br />
  65. </fieldset>
  66. </div>
  67. </td>
  68. <% MvcHtmlString flag = Html.Action("EsMiViajeOParticipo", "Viaje", new {idViaje = item.IdViaje});
  69. MvcHtmlString flagCerrado = Html.Action("ViajeCerrado", "Viaje", new { idViaje = item.IdViaje });
  70. if (flag.ToString() == "true")
  71. {
  72. if (flagCerrado.ToString() == "false")
  73. {%>
  74. <td>
  75. <a title="Editar" href="<%=Url.Action("Edit", "Viaje", new {id = item.IdViaje}, null)%>">
  76. <img src="<%=Url.Content("~/Content/editar.png")%>" height="25px" width="25px" /></a>
  77. </td>
  78. <%
  79. }
  80. else
  81. { %>
  82. <td></td>
  83. <% }
  84. }
  85. else
  86. { %>
  87. <td></td>
  88. <% }%>
  89. <td>
  90. <%=Html.Encode(item.Nombre)%>
  91. </td>
  92. <td>
  93. <%:String.Format("{0:dd/MM/yyyy}", item.FechaInicio)%>
  94. </td>
  95. <%
  96. if (flagCerrado.ToString() == "false")
  97. { %>
  98. <td>
  99. <a title="Destinos de este viaje" href="<%=Url.Action("Index", "Destino", new {idViaje = item.IdViaje}, null)%>">
  100. <img src="<%=Url.Content("~/Content/destinos.png")%>" height="23px" width="23px" /></a>
  101. </td>
  102. <%
  103. }
  104. else
  105. { %>
  106. <td>
  107. <a title="Mostrar Itinerario" href="<%=Url.Action("ViajeDestinosReporte", "Viaje", new {idViaje = item.IdViaje}, null)%>">
  108. <img src="<%=Url.Content("~/Content/itinerario.png")%>" height="23px" width="23px" /></a>
  109. </td>
  110. <% }%>
  111. <% MvcHtmlString flagDuenio = Html.Action("EsMiViaje", "Viaje", new { idViaje = item.IdViaje });
  112. if (flagDuenio.ToString() == "true")
  113. {
  114. if (flagCerrado.ToString() == "false")
  115. {%>
  116. <td>
  117. <a title="Eliminar" href="<%=Url.Action("Delete", "Viaje", new {id = item.IdViaje}, null)%>">
  118. <img src="<%=Url.Content("~/Content/eliminar.png")%>" height="25px" width="25px" /></a>
  119. </td>
  120. <%
  121. }
  122. if (flagCerrado.ToString() == "false")
  123. {%>
  124. <td>
  125. <a title="Cerrar Viaje" href="<%=Url.Action("CerrarViaje", "Viaje", new {idViaje = item.IdViaje}, null)%>">
  126. <img src="<%=Url.Content("~/Content/cerrarViaje.png")%>" height="37px" width="37px" /></a>
  127. </td>
  128. <%
  129. }
  130. }%>
  131. </tr>
  132. <%
  133. }
  134. }%>
  135. </table>
  136. <script>
  137. $(function () {
  138. $("a[rel]").overlay({ mask: '#000', effect: 'apple' });
  139. });
  140. </script>
  141. </asp:Content>