Guest User

Untitled

a guest
May 10th, 2018
341
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.27 KB | None | 0 0
  1. <table class="table table-bordered data-table" style="font-size: 12px">
  2. <tr>
  3. <th>Remetente</th>
  4. <th>@Html.DisplayNameFor(m => m.DocumentoTipoId)</th>
  5. <th>@Html.DisplayNameFor(m => m.DataRecebimentoRecepcao)</th>
  6. <th>@Html.DisplayNameFor(m => m.DataRecebimentoSecretaria)</th>
  7. <th>@Html.DisplayNameFor(m => m.Observacao)</th>
  8. <th>@Html.DisplayNameFor(m => m.UserId)</th>
  9. <th>Ação</th>
  10. </tr>
  11.  
  12. @foreach (var docs in Model.Documentos) {
  13. var dataRec = docs.DataRecebimentoRecepcao.HasValue ? docs.DataRecebimentoRecepcao.Value.ToString() : "";
  14. var dataSec = docs.DataRecebimentoSecretaria.HasValue ? docs.DataRecebimentoSecretaria.Value.ToString() : "";
  15. <tr>
  16. <td>@docs.Remetente</td>
  17. <td>@docs.DocumentoTipo.Tipo</td>
  18. <td>@dataRec</td>
  19. <td>@dataSec</td>
  20. <td>@docs.Observacao</td>
  21. <td>@docs.UserProfileV.UserName</td> @*O ERRO ESTÁ NESTA LINHA*@
  22.  
  23. <td>
  24. <button type="button" class="btn btn-primary" title="Editar Documento"
  25. onclick="location.href = '@Url.Action("ValidarDocumento", new { id = MyCrypto.Encrypt(docs.DocumentoId.ToString()) })'">
  26. <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>
  27. </button>
  28. </td>
  29. </tr>
  30. }
  31. </table>
  32.  
  33. public class Documento {
  34.  
  35. public int DocumentoId { get; set; }
  36. public string Remetente { get; set; }
  37. public DateTime? DataRecebimentoRecepcao { get; set; }
  38. public DateTime? DataRecebimentoSecretaria { get; set; }
  39. public bool Retirado { get; set; }
  40. public string Observacao { get; set; }
  41.  
  42. // Relacionamento 1:N
  43.  
  44. public int DocumentoTipoId { get; set; }
  45. public virtual DocumentoTipo DocumentoTipo { get; set; }
  46.  
  47. public int UserId { get; set; }
  48. public virtual UserProfileContext UserProfileV { get; set; }
  49. }
  50.  
  51. public class UserProfileContext {
  52. public UserProfileContext() {
  53. this.DadosComplementares = new List<DadosComplementares>();
  54. this.webpages_Roles = new List<webpages_Roles>();
  55. this.Chamados = new List<ChamadoContext>();
  56. this.Interessados = new List<InteressadosContext>();
  57. this.Tecnicos = new List<TecnicoContext>();
  58. this.Documentos = new List<Documento>();
  59. //this.DocumentosFuncionarios = new List<DocumentoFuncionario>();
  60.  
  61. }
  62.  
  63. public int UserId { get; set; }
  64. public string UserName { get; set; }
  65. public virtual ICollection<ChamadoContext> Chamados { get; set; }
  66. public virtual ICollection<ChamadosMkt> ChamadosMkt { get; set; }
  67. public virtual ICollection<DadosComplementares> DadosComplementares { get; set; }
  68. public virtual ICollection<webpages_Roles> webpages_Roles { get; set; }
  69. public virtual ICollection<InteressadosContext> Interessados { get; set; }
  70. public virtual ICollection<TecnicoContext> Tecnicos { get; set; }
  71. public virtual ICollection<TecnicoMkt> TecnicosMkt { get; set; }
  72. public virtual ICollection<InteressadosMkt> InteressadosMkt { get; set; }
  73. public virtual ICollection<Gestores> Gestores { get; set; }
  74. public virtual ICollection<ControleChaves> ControleChaves { get; set; }
  75. public virtual ICollection<Documento> Documentos { get; set; }
  76. }
Add Comment
Please, Sign In to add comment