Funcionalidad 706, en ventas y estados financieros

This commit is contained in:
2022-10-18 22:59:33 -07:00
parent c3f6d1aea2
commit f4cf802cf0
12 changed files with 1437 additions and 1394 deletions

View File

@@ -1,5 +1,5 @@
<%@ WebHandler Language="VB" Class="SIGFacturacion" %>
<%@ WebHandler Language="VB" Class="SIGFacturacion" %>
Imports System
Imports System.Web
Imports System.Net.Http
@@ -11,62 +11,62 @@ Imports Extensiones
Imports System.IO
Imports Modelos
Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
Private Property CveEmpresaFacturar As Integer = 143
Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
context.Response.ContentType = "text/plain"
context.Response.ContentType = "text/plain"
Dim Retorno As Boolean = False
Try
'If context.Request.InputStream IsNot Nothing Then
' Using reader As New StreamReader(context.Request.InputStream)
' Dim json = reader.ReadToEnd
' If Not String.IsNullOrEmpty(json) Then
' Dim JsonRequest As JObject = JObject.Parse(json)
' If JsonRequest IsNot Nothing Then
' Dim Metodo = JsonRequest("Metodo").ToString()
' If Metodo = "FactMasivaRemisiones" Then
' Dim pCveEmpresa = JsonRequest("CveEmpresa").ToString()
' Dim pFechaI As String = ""
' Dim pFechaF As String = ""
' If JsonRequest("FechaI") IsNot Nothing AndAlso JsonRequest("FechaF") IsNot Nothing Then
' pFechaI = JsonRequest("FechaI")
' pFechaF = JsonRequest("FechaF")
' End If
' IniciaFacturacionMasiva(context, CveEmpresaFacturar, pFechaI, pFechaF)
' End If
' End If
' End If
' End Using
'End If
Dim Metodo = If(context.Request("Metodo") = Nothing, "", context.Request("Metodo").ToString())
If Metodo = "FactMasivaRemisiones" Then
Dim pFechaI As String = ""
Dim pFechaF As String = ""
If context.Request("FechaI") IsNot Nothing AndAlso context.Request("FechaF") IsNot Nothing Then
pFechaI = context.Request("FechaI")
pFechaF = context.Request("FechaF")
End If
Retorno = IniciaFacturacionMasiva(CveEmpresaFacturar, pFechaI, pFechaF)
Try
'If context.Request.InputStream IsNot Nothing Then
' Using reader As New StreamReader(context.Request.InputStream)
' Dim json = reader.ReadToEnd
' If Not String.IsNullOrEmpty(json) Then
' Dim JsonRequest As JObject = JObject.Parse(json)
' If JsonRequest IsNot Nothing Then
' Dim Metodo = JsonRequest("Metodo").ToString()
' If Metodo = "FactMasivaRemisiones" Then
' Dim pCveEmpresa = JsonRequest("CveEmpresa").ToString()
' Dim pFechaI As String = ""
' Dim pFechaF As String = ""
' If JsonRequest("FechaI") IsNot Nothing AndAlso JsonRequest("FechaF") IsNot Nothing Then
' pFechaI = JsonRequest("FechaI")
' pFechaF = JsonRequest("FechaF")
' End If
' IniciaFacturacionMasiva(context, CveEmpresaFacturar, pFechaI, pFechaF)
' End If
' End If
' End If
' End Using
'End If
Dim Metodo = If(context.Request("Metodo") = Nothing, "", context.Request("Metodo").ToString())
If Metodo = "FactMasivaRemisiones" Then
Dim pFechaI As String = ""
Dim pFechaF As String = ""
If context.Request("FechaI") IsNot Nothing AndAlso context.Request("FechaF") IsNot Nothing Then
pFechaI = context.Request("FechaI")
pFechaF = context.Request("FechaF")
End If
Retorno = IniciaFacturacionMasiva(CveEmpresaFacturar, pFechaI, pFechaF)
End If
Catch ex As Exception
ex.GuardaLog(ex.Message)
End Try
If Retorno Then
context.Response.Write("True")
Else
context.Response.Write("False")
End Try
If Retorno Then
context.Response.Write("True")
Else
context.Response.Write("False")
End If
End Sub
@@ -77,7 +77,7 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
End Get
End Property
Private Function IniciaFacturacionMasiva(pCveEmpresa As String, pFechaI As String, pFechaF As String) As Boolean
Private Function IniciaFacturacionMasiva(pCveEmpresa As String, pFechaI As String, pFechaF As String) As Boolean
Dim Retorno As Boolean = True
Dim JsonRetorno As New JObject()
Dim CveEmpresa As Integer = pCveEmpresa.ToEntero()
@@ -96,9 +96,9 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
FechaI = New DateTime(DomingoAnterior.Year, DomingoAnterior.Month, DomingoAnterior.Day, 0, 0, 0)
FechaF = New DateTime(Sabado.Year, Sabado.Month, Sabado.Day, 23, 59, 59)
JsonRetorno = EjecutarFacturacionMasiva(Usuario, FechaI, FechaF, Usuario.Empresa.FacturaProduccion)
Else
Retorno = False
JsonRetorno = EjecutarFacturacionMasiva(Usuario, FechaI, FechaF, Usuario.Empresa.FacturaProduccion)
Else
Retorno = False
GuardaLogFacturacion("Ejecución no permitida, no es el dia permitido para ejecucion o no se espeficaron las fechas")
End If
Else
@@ -107,11 +107,11 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
JsonRetorno = EjecutarFacturacionMasiva(Usuario, FechaI, FechaF, Usuario.Empresa.FacturaProduccion)
End If
End If
GuardaLogFacturacion("Ejecución Exitosa, se generaron las siguientes facturas:")
GuardaLogFacturacion(JsonRetorno.ToString())
End If
GuardaLogFacturacion("Ejecución Exitosa, se generaron las siguientes facturas:")
GuardaLogFacturacion(JsonRetorno.ToString())
Return Retorno
End Function
@@ -242,8 +242,8 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
json.Add(New JProperty("Almacen", ObsInv.ToString()))
Return json
End Function
End Function
#Region "V A L I D A - D A T O S"
Private Function ValidaUsuarioSistema(CveEmpresa As Integer) As Usuario
Dim UsuarioActual As Usuario = Nothing
@@ -277,8 +277,8 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
UsuarioActual.Empresa = ObjEmpresa.Empresa
End If
ObjEmpresa.Dispose()
End Sub
End Sub
#End Region
#Region "D E F I N I R - O B J E T O S"
Private Function CreaFactura(Resp As Modelos.Factura.MMensajeFactura, UsuarioActual As Usuario, DTRemisionesPS As DataTable, CveCliente As Integer, CveSubProyecto As Integer, CveMoneda As Integer, DatosRemisiones As JObject, FechaI As DateTime, FechaF As DateTime) As Modelos.Factura
@@ -780,7 +780,7 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
'RECARGAR GV
Return Row
End Function
End Function
#End Region
#Region "E N V I O - C O R R E O"
Private Sub EnviarCorreo(Objfactura As Modelos.Factura, UsuarioActual As Usuario)
@@ -924,9 +924,9 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
End If
End Try
End If
End Sub
End Sub
#End Region
Public Sub GuardaLogFacturacion(Str As String)
Dim ArchivoW As StreamWriter
Dim strLineaTMP As String
@@ -949,8 +949,8 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
ArchivoW.Close()
ArchivoW.Dispose()
End Sub
End Sub
#Region "G L O B A L - D T"
Public Property GlobalTipoCambio(Optional Fecha As Date = MinFecha) As Double
Get
@@ -1135,10 +1135,10 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTPSATPS") = value
End Set
End Property
End Property
#Region "GLOBALES DE SAT COMERCIO EXTERIOR"
Property GlobalDTClavePedimento() As DataTable
Get
GlobalDTClavePedimento = DirectCast(HttpContext.Current.Application("GlobalDTClavePedimento"), DataTable)
@@ -1248,10 +1248,10 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTColonia") = value
End Set
End Property
End Property
#End Region
Property GlobalDTPSATUM() As DataTable
Get
GlobalDTPSATUM = DirectCast(HttpContext.Current.Application("GlobalDTPSATUM"), DataTable)
@@ -1635,8 +1635,8 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTLeyendasFiscales") = value
End Set
End Property
End Property
Property GlobalDTEstatusFactura() As DataTable
Get
GlobalDTEstatusFactura = DirectCast(HttpContext.Current.Application("GlobalDTEstatusFactura"), DataTable)
@@ -1680,37 +1680,37 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
HttpContext.Current.Application("GlobalDTProyectos") = value
End Set
End Property
Public Property GlobalDTSubProyectos(CveProyecto As Integer, Optional CveSubProyecto As Integer = -1, Optional CveEmpresa As Integer = -1, Optional Estatus As Integer = 1) As DataTable
Get
Dim AppNombre As String = String.Format("GlobalDTSubProyectos-{0}", CveEmpresa)
'sino existe, recarga los datos
If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Or (DirectCast(HttpContext.Current.Application(AppNombre), DataTable) IsNot Nothing AndAlso DirectCast(HttpContext.Current.Application(AppNombre), DataTable).Rows.Count = 0) Then
Dim P As New ClsSubProyectos
If P.GetSubProyectos(CveEmpresa:=CveEmpresa) Then HttpContext.Current.Application(AppNombre) = P.DtResultados
P.Dispose()
End If
If CveProyecto <> -1 OrElse CveSubProyecto <> -1 OrElse CveEmpresa <> -1 OrElse Estatus <> -1 Then
Dim StrSQL As New StringBuilder
If CveProyecto <> -1 Then StrSQL.AppendFormat(" AND CveProyecto = {0}", CveProyecto)
If CveSubProyecto <> -1 Then StrSQL.AppendFormat(" AND CveSubProyecto = {0}", CveSubProyecto)
If Estatus <> -1 Then StrSQL.AppendFormat(" AND CveEstatus = {0}", Estatus)
If CveEmpresa <> -1 Then StrSQL.AppendFormat(" AND CveEmpresa = {0}", CveEmpresa)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows)
GlobalDTSubProyectos = Dv.ToTable
Dv.Dispose()
Else
GlobalDTSubProyectos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End If
End Get
Set(ByVal value As DataTable)
Dim AppNombre As String = String.Format("GlobalDTSubProyectos-{0}", CveEmpresa)
HttpContext.Current.Application(AppNombre) = value
End Set
Public Property GlobalDTSubProyectos(CveProyecto As Integer, Optional CveSubProyecto As Integer = -1, Optional CveEmpresa As Integer = -1, Optional Estatus As Integer = 1) As DataTable
Get
Dim AppNombre As String = String.Format("GlobalDTSubProyectos-{0}", CveEmpresa)
'sino existe, recarga los datos
If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Or (DirectCast(HttpContext.Current.Application(AppNombre), DataTable) IsNot Nothing AndAlso DirectCast(HttpContext.Current.Application(AppNombre), DataTable).Rows.Count = 0) Then
Dim P As New ClsSubProyectos
If P.GetSubProyectos(CveEmpresa:=CveEmpresa) Then HttpContext.Current.Application(AppNombre) = P.DtResultados
P.Dispose()
End If
If CveProyecto <> -1 OrElse CveSubProyecto <> -1 OrElse CveEmpresa <> -1 OrElse Estatus <> -1 Then
Dim StrSQL As New StringBuilder
If CveProyecto <> -1 Then StrSQL.AppendFormat(" AND CveProyecto = {0}", CveProyecto)
If CveSubProyecto <> -1 Then StrSQL.AppendFormat(" AND CveSubProyecto = {0}", CveSubProyecto)
If Estatus <> -1 Then StrSQL.AppendFormat(" AND CveEstatus = {0}", Estatus)
If CveEmpresa <> -1 Then StrSQL.AppendFormat(" AND CveEmpresa = {0}", CveEmpresa)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows)
GlobalDTSubProyectos = Dv.ToTable
Dv.Dispose()
Else
GlobalDTSubProyectos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End If
End Get
Set(ByVal value As DataTable)
Dim AppNombre As String = String.Format("GlobalDTSubProyectos-{0}", CveEmpresa)
HttpContext.Current.Application(AppNombre) = value
End Set
End Property
Property GlobalDTSubProyectosUsuarios(CveUsuario As Integer, CveProyecto As Integer, CveEmpresa As Integer, Optional CveSubProyecto As Integer = -1, Optional CveEstatus As Integer = -1) As DataTable
Get
@@ -2305,44 +2305,44 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
HttpContext.Current.Application("GlobalDTAlmacen") = value
End Set
End Property
Property GlobalDTAlmacenUsuarios(CveUsuario As Integer, CveEmpresa As Integer, Optional CveTipoAlmacen As Integer = 1) As DataTable
Get
Dim AppNombre As String = String.Format("GlobalDTAlmacenUsuarios-{0}", CveEmpresa)
'sino existe, recarga los datos
If HttpContext.Current.Application(AppNombre) Is Nothing Then
Dim ObjUsr As New ClsSisUsuarios
If ObjUsr.GetAlmacen(-1, CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjUsr.DtResultados
ObjUsr.Dispose()
End If
Dim Str As New StringBuilder
Str.AppendFormat("CveUsuario = {0} AND CveEmpresa = {1} ", CveUsuario, CveEmpresa)
If CveTipoAlmacen > 0 Then Str.AppendFormat("AND CveTipoAlmacen = {0}", CveTipoAlmacen)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
GlobalDTAlmacenUsuarios = Dv.ToTable
Dv.Dispose()
End Get
Set(value As DataTable)
Dim AppNombre As String = String.Format("GlobalDTAlmacenUsuarios-{0}", CveEmpresa)
HttpContext.Current.Application(AppNombre) = value
End Set
'Get
' If CveEmpresa <> -1 Then
' Dim Str As New StringBuilder
' Str.AppendFormat("CveUsuario = {0} AND CveEmpresa = {1} ", CveUsuario, CveEmpresa)
' If CveTipoAlmacen > 0 Then Str.AppendFormat("AND CveTipoAlmacen = {0}", CveTipoAlmacen)
' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTAlmacenUsuarios"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
' GlobalDTAlmacenUsuarios = Dv.ToTable
' Dv.Dispose()
' Else
' GlobalDTAlmacenUsuarios = DirectCast(HttpContext.Current.Application("GlobalDTAlmacenUsuarios"), DataTable)
' End If
'End Get
'Set(value As DataTable)
' HttpContext.Current.Application("GlobalDTAlmacenUsuarios") = value
'End Set
Property GlobalDTAlmacenUsuarios(CveUsuario As Integer, CveEmpresa As Integer, Optional CveTipoAlmacen As Integer = 1) As DataTable
Get
Dim AppNombre As String = String.Format("GlobalDTAlmacenUsuarios-{0}", CveEmpresa)
'sino existe, recarga los datos
If HttpContext.Current.Application(AppNombre) Is Nothing Then
Dim ObjUsr As New ClsSisUsuarios
If ObjUsr.GetAlmacen(-1, CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjUsr.DtResultados
ObjUsr.Dispose()
End If
Dim Str As New StringBuilder
Str.AppendFormat("CveUsuario = {0} AND CveEmpresa = {1} ", CveUsuario, CveEmpresa)
If CveTipoAlmacen > 0 Then Str.AppendFormat("AND CveTipoAlmacen = {0}", CveTipoAlmacen)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
GlobalDTAlmacenUsuarios = Dv.ToTable
Dv.Dispose()
End Get
Set(value As DataTable)
Dim AppNombre As String = String.Format("GlobalDTAlmacenUsuarios-{0}", CveEmpresa)
HttpContext.Current.Application(AppNombre) = value
End Set
'Get
' If CveEmpresa <> -1 Then
' Dim Str As New StringBuilder
' Str.AppendFormat("CveUsuario = {0} AND CveEmpresa = {1} ", CveUsuario, CveEmpresa)
' If CveTipoAlmacen > 0 Then Str.AppendFormat("AND CveTipoAlmacen = {0}", CveTipoAlmacen)
' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTAlmacenUsuarios"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
' GlobalDTAlmacenUsuarios = Dv.ToTable
' Dv.Dispose()
' Else
' GlobalDTAlmacenUsuarios = DirectCast(HttpContext.Current.Application("GlobalDTAlmacenUsuarios"), DataTable)
' End If
'End Get
'Set(value As DataTable)
' HttpContext.Current.Application("GlobalDTAlmacenUsuarios") = value
'End Set
End Property
Property GlobalDTNom_Periodos() As DataTable
Get
@@ -2397,9 +2397,9 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTVtaCobranzaEstatus") = value
End Set
End Property
End Property
#Region "***********************************************************************DT EVENTOS****************************************************************************************"
Property GlobalDTTiposEventos() As DataTable
Get
@@ -2435,9 +2435,9 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTOIEstatusEventos") = value
End Set
End Property
End Property
#End Region
#Region " **********************************************************************DT PROSPECTOS*************************************************************************************"
Property GlobalDTProspectosCaracteristicasClasificaciones() As DataTable
Get
@@ -2478,9 +2478,9 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTProspectosCaracteristicasOpciones") = value
End Set
End Property
End Property
#End Region
#Region "***********************************************************************DT ACTIVOS FIJOS**********************************************************************************"
Property GlobalDTActivoFijos(CveEmpresa As Integer, Optional CveSubTipoActivoFijo As Integer = -1, Optional CveActivoFijo As Integer = -1) As DataTable
Get
@@ -2573,10 +2573,10 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTTipoActivoFijo") = value
End Set
End Property
End Property
#End Region
#Region "***********************************************************************DT GENERALES**************************************************************************************"
Property GlobalDTGralPaises() As DataTable
Get
@@ -2664,10 +2664,10 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTGralColectivas") = value
End Set
End Property
End Property
#End Region
#Region "***********************************************************************DT PROSPECTOS*************************************************************************************"
Property GlobalDTProspectosSupervisores(CveEmpresa As Integer) As DataTable
Get
@@ -2876,8 +2876,8 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTProspectosTipos") = value
End Set
End Property
End Property
#Region " DT PROSPECTOS SOLICITUDES"
Property GlobalDTProspectosSolicitudes(CveEmpresa As Integer) As DataTable
Get
@@ -2944,15 +2944,15 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTProspectosSolicitudesApoyos") = value
End Set
End Property
End Property
#End Region
#End Region
#Region "**********************************************DT AMORTIZACIÓN CONTABLE PLAN DE DESARROLLO********************************************************************************"
#Region "***********************************************************************DT AMORTIZACIÓN CONTABLE*********************************************************************************************"
Property GlobalDTAC_RubrosIngreso() As DataTable
Get
GlobalDTAC_RubrosIngreso = DirectCast(HttpContext.Current.Application("GlobalDTAC_RubrosIngreso"), DataTable)
@@ -3208,11 +3208,11 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTAC_MatrizEgresos") = value
End Set
End Property
End Property
#End Region
Property GlobalDTAC_PD_EjeRector(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
@@ -3291,9 +3291,9 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTAC_PD_Metas") = value
End Set
End Property
End Property
#End Region
#Region "***********************************************************************GLOBAL DT ORDENES DE COMPRA***********************************************************************"
Property GlobalDTOCEstatus(CveEmpresa As Integer) As DataTable
Get
@@ -3308,75 +3308,75 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTOCEstatus") = value
End Set
End Property
Property GlobalDTOCEstatusUsuarios(CveEmpresa As Integer, Optional CveUsuario As Integer = -1, Optional Tipo As String = "") As DataTable
Get
Dim AppNombre As String = String.Format("GlobalDTOCEstatusUsuarios-{0}", CveEmpresa)
'sino existe, recarga los datos
If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then
Dim ObjOC As New ClsOC
If ObjOC.GetEstatusUsuarios(-1, -1, -1, -1, CveEmpresa) Then
HttpContext.Current.Application(AppNombre) = ObjOC.DtResultados
Else
HttpContext.Current.Application(AppNombre) = Nothing
End If
ObjOC.Dispose()
End If
Dim filtro As New StringBuilder
filtro.AppendFormat("CveEmpresa = {0} ", CveEmpresa)
If CveUsuario > 0 Then
filtro.AppendFormat(" AND CveUsuario={0} ", CveUsuario)
End If
If Tipo <> "" Then
filtro.AppendFormat(" AND Tipo='{0}'", Tipo)
End If
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), filtro.ToString, "", DataViewRowState.CurrentRows)
GlobalDTOCEstatusUsuarios = Dv.ToTable
Dv.Dispose()
End Get
Set(value As DataTable)
Dim AppNombre As String = String.Format("GlobalDTOCEstatusUsuarios-{0}", CveEmpresa)
HttpContext.Current.Application(AppNombre) = value
End Set
End Property
'Property GlobalDTOCEstatusUsuarios(CveEmpresa As Integer, Optional CveUsuario As Integer = -1, Optional Tipo As String = "") As DataTable
' Get
' If CveEmpresa <> -1 Then
' Dim filtro As New StringBuilder
' filtro.AppendFormat("CveEmpresa = {0} ", CveEmpresa)
' If CveUsuario > 0 Then
' filtro.AppendFormat(" AND CveUsuario={0} ", CveUsuario)
' End If
' If Tipo <> "" Then
' filtro.AppendFormat(" AND Tipo='{0}'", Tipo)
' End If
' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTOCEstatusUsuarios"), DataTable), filtro.ToString, "", DataViewRowState.CurrentRows)
' GlobalDTOCEstatusUsuarios = Dv.ToTable
' Dv.Dispose()
' Else
' GlobalDTOCEstatusUsuarios = DirectCast(HttpContext.Current.Application("GlobalDTOCEstatusUsuarios"), DataTable)
' End If
' End Get
' Set(value As DataTable)
' HttpContext.Current.Application("GlobalDTOCEstatusUsuarios") = value
' End Set
'End Property
End Property
Property GlobalDTOCEstatusUsuarios(CveEmpresa As Integer, Optional CveUsuario As Integer = -1, Optional Tipo As String = "") As DataTable
Get
Dim AppNombre As String = String.Format("GlobalDTOCEstatusUsuarios-{0}", CveEmpresa)
'sino existe, recarga los datos
If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then
Dim ObjOC As New ClsOC
If ObjOC.GetEstatusUsuarios(-1, -1, -1, -1, CveEmpresa) Then
HttpContext.Current.Application(AppNombre) = ObjOC.DtResultados
Else
HttpContext.Current.Application(AppNombre) = Nothing
End If
ObjOC.Dispose()
End If
Dim filtro As New StringBuilder
filtro.AppendFormat("CveEmpresa = {0} ", CveEmpresa)
If CveUsuario > 0 Then
filtro.AppendFormat(" AND CveUsuario={0} ", CveUsuario)
End If
If Tipo <> "" Then
filtro.AppendFormat(" AND Tipo='{0}'", Tipo)
End If
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), filtro.ToString, "", DataViewRowState.CurrentRows)
GlobalDTOCEstatusUsuarios = Dv.ToTable
Dv.Dispose()
End Get
Set(value As DataTable)
Dim AppNombre As String = String.Format("GlobalDTOCEstatusUsuarios-{0}", CveEmpresa)
HttpContext.Current.Application(AppNombre) = value
End Set
End Property
'Property GlobalDTOCEstatusUsuarios(CveEmpresa As Integer, Optional CveUsuario As Integer = -1, Optional Tipo As String = "") As DataTable
' Get
' If CveEmpresa <> -1 Then
' Dim filtro As New StringBuilder
' filtro.AppendFormat("CveEmpresa = {0} ", CveEmpresa)
' If CveUsuario > 0 Then
' filtro.AppendFormat(" AND CveUsuario={0} ", CveUsuario)
' End If
' If Tipo <> "" Then
' filtro.AppendFormat(" AND Tipo='{0}'", Tipo)
' End If
' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTOCEstatusUsuarios"), DataTable), filtro.ToString, "", DataViewRowState.CurrentRows)
' GlobalDTOCEstatusUsuarios = Dv.ToTable
' Dv.Dispose()
' Else
' GlobalDTOCEstatusUsuarios = DirectCast(HttpContext.Current.Application("GlobalDTOCEstatusUsuarios"), DataTable)
' End If
' End Get
' Set(value As DataTable)
' HttpContext.Current.Application("GlobalDTOCEstatusUsuarios") = value
' End Set
'End Property
#End Region
#Region "F I N A N Z A S "
Property GlobalDTFinan_RazonesFinancieras() As DataTable
Get
@@ -3385,10 +3385,10 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTFinan_RazonesFinancieras") = value
End Set
End Property
End Property
#End Region
#Region "***********************************************************************GLOBAL DT CONTABILIDAD****************************************************************************"
Property GlobalDTContaPlantillasPolizas(CveEmpresa As Integer, Optional TipoPlantilla As Integer = -1) As DataTable
Get
@@ -3442,9 +3442,9 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTContaConceptosContables") = value
End Set
End Property
End Property
#End Region
#Region "**********************************************************************GLOBAL DT RH (RECURSOS HUMANOS)********************************************************************"
Property GlobalDTAsistenciaDetalle() As DataTable
Get
@@ -3596,13 +3596,13 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTTipoBuzon") = value
End Set
End Property
End Property
#End Region
#Region "*********** D T - C O M B U S T I B L E S ***********"
Property GlobalDTCombustibles(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
@@ -3641,11 +3641,11 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
Set(ByVal value As DataTable)
HttpContext.Current.Application("GlobalDTCombustiblesTipos") = value
End Set
End Property
End Property
#End Region
#Region "*********** D T - M A N T E N I M I E N T O S ***********"
Property GlobalDTMantenimientosTipos() As DataTable
Get
GlobalDTMantenimientosTipos = DirectCast(HttpContext.Current.Application("GlobalDTMantenimientosTipos"), DataTable)
@@ -3684,13 +3684,13 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
HttpContext.Current.Application("GlobalDTMantenimientosTipos") = value
End Set
End Property
End Property
#End Region
#Region "*********** D T - T A L L E R E S ***********"
Property GlobalDTTalleresTipos() As DataTable
Get
GlobalDTTalleresTipos = DirectCast(HttpContext.Current.Application("GlobalDTTalleresTipos"), DataTable)
@@ -3707,12 +3707,12 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTTalleres") = value
End Set
End Property
End Property
#End Region
#Region "*********** D T - D I S T R I B U I D O R E S ***********"
Property GlobalDTDistribuidoresTipos() As DataTable
Get
GlobalDTDistribuidoresTipos = DirectCast(HttpContext.Current.Application("GlobalDTDistribuidoresTipos"), DataTable)
@@ -3729,11 +3729,11 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTDistribuidores") = value
End Set
End Property
End Property
#End Region
Property GlobalDTOIRevision(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
@@ -3824,8 +3824,8 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTPaqueterias") = value
End Set
End Property
End Property
#End Region
End Class