se agregto getcuentas contables, y limpieza de columnas que regresan
This commit is contained in:
@@ -70,6 +70,8 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
|||||||
ActualizaPrePoliza(context)
|
ActualizaPrePoliza(context)
|
||||||
Case "getpersonal"
|
Case "getpersonal"
|
||||||
getpersonal(context)
|
getpersonal(context)
|
||||||
|
Case "getcuentascontables"
|
||||||
|
GetCuentasContables(context)
|
||||||
Case "getcontratos"
|
Case "getcontratos"
|
||||||
GetContratos(context)
|
GetContratos(context)
|
||||||
Case "GettingCURP"
|
Case "GettingCURP"
|
||||||
@@ -558,6 +560,15 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then
|
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("CveCliente").ColumnName = "id"
|
||||||
DtRetorno.Columns(ColumnaNombre).ColumnName = "text"
|
DtRetorno.Columns(ColumnaNombre).ColumnName = "text"
|
||||||
retorno = JsonConvert.SerializeObject(DtRetorno).ToString
|
retorno = JsonConvert.SerializeObject(DtRetorno).ToString
|
||||||
@@ -593,11 +604,6 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
|||||||
ObjProveedores.Dispose()
|
ObjProveedores.Dispose()
|
||||||
End If
|
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))
|
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
|
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
|
||||||
DtRetorno = dt.FiltraParametros(String.Format("NombreCortoProveedor like '%{0}%'", Name))
|
DtRetorno = dt.FiltraParametros(String.Format("NombreCortoProveedor like '%{0}%'", Name))
|
||||||
@@ -606,14 +612,24 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then
|
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("CveProveedor").ColumnName = "id"
|
||||||
DtRetorno.Columns("NombreCortoProveedor").ColumnName = "text"
|
DtRetorno.Columns("NombreCortoProveedor").ColumnName = "text"
|
||||||
retorno = JsonConvert.SerializeObject(DtRetorno).ToString
|
retorno = JsonConvert.SerializeObject(DtRetorno).ToString
|
||||||
context.Response.Write(retorno)
|
context.Response.Write(retorno)
|
||||||
|
DtRetorno.Dispose()
|
||||||
Else
|
Else
|
||||||
context.Response.Write("[]")
|
context.Response.Write("[]")
|
||||||
End If
|
End If
|
||||||
DtRetorno.Dispose()
|
|
||||||
Return retorno
|
Return retorno
|
||||||
End Function
|
End Function
|
||||||
#End Region
|
#End Region
|
||||||
@@ -1147,11 +1163,6 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
|||||||
ObjPersonal.Dispose()
|
ObjPersonal.Dispose()
|
||||||
End If
|
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}")
|
Dim dt As DataTable = DirectCast(context.Application(AppNombre), DataTable).FiltraParametros($"CveEmpresa = {CveEmpresa}")
|
||||||
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
|
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
|
||||||
DtRetorno = dt.FiltraParametros($"NombreCompleto like '%{Name}%'")
|
DtRetorno = dt.FiltraParametros($"NombreCompleto like '%{Name}%'")
|
||||||
@@ -1159,6 +1170,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then
|
If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then
|
||||||
|
|
||||||
DtRetorno.Columns("CvePersonal").ColumnName = "id"
|
DtRetorno.Columns("CvePersonal").ColumnName = "id"
|
||||||
DtRetorno.Columns("NombreCompleto").ColumnName = "text"
|
DtRetorno.Columns("NombreCompleto").ColumnName = "text"
|
||||||
retorno = JsonConvert.SerializeObject(DtRetorno).ToString
|
retorno = JsonConvert.SerializeObject(DtRetorno).ToString
|
||||||
@@ -1205,4 +1217,47 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
|||||||
Return retorno
|
Return retorno
|
||||||
End Function
|
End Function
|
||||||
#End Region
|
#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
|
End Class
|
||||||
Reference in New Issue
Block a user