-- se quitaron los globaldt de modelos y se utilizaron los de clspaginas

This commit is contained in:
2023-02-18 09:47:58 -07:00
parent b1d742d58e
commit 9ae9389a82
2 changed files with 25 additions and 343 deletions

View File

@@ -101,33 +101,33 @@ Public Class ClsPaginas
#End Region
#Region "GlobalDTs"
Public Property GlobalTipoCambio(Optional Fecha As Date = MinFecha) As Double
Public Shared Property GlobalTipoCambio(Optional Fecha As Date = MinFecha) As Double
Get
If GlobalTipoCambio <= 0 Then
'sino tiene dato lo recargo por si ya esta insertado
If Fecha = MinFecha Then Fecha = Now
Dim ObjGral As New ClsGenerales
If ObjGral.GetTipoCambio(-1, Fecha) AndAlso ObjGral.DtResultados.Rows.Count > 0 Then
Application("GlobalTipoCambio") = ObjGral.DtResultados.Rows(0)("TipoCambio").ToString.ToDouble
HttpContext.Current.Application("GlobalTipoCambio") = ObjGral.DtResultados.Rows(0)("TipoCambio").ToString.ToDouble
Else
Application("GlobalTipoCambio") = 0
HttpContext.Current.Application("GlobalTipoCambio") = 0
End If
ObjGral.Dispose()
End If
Return Application("GlobalTipoCambio").ToString.ToDouble
Return HttpContext.Current.Application("GlobalTipoCambio").ToString.ToDouble
End Get
Set(value As Double)
Application("GlobalTipoCambio") = value
HttpContext.Current.Application("GlobalTipoCambio") = value
End Set
End Property
Public ReadOnly Property GlobalTipoCambioUltimaFluctuacion(Optional Fecha As Date = MinFecha) As MTipoCambioFluctuacion
Public Shared ReadOnly Property GlobalTipoCambioUltimaFluctuacion(Optional Fecha As Date = MinFecha) As MTipoCambioFluctuacion
Get
If Application("GlobalTipoCambioUltimaFluctuacion") Is Nothing Then
If HttpContext.Current.Application("GlobalTipoCambioUltimaFluctuacion") Is Nothing Then
Dim ObjGral As New ClsGenerales
If ObjGral.GetTipoCambioUltimaFluctuacion(-1, Now) AndAlso ObjGral.DtResultados.Rows.Count > 0 Then
Application("GlobalTipoCambioUltimaFluctuacion") = ObjGral.DtResultados.Copy()
HttpContext.Current.Application("GlobalTipoCambioUltimaFluctuacion") = ObjGral.DtResultados.Copy()
Else
Application("GlobalTipoCambioUltimaFluctuacion") = Nothing
HttpContext.Current.Application("GlobalTipoCambioUltimaFluctuacion") = Nothing
End If
ObjGral.Dispose()
End If
@@ -137,9 +137,9 @@ Public Class ClsPaginas
}
'sino tiene dato lo recargo por si ya esta insertado
If Fecha = MinFecha Then Fecha = Now
If Application("GlobalTipoCambioUltimaFluctuacion") IsNot Nothing Then
If HttpContext.Current.Application("GlobalTipoCambioUltimaFluctuacion") IsNot Nothing Then
Dim dr = DirectCast(Application("GlobalTipoCambioUltimaFluctuacion"), DataTable).FiltroPrimero(String.Format("Fecha < '{0}'", Fecha), Orderby:="Fecha DESC")
Dim dr = DirectCast(HttpContext.Current.Application("GlobalTipoCambioUltimaFluctuacion"), DataTable).FiltroPrimero(String.Format("Fecha < '{0}'", Fecha), Orderby:="Fecha DESC")
If dr IsNot Nothing Then
fluctuacion.TCFluctuacion = dr("TCFluctuacion").ToString().ToDecimal()
fluctuacion.FechaFluctuacion = dr("FechaFluctuacion").ToString().ToDateTime()

View File

