Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Basics.Services.Services.Formulario;
- using Basics.UI.Controllers;
- using System.Web.Mvc;
- namespace Basics.UI.Areas.Formulario.Controllers
- {
- public class PendenciaController : Controller
- {
- protected Dia1Service Dia1Service;
- public PendenciaController()
- {
- Dia1Service = new Dia1Service();
- }
- public ActionResult Index()
- {
- var usuarioId = int.Parse(Cookies.GetCookie("uid"));
- ViewBag.Dia1Pendencia = Dia1Service.GetPendenciasByUser(usuarioId);
- return View();
- }
- }
- }
- public IEnumerable<Dia1> GetPendenciasByUser(int PatientId)
- {
- //return Db.Dia1S.Join(Db.Participacoes, a => a.PatientId, b => b.UsuarioId, (a, b) => new { a, b })
- // .Where(s => s.b.ParticipacaoId == PatientId && s.a.Cadeado == 0 && s.a.StatPree == 1)
- // .Select(s => s.a)
- // .ToList();
- return Db.Dia1S.Where(x => x.PatientId == PatientId && x.Cadeado == 0 && x.StatPree == 0);
- }
- <div class="jumbotron">
- <div class="table-responsive" style="padding-left: 38px; overflow-x: inherit;">
- <table id="dataTable" class="table table-bordered">
- <thead>
- <tr>
- <th>Nome do formulário</th>
- <th>Data/Hora</th>
- <th>Status</th>
- <th>Editar</th>
- <th>Cadeado</th>
- </tr>
- </thead>
- <tbody>
- <!-- Dia1 -->
- @foreach (var item in ViewBag.Dia1Pendencia)
- {
- <tr>
- <td>
- Administração
- </td>
- <td>
- @item.DataEdicao
- </td>
- <td>
- @if (item.Status == 1)
- {
- <a class="ui large green label" style="cursor:default">Completo</a>
- }
- else
- {
- <a class="ui large red label" style="cursor:default">Incompleto</a>
- }
- </td>
- <td>
- <a class="ui teal button">Acessar Formulário</a>
- </td>
- <td>
- @if (item.Cadeado == 1)
- {
- <button class="ui green icon button" name="bloq_btn" style="cursor:default" data-content="@item.PatientId">
- <i class="lock icon" id="lib_btn"></i>
- </button>
- }
- else
- {
- <button class="ui red icon button" style="cursor:default">
- <i class="unlock icon"></i>
- </button>
- }
- </td>
- </tr>
- }
- </tbody>
- </table>
- </div>
- </div>
Add Comment
Please, Sign In to add comment