-getpersonal ashx

This commit is contained in:
2020-01-23 12:35:21 -07:00
parent c4321a2832
commit ada9cbb203
3 changed files with 41 additions and 28 deletions

View File

@@ -701,14 +701,14 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
Else
CveEmpresa = usuario.CveEmpresa
Dim Name = IfNull(context.Request("Name"), "-1").ToString
Dim AppNombre As String = String.Format("GlobalDTCompProveedores{0}", CveEmpresa)
Dim AppNombre As String = String.Format("GlobalDTRHPersonal{0}", CveEmpresa)
'sino existe, recarga los datos
If context.Application(AppNombre) Is Nothing Then
Dim ObjProveedores As New ClsRH
If ObjProveedores.GetPersonal(-1, "-1", "-1", "-1", "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, usuario.CveEmpresa) Then
context.Application(AppNombre) = ObjProveedores.DtResultados
Dim ObjPersonal As New ClsRH
If ObjPersonal.GetPersonal(-1, "-1", "-1", "-1", "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, CveEmpresa) Then
context.Application(AppNombre) = ObjPersonal.DtResultados
End If
ObjProveedores.Dispose()
ObjPersonal.Dispose()
End If
'Dim ObjProveedores As New ClsCompProveedores
@@ -718,13 +718,13 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
'ObjProveedores.Dispose()
Dim dt As DataTable = DirectCast(context.Application(AppNombre), DataTable).FiltraParametros($"CveEmpresa = {CveEmpresa}")
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
DtRetorno = dt.FiltraParametros($"Nombre like '%{Name}%'")
DtRetorno = dt.FiltraParametros($"NombreCompleto like '%{Name}%'")
End If
End If
If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then
DtRetorno.Columns("CvePersonal").ColumnName = "id"
DtRetorno.Columns("Nombre").ColumnName = "text"
DtRetorno.Columns("NombreCompleto").ColumnName = "text"
retorno = JsonConvert.SerializeObject(DtRetorno).ToString
context.Response.Write(retorno)
Else