Guest User

Untitled

a guest
Mar 20th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.21 KB | None | 0 0
  1. using Basics.Services.Services.Formulario;
  2. using Basics.UI.Controllers;
  3. using System.Web.Mvc;
  4.  
  5. namespace Basics.UI.Areas.Formulario.Controllers
  6. {
  7. public class PendenciaController : Controller
  8. {
  9. protected Dia1Service Dia1Service;
  10.  
  11. public PendenciaController()
  12. {
  13. Dia1Service = new Dia1Service();
  14. }
  15.  
  16. public ActionResult Index()
  17. {
  18. var usuarioId = int.Parse(Cookies.GetCookie("uid"));
  19. ViewBag.Dia1Pendencia = Dia1Service.GetPendenciasByUser(usuarioId);
  20. return View();
  21. }
  22. }
  23. }
  24.  
  25. public IEnumerable<Dia1> GetPendenciasByUser(int PatientId)
  26. {
  27. //return Db.Dia1S.Join(Db.Participacoes, a => a.PatientId, b => b.UsuarioId, (a, b) => new { a, b })
  28. // .Where(s => s.b.ParticipacaoId == PatientId && s.a.Cadeado == 0 && s.a.StatPree == 1)
  29. // .Select(s => s.a)
  30. // .ToList();
  31.  
  32. return Db.Dia1S.Where(x => x.PatientId == PatientId && x.Cadeado == 0 && x.StatPree == 0);
  33. }
  34.  
  35. <div class="jumbotron">
  36. <div class="table-responsive" style="padding-left: 38px; overflow-x: inherit;">
  37. <table id="dataTable" class="table table-bordered">
  38. <thead>
  39. <tr>
  40. <th>Nome do formulário</th>
  41. <th>Data/Hora</th>
  42. <th>Status</th>
  43. <th>Editar</th>
  44. <th>Cadeado</th>
  45. </tr>
  46. </thead>
  47. <tbody>
  48. <!-- Dia1 -->
  49. @foreach (var item in ViewBag.Dia1Pendencia)
  50. {
  51. <tr>
  52. <td>
  53. Administração
  54. </td>
  55. <td>
  56. @item.DataEdicao
  57. </td>
  58. <td>
  59. @if (item.Status == 1)
  60. {
  61. <a class="ui large green label" style="cursor:default">Completo</a>
  62. }
  63. else
  64. {
  65. <a class="ui large red label" style="cursor:default">Incompleto</a>
  66. }
  67. </td>
  68.  
  69. <td>
  70. <a class="ui teal button">Acessar Formulário</a>
  71. </td>
  72. <td>
  73. @if (item.Cadeado == 1)
  74. {
  75. <button class="ui green icon button" name="bloq_btn" style="cursor:default" data-content="@item.PatientId">
  76. <i class="lock icon" id="lib_btn"></i>
  77. </button>
  78.  
  79. }
  80. else
  81. {
  82. <button class="ui red icon button" style="cursor:default">
  83. <i class="unlock icon"></i>
  84. </button>
  85. }
  86. </td>
  87.  
  88.  
  89. </tr>
  90. }
  91. </tbody>
  92. </table>
  93. </div>
  94. </div>
Add Comment
Please, Sign In to add comment