@@ -326,47 +326,6 @@ Namespace Modelos
IniciaValores()
End Sub
'Public Sub New(ObjsClsPaginas As ClsPaginas, Optional Row As Data.DataRow = Nothing)
' If Row IsNot Nothing Then
' setValues(Row)
' Else
' IniciaValores()
' End If
' SetMetodoPago()
' Timbre = New CFDITimbre
' DirectorioServidor = ModExtensiones.DirectorioBaseEmpresas
'End Sub
'Public Sub New(ObjsClsPaginas As ClsPaginas, CveVenta As Integer, CveEmpresa As Integer)
' Me.CveEmpresa = CveEmpresa
' Dim ObjVentas As New ClsVentas()
' If ObjVentas.GetVenta(CveVenta, CveEmpresa) Then
' If ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
' setValues(ObjVentas.DtResultados.Rows(0))
' SetMetodoPago()
' SetMoneda()
' End If
' End If
' ObjVentas.Dispose()
' DirectorioServidor = ModExtensiones.DirectorioBaseEmpresas
'End Sub
'Public Sub New(ObjsClsPaginas As ClsPaginas, UsuarioActual As Usuario, Optional Row As Data.DataRow = Nothing)
' Me.UsuarioActual = UsuarioActual
' Me.ErrorList = New List(Of String)
' Me.RemisionesLista = New List(Of Integer)
' Me.ListaMensajes = New List(Of String)
' If Row IsNot Nothing Then
' setValues(Row)
' Else
' IniciaValores()
' End If
' SetMetodoPago()
' SetMoneda()
' SetSubProyecto(ObjsClsPaginas)
' SetSubProyectoMatriz(ObjsClsPaginas)
' Timbre = New CFDITimbre
' DirectorioServidor = ModExtensiones.DirectorioBaseEmpresas
'End Sub
Public Sub New(UsuarioActual As Usuario, Optional Row As Data.DataRow = Nothing)
Me.UsuarioActual = UsuarioActual
Me.ErrorList = New List(Of String)
@@ -1306,7 +1265,7 @@ Namespace Modelos
Dim tmpcon As DataTable = DtDetalle.Clone
tmpcon.Clear()
Dim drpss As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, SATClavePS:="84111506").FiltroPrimero("SATClavePS = '84111506'")
Dim drpss As DataRow = ClsPaginas.GlobalDTPS(UsuarioActual.CveEmpresa, SATClavePS:="84111506").FiltroPrimero("SATClavePS = '84111506'")
If drpss IsNot Nothing Then
Dim ii As Integer = 1
@@ -2381,7 +2340,7 @@ Namespace Modelos
If ObjFactura.CveMoneda = 2 AndAlso ObjFactura.TipoCambio > 0 Then
tipoCambio = ObjFactura.TipoCambio
ElseIf ObjFactura.CveMoneda = 2 AndAlso ObjFactura.TipoCambio <= 1 Then
tipoCambio = GlobalTipoCambio(ObjFactura.Fecha).ToString.ToDecimal
tipoCambio = ClsPaginas.GlobalTipoCambio(ObjFactura.Fecha).ToString.ToDecimal
Else
tipoCambio = 1
End If
@@ -2411,9 +2370,9 @@ Namespace Modelos
SeContabiliza = False
End If
If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=ObjFactura.DtDetalle.MAX("PorcentajeIVA").ToDouble).Rows.Count > 0 Then
IdCtaIVAXTrasladar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=DtDetalle.MAX("PorcentajeIVA").ToDouble).Rows(0)("IdCtaIVAXTrasladar").ToString.ToEntero
IdCtaIVATrasladado = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=DtDetalle.MAX("PorcentajeIVA").ToDouble).Rows(0)("IdCtaIVATrasladado").ToString.ToEntero
If ClsPaginas.GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=ObjFactura.DtDetalle.MAX("PorcentajeIVA").ToDouble).Rows.Count > 0 Then
IdCtaIVAXTrasladar = ClsPaginas.GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=DtDetalle.MAX("PorcentajeIVA").ToDouble).Rows(0)("IdCtaIVAXTrasladar").ToString.ToEntero
IdCtaIVATrasladado = ClsPaginas.GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=DtDetalle.MAX("PorcentajeIVA").ToDouble).Rows(0)("IdCtaIVATrasladado").ToString.ToEntero
End If
Dim UsaComplementariaClientes As Boolean = True
@@ -2441,7 +2400,7 @@ Namespace Modelos
Dim TCFluctuacion As Decimal = tipoCambio
'TOMA EL TC DE LA ULTIMA FLUCTUACION
If ValorMultiplicador = -1 AndAlso UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso ObjFactura.CveMoneda = 2 Then
Dim UltimaFluctuacion As ClsPaginas.MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(Now)
Dim UltimaFluctuacion As ClsPaginas.MTipoCambioFluctuacion = ClsPaginas.GlobalTipoCambioUltimaFluctuacion(Now)
If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then
If UltimaFluctuacion.FechaFluctuacion <= Now Then
@@ -2705,7 +2664,7 @@ Namespace Modelos
If tipoCambio > 1 Then
TipoCambioNC = tipoCambio
Else
TipoCambioNC = GlobalTipoCambio(ObjFactura.Fecha).ToDecimal
TipoCambioNC = ClsPaginas.GlobalTipoCambio(ObjFactura.Fecha).ToDecimal
End If
'APLICA NC SALDOS DIRECTOS
If DtVentasNC IsNot Nothing AndAlso DtVentasNC.Rows.Count > 0 Then
@@ -2775,7 +2734,7 @@ Namespace Modelos
Dim TCFluctuacion As Decimal = Dr("TCCambioValuacion").ToString.ToDecimal
If TCFluctuacion = 1 AndAlso TipoCambioNC > 1 Then
TCFluctuacion = GlobalTipoCambio(ObjFactura.Fecha).ToDecimal
TCFluctuacion = ClsPaginas.GlobalTipoCambio(ObjFactura.Fecha).ToDecimal
End If
If TipoCambioNC <> TCFluctuacion AndAlso TCFluctuacion > 1 AndAlso TipoCambioNC > 1 Then
Dim difFluctuacion As Decimal = TipoCambioNC - TCFluctuacion
@@ -3099,7 +3058,7 @@ Namespace Modelos
Dim TCFluctuacion As Decimal = row2("TCCambioValuacion").ToString.ToDecimal
If TCFluctuacion = 1 AndAlso tipoCambio > 1 Then
TCFluctuacion = GlobalTipoCambio(ObjFactura.Fecha).ToDecimal
TCFluctuacion = ClsPaginas.GlobalTipoCambio(ObjFactura.Fecha).ToDecimal
End If
If ObjFactura.CveMoneda = 2 AndAlso Not row2("TCCambioValuacion").ToString.ToDecimal > 1 Then
@@ -3318,8 +3277,8 @@ Namespace Modelos
If Not TmpDTDetalle(i)("CveClasificacion").ToString.Contiene("19958", "19933") Then
'reclasifica la clasificación del producto, por la del ingreso correspondiente a su iva
If ObjFactura.GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDTDetalle(i)("PorcentajeIVA").ToString.ToDecimal).Rows.Count > 0 Then
TmpDTDetalle(i)("CveClasificacion") = ObjFactura.GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDTDetalle(i)("PorcentajeIVA").ToString.ToDecimal).Rows(0)("CveClasificacion").ToString
If ClsPaginas.GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDTDetalle(i)("PorcentajeIVA").ToString.ToDecimal).Rows.Count > 0 Then
TmpDTDetalle(i)("CveClasificacion") = ClsPaginas.GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDTDetalle(i)("PorcentajeIVA").ToString.ToDecimal).Rows(0)("CveClasificacion").ToString
End If
End If
@@ -3383,8 +3342,8 @@ Namespace Modelos
'se excluyen las clasificaciones anteriores para que se asignen las de ingreso
If Not TmpDTDetalle(i)("CveClasificacion").ToString.Contiene("19958", "19933", "20242") Then
If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDTDetalle(i)("PorcentajeIVA").ToString().ToDouble).Rows.Count > 0 Then
TmpDTDetalle(i)("CveClasificacion") = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDTDetalle(i)("PorcentajeIVA").ToString().ToDouble).Rows(0)("CveClasificacion").ToString
If ClsPaginas.GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDTDetalle(i)("PorcentajeIVA").ToString().ToDouble).Rows.Count > 0 Then
TmpDTDetalle(i)("CveClasificacion") = ClsPaginas.GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDTDetalle(i)("PorcentajeIVA").ToString().ToDouble).Rows(0)("CveClasificacion").ToString
End If
End If
@@ -4633,7 +4592,7 @@ Namespace Modelos
If factura.CveMoneda = 2 AndAlso factura.TipoCambio > 0 Then
tipoCambio = factura.TipoCambio
ElseIf factura.CveMoneda = 2 AndAlso factura.TipoCambio <= 1 Then
tipoCambio = GlobalTipoCambio(factura.Fecha).ToString.ToDecimal
tipoCambio = ClsPaginas.GlobalTipoCambio(factura.Fecha).ToString.ToDecimal
Else
tipoCambio = 1
End If
@@ -7380,75 +7339,6 @@ Namespace Modelos
#Region "G L O B A L - D T"
Public Property GlobalTipoCambio(Optional Fecha As Date = MinFecha) As Double
Get
If GlobalTipoCambio <= 0 Then
'sino tiene dato lo recargo por si ya esta insertado
If Fecha = MinFecha Then Fecha = Now
Dim ObjGral As New ClsGenerales
If ObjGral.GetTipoCambio(-1, Fecha) AndAlso ObjGral.DtResultados.Rows.Count > 0 Then
HttpContext.Current.Application("GlobalTipoCambio") = ObjGral.DtResultados.Rows(0)("TipoCambio").ToString.ToDouble
Else
HttpContext.Current.Application("GlobalTipoCambio") = 0
End If
ObjGral.Dispose()
End If
Return HttpContext.Current.Application("GlobalTipoCambio").ToString.ToDouble
End Get
Set(value As Double)
HttpContext.Current.Application("GlobalTipoCambio") = value
End Set
End Property
Public Property GlobalTipoCambioEuro(Optional Fecha As Date = MinFecha) As Double
Get
If GlobalTipoCambioEuro <= 0 Then
'sino tiene dato lo recargo por si ya esta insertado
If Fecha = MinFecha Then Fecha = Now
Dim ObjGral As New ClsGenerales
If ObjGral.GetTipoCambio(-1, Fecha) AndAlso ObjGral.DtResultados.Rows.Count > 0 Then
HttpContext.Current.Application("GlobalTipoCambioEuro") = ObjGral.DtResultados.Rows(0)("TipoCambioEuro").ToString.ToDouble
Else
HttpContext.Current.Application("GlobalTipoCambioEuro") = 0
End If
ObjGral.Dispose()
End If
Return HttpContext.Current.Application("GlobalTipoCambioEuro").ToString.ToDouble
End Get
Set(value As Double)
HttpContext.Current.Application("GlobalTipoCambioEuro") = value
End Set
End Property
Property GlobalDTUsuarios(Optional CveUsuario As Integer = -1, Optional CveEmpresa As Integer = -1, Optional CveCliente As Integer = -1, Optional CveProveedor As Integer = -1) As DataTable
Get
Dim Str As New StringBuilder
If CveUsuario <> -1 Then Str.AppendFormat("CveUsuario = {0}", CveUsuario)
If CveEmpresa <> -1 Then Str.AppendFormat(" {0} CveEmpresa = {1}", If(Str.Length > 0, "AND", ""), CveEmpresa)
If CveCliente <> -1 Then Str.AppendFormat(" {0} CveCliente = {1}", If(Str.Length > 0, "AND", ""), CveCliente)
If CveProveedor <> -1 Then Str.AppendFormat(" {0} CveProveedor = {1}", If(Str.Length > 0, "AND", ""), CveProveedor)
If CveUsuario <> -1 OrElse CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTUsuarios"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
GlobalDTUsuarios = Dv.ToTable
Dv.Dispose()
Else
GlobalDTUsuarios = DirectCast(HttpContext.Current.Application("GlobalDTUsuarios"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTUsuarios") = value
End Set
End Property
Property DtFacturaDefault() As DataTable
Get
DtFacturaDefault = DirectCast(HttpContext.Current.Application("DtFacturaDefault"), DataTable)
@@ -7466,214 +7356,6 @@ Namespace Modelos
End Set
End Property
'Property GlobalDTEmpresas(Optional CveEmpresa As Integer = -1) As DataTable
' Get
' If CveEmpresa <> -1 Then
' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTEmpresas"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
' GlobalDTEmpresas = Dv.ToTable
' Dv.Dispose()
' Else
' GlobalDTEmpresas = DirectCast(HttpContext.Current.Application("GlobalDTEmpresas"), DataTable)
' End If
' End Get
' Set(ByVal value As DataTable)
' HttpContext.Current.Application("GlobalDTEmpresas") = 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()
' Dim msg As String = "aqui no se carga subproyectos"
' If HttpContext.Current.Request IsNot Nothing Then
' msg = msg & HttpContext.Current.Request.ServerVariables("URL")
' End If
' msg.GuardaLog()
' 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
' If HttpContext.Current.Application("GlobalDTSubProyectosUsuarios") Is Nothing Then
' Dim ObjSubProyectos As New ClsSubProyectos()
' If ObjSubProyectos.GetSubProyectosUsuarios Then HttpContext.Current.Application("GlobalDTSubProyectosUsuarios") = ObjSubProyectos.DtResultados Else Alert("Ocurrió un error al cargar los SubProyectos. Por favor comuniquese con sistemas.", TipoMensaje.MsgError)
' ObjSubProyectos.Dispose()
' End If
' If CveUsuario <> -1 OrElse CveProyecto <> -1 OrElse CveSubProyecto <> -1 OrElse CveEmpresa <> -1 OrElse CveEstatus <> -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 CveEmpresa <> -1 Then StrSQL.AppendFormat(" AND CveEmpresa = {0}", CveEmpresa)
' If CveUsuario <> -1 Then StrSQL.AppendFormat(" AND CveUsuario = {0}", CveUsuario)
' If CveEstatus <> -1 Then StrSQL.AppendFormat(" AND CveEstatus = {0}", CveEstatus)
' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTSubProyectosUsuarios"), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows)
' GlobalDTSubProyectosUsuarios = Dv.ToTable
' Dv.Dispose()
' Dim ObjSubProyectos As New ClsSubProyectos()
' If ObjSubProyectos.GetSubProyectosUsuarios(CveUsuario:=CveUsuario, CveProyecto:=CveProyecto, CveSubProyecto:=CveSubProyecto, CveEstatus:=CveEstatus, CveEmpresa:=CveEmpresa) Then
' GlobalDTSubProyectosUsuarios = ObjSubProyectos.DtResultados
' Else
' GlobalDTSubProyectosUsuarios = Nothing
' End If
' ObjSubProyectos.Dispose()
' Else
' GlobalDTSubProyectosUsuarios = DirectCast(HttpContext.Current.Application("GlobalDTSubProyectosUsuarios"), DataTable)
' End If
' End Get
' Set(ByVal value As DataTable)
' If value Is Nothing OrElse value.Rows.Count = 0 Then
' End If
' HttpContext.Current.Application("GlobalDTSubProyectosUsuarios") = value
' End Set
'End Property
'Property GlobalDTProyectosUsuarios(CveUsuario As Integer, CveProyecto As Integer, CveEmpresa As Integer, CveEstatus As Integer) As DataTable
' Get
' If HttpContext.Current.Application("GlobalDTProyectosUsuarios") Is Nothing AndAlso DirectCast(HttpContext.Current.Application("GlobalDTProyectosUsuarios"), DataTable).Rows.Count = 0 Then
' Dim ObjSubProyectos As New ClsSubProyectos()
' If ObjSubProyectos.GetSubProyectosUsuarios Then HttpContext.Current.Application("GlobalDTProyectosUsuarios") = ObjSubProyectos.DtResultados.FiltraParametros("", "", {"Proyecto", "CveProyecto", "CveUsuario", "CveEmpresa", "CveEstatusProyecto"}) Else Alert("Ocurrió un error al cargar los Proyectos. Por favor comuniquese con sistemas.", TipoMensaje.MsgError)
' ObjSubProyectos.Dispose()
' GuardaLog("Se Cargo GlobalDTProyectosUsuarios")
' End If
' If CveUsuario <> -1 OrElse CveProyecto <> -1 OrElse CveEmpresa <> -1 OrElse CveEstatus <> -1 Then
' Dim StrSQL As New StringBuilder
' If CveProyecto <> -1 Then StrSQL.AppendFormat(" AND CveProyecto = {0}", CveProyecto)
' If CveEmpresa <> -1 Then StrSQL.AppendFormat(" AND CveEmpresa = {0}", CveEmpresa)
' If CveUsuario <> -1 Then StrSQL.AppendFormat(" AND CveUsuario = {0}", CveUsuario)
' If CveEstatus <> -1 Then StrSQL.AppendFormat(" AND CveEstatusProyecto = {0}", CveEstatus)
' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProyectosUsuarios"), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows)
' GlobalDTProyectosUsuarios = Dv.ToTable
' Dv.Dispose()
' Else
' GlobalDTProyectosUsuarios = DirectCast(HttpContext.Current.Application("GlobalDTProyectosUsuarios"), DataTable)
' End If
' End Get
' Set(ByVal value As DataTable)
' If value Is Nothing OrElse value.Rows.Count = 0 Then
' End If
' HttpContext.Current.Application("GlobalDTProyectosUsuarios") = value
' End Set
'End Property
ReadOnly Property GlobalDTPS(CveEmpresa As Integer, Optional CvePS As Integer = -1, Optional SATClavePS As String = "-1", Optional AplicaParaVenta As Integer = -1) As DataTable
Get
Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPS(CvePS, -1, CveEmpresa, SATClavePS:=SATClavePS, pAplicaParaVenta:=AplicaParaVenta) Then
GlobalDTPS = ObjPS.DtResultados
Else
GlobalDTPS = Nothing
End If
ObjPS.Dispose()
End Get
End Property
Public ReadOnly Property GlobalTipoCambioUltimaFluctuacion(Optional Fecha As Date = MinFecha) As ClsPaginas.MTipoCambioFluctuacion
Get
If HttpContext.Current.Application("GlobalTipoCambioUltimaFluctuacion") Is Nothing Then
Dim ObjGral As New ClsGenerales
If ObjGral.GetTipoCambioUltimaFluctuacion(-1, Now) AndAlso ObjGral.DtResultados.Rows.Count > 0 Then
HttpContext.Current.Application("GlobalTipoCambioUltimaFluctuacion") = ObjGral.DtResultados.Copy()
Else
HttpContext.Current.Application("GlobalTipoCambioUltimaFluctuacion") = Nothing
End If
ObjGral.Dispose()
End If
Dim fluctuacion = New ClsPaginas.MTipoCambioFluctuacion() With {
.TCFluctuacion = 0,
.FechaFluctuacion = MinFecha
}
'sino tiene dato lo recargo por si ya esta insertado
If Fecha = MinFecha Then Fecha = Now
If HttpContext.Current.Application("GlobalTipoCambioUltimaFluctuacion") IsNot Nothing Then
Dim dr = DirectCast(HttpContext.Current.Application("GlobalTipoCambioUltimaFluctuacion"), DataTable).FiltroPrimero(String.Format("Fecha <= '{0}'", Fecha), Orderby:="Fecha DESC")
If dr IsNot Nothing Then
fluctuacion.TCFluctuacion = dr("TCFluctuacion").ToString().ToDecimal()
fluctuacion.FechaFluctuacion = dr("FechaFluctuacion").ToString().ToDateTime()
End If
Return fluctuacion
Else
Return fluctuacion
End If
End Get
End Property
Property GlobalDTClasificacionPorcentaje(CveEmpresa As Integer, Optional CveClasicacionPorcentaje As Integer = -1, Optional CveClasicacion As Integer = -1,
Optional PorcentajeIVA As Double = -1) As DataTable
Get
Dim Str As StringBuilder = New StringBuilder()
If CveEmpresa <> -1 Or CveClasicacionPorcentaje <> -1 Or CveClasicacion <> -1 Or PorcentajeIVA <> -1 Then
If CveEmpresa <> -1 Then Str.AppendFormat("CveEmpresa = {0}", CveEmpresa)
If CveClasicacionPorcentaje <> -1 Then Str.AppendFormat(" {0} CveClasicacionPorcentaje = {1}", If(Str.Length > 0, "AND", ""), CveClasicacionPorcentaje)
If CveClasicacion <> -1 Then Str.AppendFormat(" {0} CveClasicacion = {1}", If(Str.Length > 0, "AND", ""), CveClasicacion)
If PorcentajeIVA <> -1 Then Str.AppendFormat(" {0} PorcentajeIVA = {1}", If(Str.Length > 0, "AND", ""), PorcentajeIVA)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTClasificacionPorcentaje"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
GlobalDTClasificacionPorcentaje = Dv.ToTable
Dv.Dispose()
Else
GlobalDTClasificacionPorcentaje = DirectCast(HttpContext.Current.Application("GlobalDTClasificacionPorcentaje"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTClasificacionPorcentaje") = value
End Set
End Property
Public Property CveContratoSecciones As String
Public Property CveEstatus As Integer
Public Property GenerarPDFFactura As Boolean = False