-- mejora en globalDT

This commit is contained in:
2023-01-25 17:58:04 -07:00
parent d602e1a897
commit 3a44a2adb5
2 changed files with 26 additions and 42 deletions

View File

@@ -373,35 +373,35 @@ Public Class ClsPaginas
End Set
End Property
Property GlobalDTFraccionArancelaria() As DataTable
Public Shared Property GlobalDTFraccionArancelaria() As EnumerableRowCollection(Of DataRow)
Get
Dim AppNombre As String = "GlobalDTFraccionArancelaria"
If DirectCast(Application(AppNombre), DataTable) Is Nothing Then
If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then
Dim ObjGrales As New ClsGenerales
If ObjGrales.GetSATFraccionArancelaria() Then Application(AppNombre) = ObjGrales.DtResultados.AsEnumerable()
If ObjGrales.GetSATFraccionArancelaria() Then HttpContext.Current.Application(AppNombre) = ObjGrales.DtResultados.AsEnumerable()
ObjGrales.Dispose()
End If
GlobalDTFraccionArancelaria = DirectCast(Application(AppNombre), EnumerableRowCollection(Of DataRow)).CopyToDataTable
GlobalDTFraccionArancelaria = DirectCast(HttpContext.Current.Application(AppNombre), EnumerableRowCollection(Of DataRow))
End Get
Set(value As DataTable)
Set(value As EnumerableRowCollection(Of DataRow))
Dim AppNombre As String = "GlobalDTFraccionArancelaria"
Application(AppNombre) = value
HttpContext.Current.Application(AppNombre) = value
End Set
End Property
Property GlobalDTIncoterm() As DataTable
Public Shared Property GlobalDTIncoterm() As DataTable
Get
Dim AppNombre As String = "GlobalDTIncoterm"
If DirectCast(Application(AppNombre), DataTable) Is Nothing Then
If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then
Dim ObjGrales As New ClsGenerales
If ObjGrales.GetSATIncoterm() Then Application(AppNombre) = ObjGrales.DtResultados
If ObjGrales.GetSATIncoterm() Then HttpContext.Current.Application(AppNombre) = ObjGrales.DtResultados
ObjGrales.Dispose()
End If
GlobalDTIncoterm = DirectCast(Application(AppNombre), DataTable)
GlobalDTIncoterm = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End Get
Set(value As DataTable)
Dim AppNombre As String = "GlobalDTIncoterm"
Application(AppNombre) = value
HttpContext.Current.Application(AppNombre) = value
End Set
End Property
@@ -816,57 +816,55 @@ Public Class ClsPaginas
End Property
#Region "C A R T A P O R T E "
Property GlobalDTMaterialPeligroso(Optional CveMaterialPeligroso As Integer = -1) As DataTable
Public Shared Property GlobalDTMaterialPeligroso(Optional CveMaterialPeligroso As Integer = -1) As DataTable
Get
Dim AppNombre As String = "GlobalDTMaterialPeligroso"
'sino existe, recarga los datos
If Application(AppNombre) Is Nothing Then
If HttpContext.Current.Application(AppNombre) Is Nothing Then
Dim Obj As New ClsGenerales
If Obj.GetMaterialPeligroso() Then Application(AppNombre) = Obj.DtResultados
If Obj.GetMaterialPeligroso() Then HttpContext.Current.Application(AppNombre) = Obj.DtResultados
Obj.Dispose()
End If
If CveMaterialPeligroso > 0 Then
Dim Str As New StringBuilder
Str.AppendFormat("CveMaterialPeligroso = {0}", CveMaterialPeligroso)
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows)
GlobalDTMaterialPeligroso = Dv.ToTable
Dv.Dispose()
Else
GlobalDTMaterialPeligroso = DirectCast(Application(AppNombre), DataTable)
GlobalDTMaterialPeligroso = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End If
End Get
Set(value As DataTable)
Dim AppNombre As String = "GlobalDTMaterialPeligroso"
Application(AppNombre) = value
HttpContext.Current.Application(AppNombre) = value
End Set
End Property
Property GlobalDTEmbalajes(Optional CveEmbalaje As Integer = -1) As DataTable
Public Shared Property GlobalDTEmbalajes(Optional CveEmbalaje As Integer = -1) As DataTable
Get
Dim AppNombre As String = "GlobalDTEmbalajes"
'sino existe, recarga los datos
If Application(AppNombre) Is Nothing Then
If HttpContext.Current.Application(AppNombre) Is Nothing Then
Dim Obj As New ClsGenerales
If Obj.GetEmbalajes() Then Application(AppNombre) = Obj.DtResultados
If Obj.GetEmbalajes() Then HttpContext.Current.Application(AppNombre) = Obj.DtResultados
Obj.Dispose()
End If
If CveEmbalaje > 0 Then
Dim Str As New StringBuilder
Str.AppendFormat("CveEmbalaje = {0}", CveEmbalaje)
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows)
GlobalDTEmbalajes = Dv.ToTable
Dv.Dispose()
Else
GlobalDTEmbalajes = DirectCast(Application(AppNombre), DataTable)
GlobalDTEmbalajes = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End If
End Get
Set(value As DataTable)
Dim AppNombre As String = "GlobalDTEmbalajes"
Application(AppNombre) = value
HttpContext.Current.Application(AppNombre) = value
End Set
End Property
#End Region

View File

@@ -1271,14 +1271,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
Private Function GETSATMaterialPeligroso(ByVal context As HttpContext) As String
Dim retorno As String = ""
If context.Application("GlobalDTMaterialPeligroso") Is Nothing Then
Dim ObjGrales As New ClsGenerales
If ObjGrales.GetMaterialPeligroso Then context.Application("GlobalDTMaterialPeligroso") = ObjGrales.DtResultados Else context.Application("GlobalDTMaterialPeligroso") = Nothing
ObjGrales.Dispose()
End If
Dim DTUM = DirectCast(context.Application("GlobalDTMaterialPeligroso"), DataTable).AsEnumerable
Dim DTUM = DirectCast(ClsPaginas.GlobalDTMaterialPeligroso, DataTable).AsEnumerable
Dim DtPSRetorno As DataTable
Dim Name = IfNull(context.Request("Name"), "-1").ToString
@@ -1308,14 +1301,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
Private Function GETSATEmbalajes(ByVal context As HttpContext) As String
Dim retorno As String = ""
If context.Application("GlobalDTEmbalajes") Is Nothing Then
Dim ObjGrales As New ClsGenerales
If ObjGrales.GetEmbalajes Then context.Application("GlobalDTEmbalajes") = ObjGrales.DtResultados Else context.Application("GlobalDTEmbalajes") = Nothing
ObjGrales.Dispose()
End If
Dim DTUM = DirectCast(context.Application("GlobalDTEmbalajes"), DataTable).AsEnumerable
Dim DTUM = DirectCast(ClsPaginas.GlobalDTEmbalajes, DataTable).AsEnumerable
Dim DtPSRetorno As DataTable
Dim Name = IfNull(context.Request("Name"), "-1").ToString
@@ -1349,7 +1335,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
Private Function GetFraccionArancelaria(ByVal context As HttpContext) As String
Dim retorno As String = ""
Dim DT = DirectCast(context.Application("GlobalDTFraccionArancelaria"), EnumerableRowCollection(Of DataRow))
Dim DT = ClsPaginas.GlobalDTFraccionArancelaria
Dim DtRetorno As DataTable
Dim Name = IfNull(context.Request("Name"), "-1").ToString