This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2021-06-09 19:11:34 -07:00
26 changed files with 833 additions and 402 deletions

View File

@@ -92,6 +92,8 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
ActualizaPrePoliza(context)
Case "getpersonal"
getpersonal(context)
Case "getcuentascontables"
GetCuentasContables(context)
Case "getcontratos"
GetContratos(context)
Case "GettingCURP"
@@ -580,6 +582,15 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
End If
If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then
'Dim i As Integer = 0 'limpieza de columnas
'While i < DtRetorno.Columns.Count
' If Not DtRetorno.Columns(i).ColumnName.Contiene("CveProveedor", "NombreCortoProveedor") Then
' DtRetorno.Columns.RemoveAt(i)
' Else
' i = i + 1
' End If
'End While
DtRetorno.Columns("CveCliente").ColumnName = "id"
DtRetorno.Columns(ColumnaNombre).ColumnName = "text"
retorno = JsonConvert.SerializeObject(DtRetorno).ToString
@@ -615,11 +626,6 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
ObjProveedores.Dispose()
End If
'Dim ObjProveedores As New ClsCompProveedores
'If ObjProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, -1, "-1", Name, "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa) Then
' DtRetorno = ObjProveedores.DtResultados
'End If
'ObjProveedores.Dispose()
Dim dt As DataTable = DirectCast(context.Application(AppNombre), DataTable) '.FiltraParametros(String.Format("CveEmpresa = {0}", CveEmpresa))
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
DtRetorno = dt.FiltraParametros(String.Format("NombreCortoProveedor like '%{0}%'", Name))
@@ -628,14 +634,24 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
End If
If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then
Dim i As Integer = 0 'limpieza de columnas
While i < DtRetorno.Columns.Count
If Not DtRetorno.Columns(i).ColumnName.Contiene("CveProveedor", "NombreCortoProveedor") Then
DtRetorno.Columns.RemoveAt(i)
Else
i = i + 1
End If
End While
DtRetorno.Columns("CveProveedor").ColumnName = "id"
DtRetorno.Columns("NombreCortoProveedor").ColumnName = "text"
retorno = JsonConvert.SerializeObject(DtRetorno).ToString
context.Response.Write(retorno)
DtRetorno.Dispose()
Else
context.Response.Write("[]")
End If
DtRetorno.Dispose()
Return retorno
End Function
#End Region
@@ -1169,11 +1185,6 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
ObjPersonal.Dispose()
End If
'Dim ObjProveedores As New ClsCompProveedores
'If ObjProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, -1, "-1", Name, "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa) Then
' DtRetorno = ObjProveedores.DtResultados
'End If
'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($"NombreCompleto like '%{Name}%'")
@@ -1181,6 +1192,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
End If
If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then
DtRetorno.Columns("CvePersonal").ColumnName = "id"
DtRetorno.Columns("NombreCompleto").ColumnName = "text"
retorno = JsonConvert.SerializeObject(DtRetorno).ToString
@@ -1227,4 +1239,47 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
Return retorno
End Function
#End Region
#Region "Get Cuentas"
Private Function GetCuentasContables(ByVal context As HttpContext) As String
Dim retorno As String = ""
Dim DtRetorno As DataTable = Nothing
Dim usuario As Usuario = UsuarioActual(context)
Dim CveEmpresa As String
If IsNothing(usuario) Then
context.Response.Write("")
Else
CveEmpresa = usuario.CveEmpresa
Dim Name = IfNull(context.Request("Name"), "-1").ToString
Dim ObjConta As New ClsContabilidad
If ObjConta.GetCuentas(-1, "-1", 1, CveEmpresa, Nombre:=Name) Then
DtRetorno = ObjConta.DtResultados
End If
ObjConta.Dispose()
End If
If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then
Dim i As Integer = 0 'limpieza de columnas
While i < DtRetorno.Columns.Count
If Not DtRetorno.Columns(i).ColumnName.Contiene("CveCuenta", "CtaCodigo") Then
DtRetorno.Columns.RemoveAt(i)
Else
i = i + 1
End If
End While
DtRetorno.Columns("CveCuenta").ColumnName = "id"
DtRetorno.Columns("CtaCodigo").ColumnName = "text"
retorno = JsonConvert.SerializeObject(DtRetorno).ToString
context.Response.Write(retorno)
Else
context.Response.Write("[]")
End If
DtRetorno.Dispose()
Return retorno
End Function
#End Region
End Class