Imports System.Linq.Expressions Imports System.Net.Http Imports System.Net.Http.Headers Imports Newtonsoft.Json Imports WebIntranet.ClasesDatosAdmin Imports Serialize.Linq.Serializers Imports Serialize.Linq.Expressions Imports Serialize.Linq.Interfaces Imports Serialize.Linq.Factories Public Class VidaAdministrativa Inherits System.Web.UI.Page Protected Async Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim vidaAdministrativaItems As New List(Of VIDA_ADMINISTRATIVA) Dim TiposActos As New List(Of TIPOAPTOSADMINISTRATIVOS) Dim token As String = Session("token") Dim client As New HttpClient() client.DefaultRequestHeaders.Authorization = New AuthenticationHeaderValue("Bearer", token) client.BaseAddress = New Uri(ConfigurationManager.AppSettings("SwaggerVB")) Dim idPers = Session("persona").Personas(0).idPersona Dim response = Await client.GetAsync("/api/VIDA_ADMINISTRATIVA/vidaspersona/" + idPers.ToString) If response.IsSuccessStatusCode Then Dim resultContent = Await response.Content.ReadAsStringAsync() vidaAdministrativaItems = If(JsonConvert.DeserializeObject(Of List(Of VIDA_ADMINISTRATIVA))(resultContent), New List(Of VIDA_ADMINISTRATIVA)()) vidaAdministrativaItems = vidaAdministrativaItems.OrderByDescending(Function(x) x.FECHA).ThenBy(Function(x) x.NUM_REG).ThenBy(Function(x) x.IDMOTIVONavigation?.IDTIPOAPTOSNavigation?.DESCRIPCION).ToList() Else Console.WriteLine($"Error al cargar Vida Administrativa: {response.StatusCode}") End If Dim TiApAd = Await client.GetAsync("/api/TIPOAPTOSADMINISTRATIVOS") Dim TiApAdContent = Await TiApAd.Content.ReadAsStringAsync() If TiApAd.IsSuccessStatusCode Then TiposActos = If(JsonConvert.DeserializeObject(Of List(Of TIPOAPTOSADMINISTRATIVOS))(TiApAdContent), New List(Of TIPOAPTOSADMINISTRATIVOS)()) End If TiposActos = If(TiposActos?.OrderBy(Function(x) x.DESCRIPCION).ToList(), New List(Of TIPOAPTOSADMINISTRATIVOS)()) Dim htmlTabla = "" If vidaAdministrativaItems.Count > 0 Then htmlTabla += "
| Tiene documentos | " + "Actos administrativos | " + "Departamento | " + "Causa | " + "Observaciones | " + "Descripción | " + "Fecha efecto | " + "Fecha resolución | " + "Caracter ocupación |
|---|---|---|---|---|---|---|---|---|
| " + If(itm.TIENELINEAS = True, "", "") + " | " htmlTabla += "" + "" + descActo + " | " htmlTabla += "" + If(itm.IDPUESTONavigation?.IDRPTDESNavigation?.IDDEPARTAMENTONavigation?.DESCRIPCION IsNot Nothing, itm.IDPUESTONavigation?.IDRPTDESNavigation?.IDDEPARTAMENTONavigation?.DESCRIPCION, "") + " | " htmlTabla += "" htmlTabla += " | " + If(itm.OBSERVACIONES IsNot Nothing, itm.OBSERVACIONES, "") + " | " htmlTabla += "" htmlTabla += " | " + If(itm.FECHA IsNot Nothing, itm.FECHA.ToString.Substring(0, 10), "") + " | " htmlTabla += "" + If(itm.FECHARESOLUCION IsNot Nothing, itm.FECHARESOLUCION.ToString.Substring(0, 10), "") + " | " htmlTabla += "" + If(itm.OCUPACION_OLDNavigation?.DESCRIPCION IsNot Nothing, itm.OCUPACION_OLDNavigation.DESCRIPCION, "") + " |
No se han encontrado resultados
" End If divTabla.InnerHtml = htmlTabla End Sub Private Function CustomTypeResolver(typeName As String) As FactorySettings If typeName <> "Microsoft.VisualBasic.CompilerServices.Operators" Then Return Nothing End If Return Nothing End Function 'Private Function genrarlink(idvida As Integer, idpersonas As Integer) As String 'End Function End Class Public Class CustomTypeResolver Public Function Resolve(typeName As String) As Type If typeName = "Microsoft.VisualBasic.CompilerServices.Operators" Then Return Nothing End If Return Type.GetType(typeName) End Function End Class