-- unificación de globalDTs
This commit is contained in:
141
Ashx/SIGWeb.ashx
141
Ashx/SIGWeb.ashx
@@ -555,7 +555,6 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
||||
sr.Close()
|
||||
Catch ex As Exception
|
||||
ex.ToString().GuardaLog()
|
||||
'Extenciones.ApplicationParameter.GuardaLogEx(ex, $"SOAPAction : {SOAPAction} XML : {xml}")
|
||||
End Try
|
||||
|
||||
Return resultado
|
||||
@@ -768,23 +767,8 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
||||
Else
|
||||
CveEmpresa = usuario.CveEmpresa
|
||||
Dim Name = IfNull(context.Request("Name"), "-1").ToString
|
||||
Dim AppNombre As String = String.Format("GlobalDTCliente-{0}", CveEmpresa)
|
||||
'sino existe, recarga los datos
|
||||
If context.Application(AppNombre) Is Nothing Then
|
||||
Dim ObjClientes As New ClsClientes
|
||||
If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa, Estatus:=-1, CveClienteClasificacion:=cveclienteclasificacion) Then
|
||||
context.Application(AppNombre) = ObjClientes.DtResultados
|
||||
End If
|
||||
ObjClientes.Dispose()
|
||||
End If
|
||||
|
||||
'Dim ObjClientes As New ClsClientes
|
||||
'If ObjClientes.GetClientes(-1, Name, "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa, Estatus:=-1) Then
|
||||
' DtRetorno = ObjClientes.DtResultados
|
||||
'End If
|
||||
'ObjClientes.Dispose()
|
||||
|
||||
Dim dt As DataTable = DirectCast(context.Application(AppNombre), DataTable) '.FiltraParametros(String.Format("CveEmpresa = {0}", CveEmpresa))
|
||||
Dim dt As DataTable = ClsPaginas.GlobalDTCliente(CveEmpresa)
|
||||
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
|
||||
If EsDistribuidor <> -1 Then
|
||||
dt = dt.FiltraParametros(String.Format("EsDistribuidor = {0} ", CBool(EsDistribuidor)))
|
||||
@@ -832,22 +816,8 @@ 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)
|
||||
'sino existe, recarga los datos
|
||||
If context.Application(AppNombre) Is Nothing Then
|
||||
Dim ObjProveedores As New ClsCompProveedores
|
||||
If ObjProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaGlobalDT, -1, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa) Then
|
||||
context.Application(AppNombre) = ObjProveedores.DtResultados
|
||||
End If
|
||||
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))
|
||||
Dim dt As DataTable = ClsPaginas.GlobalDTCompProveedores(CveEmpresa)
|
||||
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
|
||||
DtRetorno = dt.FiltraParametros(String.Format("NombreCortoProveedor like '%{0}%'", Name))
|
||||
End If
|
||||
@@ -1000,17 +970,17 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
||||
|
||||
If UsaGlobal Then
|
||||
'se recarga el global, y el clspaginas, son los unicos 2 lugares
|
||||
Dim AppNombre As String = String.Format("GlobalDTPSSimplificado-{0}", CveEmpresa)
|
||||
If context.Application(String.Format("GlobalDTPSSimplificado-{0}", CveEmpresa)) Is Nothing Then
|
||||
Dim ObjPS As New ClsProductosServicios
|
||||
If ObjPS.GetPSSimplificado(CveEmpresa) Then context.Application(AppNombre) = ObjPS.DtResultados.AsEnumerable()
|
||||
ObjPS.Dispose()
|
||||
'Dim AppNombre As String = String.Format("GlobalDTPSSimplificado-{0}", CveEmpresa)
|
||||
'If context.Application(String.Format("GlobalDTPSSimplificado-{0}", CveEmpresa)) Is Nothing Then
|
||||
' Dim ObjPS As New ClsProductosServicios
|
||||
' If ObjPS.GetPSSimplificado(CveEmpresa) Then context.Application(AppNombre) = ObjPS.DtResultados.AsEnumerable()
|
||||
' ObjPS.Dispose()
|
||||
|
||||
End If
|
||||
'End If
|
||||
|
||||
|
||||
Dim DTPS = DirectCast(context.Application(AppNombre), EnumerableRowCollection(Of DataRow))
|
||||
'Dim DTPS = ClsPaginas.GlobalDTPSSimplificado(CveEmpresa).AsEnumerable
|
||||
'Dim DTPS = DirectCast(context.Application(AppNombre), EnumerableRowCollection(Of DataRow))
|
||||
Dim DTPS = ClsPaginas.GlobalDTPSSimplificado(CveEmpresa).AsEnumerable
|
||||
|
||||
If DTPS IsNot Nothing Then
|
||||
|
||||
@@ -1078,10 +1048,6 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
||||
DTPS = Nothing
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
If (usuario.TienePermisoProceso(300) Or usuario.TienePermisoProceso(301)) And (DtPSRetorno IsNot Nothing AndAlso DtPSRetorno.Rows.Count > 0) Then
|
||||
|
||||
Dim ObjClasificaciones As New ClsClasificaciones()
|
||||
@@ -1129,11 +1095,8 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
If DtPSRetorno IsNot Nothing AndAlso DtPSRetorno.Rows.Count > 0 Then
|
||||
|
||||
|
||||
DtPSRetorno.Columns("CvePS").ColumnName = "id"
|
||||
DtPSRetorno.Columns(PSCodigoDescripcion).ColumnName = "text"
|
||||
If PSCodigoDescripcion = "PSCodigo" Then
|
||||
@@ -1156,16 +1119,12 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable
|
||||
Get
|
||||
Return False
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
#Region "Funciones"
|
||||
Public Function GetJson(ByVal dt As DataTable) As String
|
||||
Dim Retorno As String = ""
|
||||
@@ -1198,15 +1157,10 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
||||
Private Function GETPSSAT(ByVal context As HttpContext) As String
|
||||
Dim retorno As String = ""
|
||||
|
||||
'Dim DTPS = DirectCast(context.Application("GlobalDTPSATPS"), EnumerableRowCollection(Of DataRow))
|
||||
Dim DtPSRetorno As DataTable
|
||||
|
||||
Dim Name = IfNull(context.Request("Name"), "-1").ToString
|
||||
|
||||
'If Name <> "-1" Then
|
||||
' DTPS = DTPS.Where((Function(a) a!SATClaveProductoServicio.ToString.ToLower Like ($"*{Name.ToLower}*")))
|
||||
'End If
|
||||
|
||||
'DtPSRetorno = New DataView(DTPS.OrderBy(Function(a) a!SATClavePS).CopyToDataTable).ToTable(True, {"CveSATPS", "SATClaveProductoServicio"})
|
||||
DtPSRetorno = ClsPaginas.GlobalDTPSATPS(Name.ToLower)
|
||||
If DtPSRetorno IsNot Nothing AndAlso DtPSRetorno.Rows.Count > 0 Then
|
||||
@@ -1232,7 +1186,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
||||
Private Function GETUMSAT(ByVal context As HttpContext) As String
|
||||
Dim retorno As String = ""
|
||||
|
||||
Dim DTUM = ClsPaginas.GlobalDTPSATUM 'DirectCast(context.Application("GlobalDTPSATUM"), EnumerableRowCollection(Of DataRow))
|
||||
Dim DTUM = ClsPaginas.GlobalDTPSATUM
|
||||
Dim DtPSRetorno As DataTable
|
||||
|
||||
Dim Name = IfNull(context.Request("Name"), "-1").ToString
|
||||
@@ -1459,22 +1413,8 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
||||
Else
|
||||
CveEmpresa = usuario.CveEmpresa
|
||||
Dim Name = IfNull(context.Request("Name"), "-1").ToString
|
||||
Dim AppNombre As String = String.Format("GlobalDTRHPersonal-{0}", CveEmpresa)
|
||||
'sino existe, recarga los datos
|
||||
If context.Application(AppNombre) Is Nothing Then
|
||||
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
|
||||
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}")
|
||||
Dim dt As DataTable = ClsPaginas.GlobalDTRHPersonal(CveEmpresa)
|
||||
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
|
||||
DtRetorno = dt.FiltraParametros($"NombreCompleto like '%{Name}%'")
|
||||
End If
|
||||
@@ -1540,56 +1480,9 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
||||
'xmlCFDI.comprobante.xmlns_cfdi = xtr.Value
|
||||
Case "XMLNS:XSI"
|
||||
'xmlCFDI.comprobante.xmlns_xsi = xtr.Value
|
||||
'Case "XSI:SCHEMALOCATION"
|
||||
' xmlCFDI.comprobante.xsi_schemaLocation = xtr.Value
|
||||
'Case "VERSION"
|
||||
' xmlCFDI.comprobante.Version = xtr.Value
|
||||
'Case "SERIE"
|
||||
' xmlCFDI.comprobante.Serie = xtr.Value
|
||||
'Case "FOLIO"
|
||||
' xmlCFDI.comprobante.Folio = xtr.Value
|
||||
Case "FECHA"
|
||||
fecha = xtr.Value
|
||||
'Case "MONEDA"
|
||||
' xmlCFDI.comprobante.Moneda = xtr.Value
|
||||
'Case "SUBTOTAL"
|
||||
' Dim SubTotal As Decimal = 0
|
||||
' Decimal.TryParse(xtr.Value, SubTotal)
|
||||
' xmlCFDI.comprobante.SubTotal = SubTotal
|
||||
'Case "TOTAL"
|
||||
' Dim Total As Decimal = 0
|
||||
' Decimal.TryParse(xtr.Value, Total)
|
||||
' xmlCFDI.comprobante.Total = Total
|
||||
'Case "DESCUENTO"
|
||||
' Dim Descuento As Decimal = 0
|
||||
' Decimal.TryParse(xtr.Value, Descuento)
|
||||
' xmlCFDI.comprobante.Descuento = Descuento
|
||||
'Case "TIPOCAMBIO"
|
||||
' Dim TipoCambio As Decimal = 0
|
||||
' Decimal.TryParse(xtr.Value, TipoCambio)
|
||||
' xmlCFDI.comprobante.TipoCambio = TipoCambio
|
||||
'Case "TIPODECOMPROBANTE"
|
||||
' xmlCFDI.comprobante.TipoDeComprobante = xtr.Value
|
||||
'Case "FORMAPAGO"
|
||||
' xmlCFDI.comprobante.FormaPago = xtr.Value
|
||||
'Case "FORMADEPAGO"
|
||||
' xmlCFDI.comprobante.FormaPago = xtr.Value
|
||||
'Case "METODOPAGO"
|
||||
' xmlCFDI.comprobante.MetodoPago = xtr.Value
|
||||
'Case "METODODEPAGO"
|
||||
' xmlCFDI.comprobante.MetodoPago = xtr.Value
|
||||
'Case "CONDICIONESDEPAGO"
|
||||
' xmlCFDI.comprobante.CondicionesDePago = xtr.Value
|
||||
'Case "LUGAREXPEDICION"
|
||||
' xmlCFDI.comprobante.LugarExpedicion = xtr.Value
|
||||
'Case "CONFIRMACION"
|
||||
' xmlCFDI.comprobante.Confirmacion = xtr.Value
|
||||
'Case "NOCERTIFICADO"
|
||||
' xmlCFDI.comprobante.NoCertificado = xtr.Value
|
||||
'Case "SELLO"
|
||||
' xmlCFDI.comprobante.Sello = xtr.Value
|
||||
'Case "CERTIFICADO"
|
||||
' xmlCFDI.comprobante.Certificado = xtr.Value
|
||||
|
||||
End Select
|
||||
|
||||
cont = xtr.MoveToNextAttribute()
|
||||
@@ -1663,17 +1556,13 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
||||
Private Function getSATColonias(ByVal context As HttpContext) As String
|
||||
Dim retorno As String = ""
|
||||
Dim DtRetorno As DataTable = Nothing
|
||||
|
||||
|
||||
Dim Name = IfNull(context.Request("Name"), "-1").ToString
|
||||
|
||||
|
||||
Dim dt As DataTable = DirectCast(context.Application("GlobalDTColonia"), DataTable)
|
||||
Dim dt As DataTable = ClsPaginas.GlobalDTGralColonias("-1", "-1", "-1")
|
||||
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
|
||||
DtRetorno = dt.FiltraParametros($"ClaveSATColoniaCP like '%{Name}%'")
|
||||
End If
|
||||
|
||||
|
||||
If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then
|
||||
DtRetorno.Columns("CveColonia").ColumnName = "id"
|
||||
DtRetorno.Columns("ClaveSATColoniaCP").ColumnName = "text"
|
||||
@@ -1701,7 +1590,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
||||
CveEmpresa = usuario.CveEmpresa
|
||||
Dim Name = IfNull(context.Request("Name"), "-1").ToString
|
||||
|
||||
Dim dt As DataTable = DirectCast(context.Application("GlobalDTContratos"), DataTable).FiltraParametros(String.Format("CveEmpresa = {0}", CveEmpresa))
|
||||
Dim dt As DataTable = ClsPaginas.GlobalDTContratos(CveEmpresa)
|
||||
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
|
||||
DtRetorno = dt.FiltraParametros(String.Format("NumeroContrato like '%{0}%'", Name))
|
||||
End If
|
||||
|
||||
Reference in New Issue
Block a user