diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb
index 64ee112a5..ae2a6e5ca 100644
--- a/App_Code/ClsPaginas.vb
+++ b/App_Code/ClsPaginas.vb
@@ -435,7 +435,7 @@ Public Class ClsPaginas
'sino existe, recarga los datos
If DirectCast(Application(AppNombre), DataTable) Is Nothing Then
Dim P As New ClsCompProveedores
- If P.GetProveedorClasificacion(UsuarioActual.CveEmpresa) Then Application(AppNombre) = P.DtResultados
+ If P.GetProveedorClasificacion(CveEmpresa) Then Application(AppNombre) = P.DtResultados
P.Dispose()
End If
@@ -449,8 +449,9 @@ Public Class ClsPaginas
End Get
Set(value As DataTable)
- Dim AppNombre As String = String.Format("GlobalDTProveedorClasificacion{0}", CveEmpresa)
- Application(AppNombre) = value
+ Dim AppNombre As String = String.Format("GlobalDTProveedorClasificacion{0}", CveEmpresa)
+ Application(AppNombre) = value
+
End Set
End Property
Property GlobalDTProveedorSucursales(CveProveedor As Integer, CveEmpresa As Integer) As DataTable
@@ -459,7 +460,7 @@ Public Class ClsPaginas
'sino existe, recarga los datos
If DirectCast(Application(AppNombre), DataTable) Is Nothing Then
Dim P As New ClsCompProveedores
- If P.GetSucursales(-1, UsuarioActual.CveEmpresa) Then Application(AppNombre) = P.DtResultados
+ If P.GetSucursales(-1, CveEmpresa) Then Application(AppNombre) = P.DtResultados
P.Dispose()
End If
@@ -473,8 +474,9 @@ Public Class ClsPaginas
End Get
Set(value As DataTable)
- Dim AppNombre As String = String.Format("GlobalDTProveedorSucursales{0}", CveEmpresa)
- Application(AppNombre) = value
+ Dim AppNombre As String = String.Format("GlobalDTProveedorSucursales{0}", CveEmpresa)
+ Application(AppNombre) = value
+
End Set
End Property
Property GlobalDTRoles(CveEmpresa As Integer) As DataTable
@@ -755,37 +757,36 @@ Public Class ClsPaginas
Application("GlobalDTSATUsosCFDI") = value
End Set
End Property
- Public Shared Property GlobalDTUnidadesMedida(Optional CveEmpresa As Integer = -1) As DataTable
+ Public Property GlobalDTUnidadesMedida(Optional CveEmpresa As Integer = -1) As DataTable
Get
Dim AppNombre As String = String.Format("GlobalDTUnidadesMedida{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
+ If DirectCast(Application(AppNombre), DataTable) Is Nothing Or (DirectCast(Application(AppNombre), DataTable) IsNot Nothing AndAlso DirectCast(Application(AppNombre), DataTable).Rows.Count = 0) Then
Dim ObjUnidadesMedida As New ClsUnidadesMedida()
- If ObjUnidadesMedida.GetUnidadesMedida(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjUnidadesMedida.DtResultados Else HttpContext.Current.Application(AppNombre) = Nothing
- 'If ObjUnidadesMedida.GetUnidadesMedidaAlias() Then Application("GlobalDTUnidadesMedidaAlias") = ObjUnidadesMedida.DtResultados Else Application("GlobalDTUnidadesMedidaAlias") = Nothing
+ If ObjUnidadesMedida.GetUnidadesMedida(CveEmpresa) Then Application(AppNombre) = ObjUnidadesMedida.DtResultados
ObjUnidadesMedida.Dispose()
End If
If CveEmpresa <> -1 Then
- Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), " UnidadMedida", DataViewRowState.CurrentRows)
+ Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), " UnidadMedida", DataViewRowState.CurrentRows)
GlobalDTUnidadesMedida = Dv.ToTable
Dv.Dispose()
Else
- GlobalDTUnidadesMedida = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
+ GlobalDTUnidadesMedida = DirectCast(Application(AppNombre), DataTable)
End If
End Get
Set(value As DataTable)
- Dim AppNombre As String = String.Format("GlobalDTUnidadesMedida{0}", CveEmpresa)
- HttpContext.Current.Application(AppNombre) = value
+ Dim AppNombre As String = String.Format("GlobalDTUnidadesMedida{0}", CveEmpresa)
+ Application(AppNombre) = value
End Set
End Property
Property GlobalDTUnidadesMedidaAlias(Optional CveEmpresa As Integer = -1) As DataTable
Get
Dim AppNombre As String = String.Format("GlobalDTUnidadesMedidaAlias{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
+ If DirectCast(Application(AppNombre), DataTable) Is Nothing Or (DirectCast(Application(AppNombre), DataTable) IsNot Nothing AndAlso DirectCast(Application(AppNombre), DataTable).Rows.Count = 0) Then
Dim ObjUnidadesMedida As New ClsUnidadesMedida()
- If ObjUnidadesMedida.GetUnidadesMedidaAlias(CveEmpresa, -1) Then Application(AppNombre) = ObjUnidadesMedida.DtResultados Else Application(AppNombre) = Nothing
+ If ObjUnidadesMedida.GetUnidadesMedidaAlias(CveEmpresa, -1) Then Application(AppNombre) = ObjUnidadesMedida.DtResultados
ObjUnidadesMedida.Dispose()
End If
If CveEmpresa <> -1 Then
@@ -797,8 +798,11 @@ Public Class ClsPaginas
End If
End Get
Set(value As DataTable)
- Dim AppNombre As String = String.Format("GlobalDTUnidadesMedidaAlias{0}", CveEmpresa)
- Application(AppNombre) = value
+ Dim AppNombre As String = String.Format("GlobalDTUnidadesMedidaAlias{0}", CveEmpresa)
+ Application(AppNombre) = value
+ 'Dim ObjUnidadesMedida As New ClsUnidadesMedida()
+ 'If ObjUnidadesMedida.GetUnidadesMedidaAlias(CveEmpresa, -1) Then Application(AppNombre) = ObjUnidadesMedida.DtResultados
+ 'ObjUnidadesMedida.Dispose()
End Set
End Property
Property GlobalDTEstatusOrdenCompra() As DataTable
@@ -879,20 +883,18 @@ Public Class ClsPaginas
Application("GlobalDTProyectos") = value
End Set
End Property
- Public Shared Property GlobalDTSubProyectos(CveProyecto As Integer, Optional CveSubProyecto As Integer = -1, Optional CveEmpresa As Integer = -1, Optional Estatus As Integer = 1) As DataTable
+ 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
+ If DirectCast(Application(AppNombre), DataTable) Is Nothing Or (DirectCast(Application(AppNombre), DataTable) IsNot Nothing AndAlso DirectCast(Application(AppNombre), DataTable).Rows.Count = 0) Then
Dim P As New ClsSubProyectos
- If P.GetSubProyectos(CveEmpresa:=CveEmpresa) Then
- HttpContext.Current.Application(AppNombre) = P.DtResultados
- End If
+ If P.GetSubProyectos(CveEmpresa:=CveEmpresa) Then 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")
+ If Request IsNot Nothing Then
+ msg = msg & Request.ServerVariables("URL")
End If
msg.GuardaLog()
@@ -905,26 +907,18 @@ Public Class ClsPaginas
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)
+ Dim Dv As New DataView(DirectCast(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)
+ GlobalDTSubProyectos = DirectCast(Application(AppNombre), DataTable)
End If
End Get
Set(ByVal value As DataTable)
- Dim AppNombre As String = String.Format("GlobalDTSubProyectos{0}", CveEmpresa)
- If value Is Nothing OrElse value.Rows.Count = 0 Then
- 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
- HttpContext.Current.Application(AppNombre) = value
+ Dim AppNombre As String = String.Format("GlobalDTSubProyectos{0}", CveEmpresa)
+ 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
@@ -1179,20 +1173,20 @@ Public Class ClsPaginas
ObjPS.Dispose()
End Get
End Property
- Public Shared Property GlobalDTPSSimplificado(CveEmpresa As Integer, Optional CveClasificacion As Integer = -1, Optional PSCodigo As String = "-1", Optional Estatus As Integer = 1, Optional AplicaParaVenta As Integer = -1) As DataTable
+ Public Property GlobalDTPSSimplificado(CveEmpresa As Integer, Optional CveClasificacion As Integer = -1, Optional PSCodigo As String = "-1", Optional Estatus As Integer = 1, Optional AplicaParaVenta As Integer = -1) As DataTable
Get
Dim AppNombre As String = String.Format("GlobalDTPSSimplificado{0}", CveEmpresa)
If CveEmpresa <> -1 Then
'sino existe, recarga los datos
- If HttpContext.Current.Application(AppNombre) Is Nothing Then
+ If Application(AppNombre) Is Nothing Then
Dim ObjPS As New ClsProductosServicios
- If ObjPS.GetPSSimplificado(-1) Then HttpContext.Current.Application(AppNombre) = ObjPS.DtResultados.AsEnumerable() Else HttpContext.Current.Application("GlobalDTPSSimplificado") = Nothing
+ If ObjPS.GetPSSimplificado(CveEmpresa) Then Application(AppNombre) = ObjPS.DtResultados.AsEnumerable()
ObjPS.Dispose()
End If
- Dim Cons = DirectCast(HttpContext.Current.Application(AppNombre), EnumerableRowCollection(Of DataRow))
+ Dim Cons = DirectCast(Application(AppNombre), EnumerableRowCollection(Of DataRow))
Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveEmpresa) = CveEmpresa))
If CveClasificacion >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveClasificacion) = CveClasificacion))
@@ -1207,12 +1201,12 @@ Public Class ClsPaginas
End Try
Else
- GlobalDTPSSimplificado = DirectCast(HttpContext.Current.Application(AppNombre), EnumerableRowCollection(Of DataRow)).CopyToDataTable
+ GlobalDTPSSimplificado = DirectCast(Application(AppNombre), EnumerableRowCollection(Of DataRow)).CopyToDataTable
End If
End Get
Set(value As DataTable)
- Dim AppNombre As String = String.Format("GlobalDTPSSimplificado{0}", CveEmpresa)
- HttpContext.Current.Application(AppNombre) = value
+ Dim AppNombre As String = String.Format("GlobalDTPSSimplificado{0}", CveEmpresa)
+ Application(AppNombre) = value
End Set
End Property
Property GlobalDTProductosServiciosAlias(CveEmpresa As Integer, Optional Estatus As Integer = 1) As DataTable
@@ -1221,9 +1215,8 @@ Public Class ClsPaginas
'sino existe, recarga los datos
If Application(AppNombre) Is Nothing Then
Dim ObjPS As New ClsProductosServicios
- If ObjPS.GetPSAlias(-1, CveEmpresa) Then Application(AppNombre) = ObjPS.DtResultados Else Application(AppNombre) = Nothing
+ If ObjPS.GetPSAlias(-1, CveEmpresa) Then Application(AppNombre) = ObjPS.DtResultados
ObjPS.Dispose()
-
End If
@@ -1241,20 +1234,19 @@ Public Class ClsPaginas
End If
End Get
Set(value As DataTable)
- Dim AppNombre As String = String.Format("GlobalDTProductosServiciosAlias{0}", CveEmpresa)
- Application(AppNombre) = value
+ Dim AppNombre As String = String.Format("GlobalDTProductosServiciosAlias{0}", CveEmpresa)
+ Application(AppNombre) = value
End Set
End Property
- Public Shared Property GlobalDTProductosServiciosEquivalencias(CvePS As Integer, CveUM As Integer, CveEmpresa As Integer) As DataTable
+ Public Property GlobalDTProductosServiciosEquivalencias(CvePS As Integer, CveUM As Integer, CveEmpresa As Integer) As DataTable
Get
Dim AppNombre As String = String.Format("GlobalDTProductosServiciosEquivalencias{0}", CveEmpresa)
If CveEmpresa <> -1 Then
'sino existe, recarga los datos
- If HttpContext.Current.Application(AppNombre) Is Nothing Then
+ If Application(AppNombre) Is Nothing Then
Dim ObjPS As New ClsProductosServicios
- If ObjPS.GetPSEquivalencias(-1, CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjPS.DtResultados Else HttpContext.Current.Application(AppNombre) = Nothing
- ObjPS.Dispose()
-
+ If ObjPS.GetPSEquivalencias(-1, CveEmpresa) Then Application(AppNombre) = ObjPS.DtResultados
+ ObjPS.Dispose()
End If
End If
@@ -1264,16 +1256,17 @@ Public Class ClsPaginas
If CveUM <> -1 Then StrSQL.AppendFormat(" AND CveUM = {0}", CveUM)
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)
+ Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows)
GlobalDTProductosServiciosEquivalencias = Dv.ToTable
Dv.Dispose()
Else
- GlobalDTProductosServiciosEquivalencias = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
+ GlobalDTProductosServiciosEquivalencias = DirectCast(Application(AppNombre), DataTable)
End If
End Get
Set(value As DataTable)
- Dim AppNombre As String = String.Format("GlobalDTProductosServiciosEquivalencias{0}", CveEmpresa)
- HttpContext.Current.Application(AppNombre) = value
+ Dim AppNombre As String = String.Format("GlobalDTProductosServiciosEquivalencias{0}", CveEmpresa)
+ Application(AppNombre) = value
+
End Set
End Property
Property GlobalDTProductosServiciosCaracteristicas(CveEmpresa As Integer) As DataTable
@@ -1299,7 +1292,7 @@ Public Class ClsPaginas
'sino existe, recarga los datos
If Application(AppNombre) Is Nothing Then
Dim ObjPS As New ClsProductosServicios
- If ObjPS.GetPSAdicionales(-1, CveEmpresa) Then Application(AppNombre) = ObjPS.DtResultados Else Application(AppNombre) = Nothing
+ If ObjPS.GetPSAdicionales(-1, CveEmpresa) Then Application(AppNombre) = ObjPS.DtResultados
ObjPS.Dispose()
End If
@@ -1317,8 +1310,9 @@ Public Class ClsPaginas
End If
End Get
Set(value As DataTable)
- Dim AppNombre As String = String.Format("GlobalDTPSAdicionales{0}", CveEmpresa)
- Application(AppNombre) = value
+ Dim AppNombre As String = String.Format("GlobalDTPSAdicionales{0}", CveEmpresa)
+ Application(AppNombre) = value
+
End Set
End Property
Property GlobalDTProductosServiciosCaracteristicasOpciones(CveEmpresa As Integer) As DataTable
@@ -1374,7 +1368,7 @@ Public Class ClsPaginas
'sino existe, recarga los datos
If Application(AppNombre) Is Nothing Then
Dim ObjPS As New ClsProductosServicios
- If ObjPS.GetPSImpuestosLocales(-1, CveEmpresa) Then Application(AppNombre) = ObjPS.DtResultados Else Application(AppNombre) = Nothing
+ If ObjPS.GetPSImpuestosLocales(-1, CveEmpresa) Then Application(AppNombre) = ObjPS.DtResultados
ObjPS.Dispose()
End If
@@ -1391,8 +1385,11 @@ Public Class ClsPaginas
End If
End Get
Set(value As DataTable)
- Dim AppNombre As String = String.Format("GlobalDTImpuestosLocales{0}", CveEmpresa)
- Application(AppNombre) = value
+ Dim AppNombre As String = String.Format("GlobalDTImpuestosLocales{0}", CveEmpresa)
+ Application(AppNombre) = value
+ 'Dim ObjPS As New ClsProductosServicios
+ 'If ObjPS.GetPSImpuestosLocales(-1, CveEmpresa) Then Application(AppNombre) = ObjPS.DtResultados
+ 'ObjPS.Dispose()
End Set
End Property
'Bancos
@@ -1516,7 +1513,7 @@ Public Class ClsPaginas
'sino existe, recarga los datos
If Application(AppNombre) Is Nothing Then
Dim ObjClientes As New ClsClientes
- If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, Estatus:=-1) Then Application(AppNombre) = ObjClientes.DtResultados Else Application(AppNombre) = Nothing
+ If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa, Estatus:=-1) Then Application(AppNombre) = ObjClientes.DtResultados
ObjClientes.Dispose()
End If
@@ -1536,8 +1533,8 @@ Public Class ClsPaginas
End If
End Get
Set(value As DataTable)
- Dim AppNombre As String = String.Format("GlobalDTCliente{0}", CveEmpresa)
- Application(AppNombre) = value
+ Dim AppNombre As String = String.Format("GlobalDTCliente{0}", CveEmpresa)
+ Application(AppNombre) = value
End Set
End Property
Property GlobalDTClienteClasificaciones(CveEmpresa As Integer) As DataTable
@@ -1546,7 +1543,7 @@ Public Class ClsPaginas
'sino existe, recarga los datos
If Application(AppNombre) Is Nothing Then
Dim ObjClientes As New ClsClientes
- If ObjClientes.GetClienteClasificacion(UsuarioActual.CveEmpresa) Then Application(AppNombre) = ObjClientes.DtResultados Else Application(AppNombre) = Nothing
+ If ObjClientes.GetClienteClasificacion(CveEmpresa) Then Application(AppNombre) = ObjClientes.DtResultados
ObjClientes.Dispose()
End If
If CveEmpresa <> -1 Then
@@ -1559,8 +1556,8 @@ Public Class ClsPaginas
End If
End Get
Set(value As DataTable)
- Dim AppNombre As String = String.Format("GlobalDTClienteClasificaciones{0}", CveEmpresa)
- Application(AppNombre) = value
+ Dim AppNombre As String = String.Format("GlobalDTClienteClasificaciones{0}", CveEmpresa)
+ Application(AppNombre) = value
End Set
End Property
Property GlobalDTEstatusOrdenServicios(CveEmpresa As Integer) As DataTable
@@ -1580,16 +1577,24 @@ Public Class ClsPaginas
'Variables para Ventas
Property GlobalDTVendedores(CveEmpresa As Integer, Optional Estatus As Boolean = True, Optional VendedorTipo As Integer = 1) As DataTable
Get
+ Dim AppNombre As String = String.Format("GlobalDTVendedores{0}", CveEmpresa)
+ 'sino existe, recarga los datos
+ If Application(AppNombre) Is Nothing Then
+ Dim ObjVendedores As New ClsVtaVendedores
+ If ObjVendedores.GetVendedores(-1) Then Application(AppNombre) = ObjVendedores.DtResultados
+ ObjVendedores.Dispose()
+ End If
If CveEmpresa <> -1 Then
- Dim Dv As New DataView(DirectCast(Application("GlobalDTVendedores"), DataTable), String.Format("CveEmpresa = {0} AND CveEstatus = {1} AND VendedorTipo = {2}", CveEmpresa, If(Estatus, 1, 0), VendedorTipo), "", DataViewRowState.CurrentRows)
+ Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), String.Format("CveEmpresa = {0} AND CveEstatus = {1} AND VendedorTipo = {2}", CveEmpresa, If(Estatus, 1, 0), VendedorTipo), "", DataViewRowState.CurrentRows)
GlobalDTVendedores = Dv.ToTable
Dv.Dispose()
Else
- GlobalDTVendedores = DirectCast(Application("GlobalDTVendedores"), DataTable)
+ GlobalDTVendedores = DirectCast(Application(AppNombre), DataTable)
End If
End Get
Set(value As DataTable)
- Application("GlobalDTVendedores") = value
+ Dim AppNombre As String = String.Format("GlobalDTVendedores{0}", CveEmpresa)
+ Application(AppNombre) = value
End Set
End Property
Property GlobalDTClientesCorporativo(CveEmpresa As Integer) As DataTable
@@ -1612,7 +1617,7 @@ Public Class ClsPaginas
'sino existe, recarga los datos
If 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, UsuarioActual.CveEmpresa) Then Application(AppNombre) = ObjProveedores.DtResultados Else Application(AppNombre) = Nothing
+ If ObjProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaGlobalDT, -1, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa) Then Application(AppNombre) = ObjProveedores.DtResultados
ObjProveedores.Dispose()
End If
@@ -1626,8 +1631,11 @@ Public Class ClsPaginas
End Get
Set(value As DataTable)
- Dim AppNombre As String = String.Format("GlobalDTCompProveedores{0}", CveEmpresa)
- Application(AppNombre) = value
+ Dim AppNombre As String = String.Format("GlobalDTCompProveedores{0}", CveEmpresa)
+ Application(AppNombre) = value
+ 'Dim ObjProveedores As New ClsCompProveedores
+ 'If ObjProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaGlobalDT, -1, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa) Then Application(AppNombre) = ObjProveedores.DtResultados
+ 'ObjProveedores.Dispose()
End Set
End Property
'EstatusFactura
@@ -3228,7 +3236,36 @@ Public Class ClsPaginas
Set(value As DataTable)
Application("GlobalDTAcumTiposUso") = value
End Set
- End Property
+ End Property
+
+ Property GlobalDTAcumGarantiasMesesTipoUso(CveEmpresa As Integer, CveMarca As Integer) As DataTable
+ Get
+ Dim AppNombre As String = String.Format("GlobalDTAcumGarantiasMesesTipoUso{0}", CveEmpresa)
+ If Application(AppNombre) Is Nothing Then
+ Dim ObjAcumuladores As New ClsAcumuladores()
+ If ObjAcumuladores.GarantiasMesesGet(-1, -1) Then Application(AppNombre) = ObjAcumuladores.DtResultados.FiltraParametros("", DistinctColumns:={"CveMarca", "CveTipoUso", "TipoUso"})
+ ObjAcumuladores.Dispose()
+ End If
+
+ If CveMarca <> -1 Then
+ Dim Str As StringBuilder = New StringBuilder()
+ If CveMarca <> -1 Then Str.AppendFormat("CveMarca = {0}", CveMarca)
+
+ Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
+ GlobalDTAcumGarantiasMesesTipoUso = Dv.ToTable
+ Dv.Dispose()
+ Else
+ GlobalDTAcumGarantiasMesesTipoUso = DirectCast(Application(AppNombre), DataTable)
+ End If
+
+ End Get
+ Set(value As DataTable)
+ Dim AppNombre As String = String.Format("GlobalDTAcumGarantiasMesesTipoUso{0}", CveEmpresa)
+ Application(AppNombre) = value
+ End Set
+ End Property
+
+
Property GlobalDTAcumTamaños() As DataTable
Get
GlobalDTAcumTamaños = DirectCast(Application("GlobalDTAcumTamaños"), DataTable)
diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb
index c5e33a480..52038c7cd 100644
--- a/App_Code/Modelos.vb
+++ b/App_Code/Modelos.vb
@@ -2630,7 +2630,7 @@ Namespace Modelos
importeMovimiento = ((TmpDTDetalle.SUM("TotalImporte", String.Format("CveClasificacion = {0} And CveSubProyecto = {1}", Row2("CveClasificacion"), Row2("CveSubProyecto"))).ToString.ToDecimal) * ValorMultiplicador)
importeMX = importeMovimiento * tipoCambio * Multiplicador
FechaMovimiento = ObjFactura.FechaPago
- Concepto = $"{ObjFactura.SerieFolio} {If(Row2("CveClasificacion").ToString.ToEntero > 0, GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = {Row2("CveClasificacion").ToString}"), "")} - {If(Row2("CveSubProyecto").ToString.ToEntero > 0, ClsPaginas.GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa).FiltroPrimeroValor("SubProyecto", $"CveSubProyecto = {Row2("CveSubProyecto").ToString}"), "Sin SubProyecto Asignado")}"
+ Concepto = $"{ObjFactura.SerieFolio} {If(Row2("CveClasificacion").ToString.ToEntero > 0, GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = {Row2("CveClasificacion").ToString}"), "")} - {If(Row2("CveSubProyecto").ToString.ToEntero > 0, GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa).FiltroPrimeroValor("SubProyecto", $"CveSubProyecto = {Row2("CveSubProyecto").ToString}"), "Sin SubProyecto Asignado")}"
If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}"
'Nota cuando es Nota de crédiot, debe de tomar el devoluciones y rebajas
@@ -2705,7 +2705,7 @@ Namespace Modelos
importeMovimiento = ((TmpDTDetalle.SUM("TotalImporte", String.Format("CveClasificacion = {0} And CveSubProyecto = {1}", Row2("CveClasificacion"), Row2("CveSubProyecto"))).ToString.ToDecimal) * ValorMultiplicador)
importeMX = importeMovimiento * tipoCambio * Multiplicador
FechaMovimiento = ObjFactura.FechaPago
- Concepto = $"{ObjFactura.SerieFolio} {If(Row2("CveClasificacion").ToString.ToEntero > 0, GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = {Row2("CveClasificacion").ToString}"), "")} - {If(Row2("CveSubProyecto").ToString.ToEntero > 0, ClsPaginas.GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa).FiltroPrimeroValor("SubProyecto", $"CveSubProyecto = {Row2("CveSubProyecto").ToString}"), "Sin SubProyecto Asignado")}"
+ Concepto = $"{ObjFactura.SerieFolio} {If(Row2("CveClasificacion").ToString.ToEntero > 0, GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = {Row2("CveClasificacion").ToString}"), "")} - {If(Row2("CveSubProyecto").ToString.ToEntero > 0, GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa).FiltroPrimeroValor("SubProyecto", $"CveSubProyecto = {Row2("CveSubProyecto").ToString}"), "Sin SubProyecto Asignado")}"
If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}"
'Nota cuando es Nota de crédiot, debe de tomar el devoluciones y rebajas
@@ -3204,7 +3204,7 @@ Namespace Modelos
If UsuarioActual.CveEmpresa = 1 Then
DtEquivalencias = New DataTable
- DtEquivalencias = ClsPaginas.GlobalDTProductosServiciosEquivalencias(CveProducto, -1, UsuarioActual.CveEmpresa)
+ DtEquivalencias = GlobalDTProductosServiciosEquivalencias(CveProducto, -1, UsuarioActual.CveEmpresa)
Dim CveUnidadBase As Integer = DtEquivalencias.FiltroPrimeroValor("CveUM", "UnidadBase = 'True'").ToEntero
Dim drUMBase As DataRow = DtEquivalencias.FiltroPrimero("UnidadBase = 'True'")
@@ -5446,11 +5446,11 @@ Namespace Modelos
Public Sub SetSubProyecto()
If CveSubProyecto > 0 Then
- SubProyecto = New Modelos.SubProyectoModel(ClsPaginas.GlobalDTSubProyectos(-1).FiltroPrimero($"CveSubProyecto = {CveSubProyecto}"))
+ SubProyecto = New Modelos.SubProyectoModel(GlobalDTSubProyectos(-1).FiltroPrimero($"CveSubProyecto = {CveSubProyecto}"))
End If
End Sub
Public Sub SetSubProyectoMatriz()
- Dim Row As Data.DataRow = ClsPaginas.GlobalDTSubProyectos(-1, CveSubProyecto:=-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("TipoSucursal=1")
+ Dim Row As Data.DataRow = GlobalDTSubProyectos(-1, CveSubProyecto:=-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("TipoSucursal=1")
If Not IsNothing(Row) Then
SubProyectoMatriz = New Modelos.SubProyectoModel(Row)
End If
@@ -5496,12 +5496,12 @@ Namespace Modelos
End Sub
Public Sub SetSubProyecto(obj As ClsPaginas)
If CveSubProyecto > 0 AndAlso Not IsNothing(obj) Then
- SubProyecto = New Modelos.SubProyectoModel(ClsPaginas.GlobalDTSubProyectos(-1).FiltroPrimero($"CveSubProyecto = {CveSubProyecto}"))
+ SubProyecto = New Modelos.SubProyectoModel(GlobalDTSubProyectos(-1).FiltroPrimero($"CveSubProyecto = {CveSubProyecto}"))
End If
End Sub
Public Sub SetSubProyectoMatriz(obj As ClsPaginas)
If Not IsNothing(obj) Then
- Dim Row As Data.DataRow = ClsPaginas.GlobalDTSubProyectos(-1, CveSubProyecto:=-1, CveEmpresa:=obj.UsuarioActual.CveEmpresa).FiltroPrimero("TipoSucursal=1")
+ Dim Row As Data.DataRow = GlobalDTSubProyectos(-1, CveSubProyecto:=-1, CveEmpresa:=obj.UsuarioActual.CveEmpresa).FiltroPrimero("TipoSucursal=1")
If Not IsNothing(Row) Then
SubProyectoMatriz = New Modelos.SubProyectoModel(Row)
End If
@@ -5937,6 +5937,27 @@ Namespace Modelos
HttpContext.Current.Application("GlobalDTProveedoresCuentas") = value
End Set
End Property
+
+ Public ReadOnly Property GlobalDTProductosServiciosEquivalencias(CvePS As Integer, CveUM As Integer, CveEmpresa As Integer) As DataTable
+ Get
+ Dim AppNombre As String = String.Format("GlobalDTProductosServiciosEquivalencias{0}", CveEmpresa)
+
+
+ If CvePS <> -1 OrElse CveUM <> -1 Then
+ Dim StrSQL As New StringBuilder
+ If CvePS <> -1 Then StrSQL.AppendFormat(" AND CvePS = {0}", CvePS)
+ If CveUM <> -1 Then StrSQL.AppendFormat(" AND CveUM = {0}", CveUM)
+ 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)
+ GlobalDTProductosServiciosEquivalencias = Dv.ToTable
+ Dv.Dispose()
+ Else
+ GlobalDTProductosServiciosEquivalencias = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
+ End If
+ End Get
+
+ End Property
Property GlobalDTProveedorClasificacion(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
@@ -6245,34 +6266,34 @@ Namespace Modelos
HttpContext.Current.Application("GlobalDTSATUsosCFDI") = value
End Set
End Property
- Property GlobalDTUnidadesMedida(Optional CveEmpresa As Integer = -1) As DataTable
- Get
- If CveEmpresa <> -1 Then
- Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTUnidadesMedida"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), " UnidadMedida", DataViewRowState.CurrentRows)
- GlobalDTUnidadesMedida = Dv.ToTable
- Dv.Dispose()
- Else
- GlobalDTUnidadesMedida = DirectCast(HttpContext.Current.Application("GlobalDTUnidadesMedida"), DataTable)
- End If
- End Get
- Set(value As DataTable)
- HttpContext.Current.Application("GlobalDTUnidadesMedida") = value
- End Set
- End Property
- Property GlobalDTUnidadesMedidaAlias(Optional CveEmpresa As Integer = -1) As DataTable
- Get
- If CveEmpresa <> -1 Then
- Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTUnidadesMedidaAlias"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
- GlobalDTUnidadesMedidaAlias = Dv.ToTable
- Dv.Dispose()
- Else
- GlobalDTUnidadesMedidaAlias = DirectCast(HttpContext.Current.Application("GlobalDTUnidadesMedidaAlias"), DataTable)
- End If
- End Get
- Set(value As DataTable)
- HttpContext.Current.Application("GlobalDTUnidadesMedidaAlias") = value
- End Set
- End Property
+ 'Property GlobalDTUnidadesMedida(Optional CveEmpresa As Integer = -1) As DataTable
+ ' Get
+ ' If CveEmpresa <> -1 Then
+ ' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTUnidadesMedida"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), " UnidadMedida", DataViewRowState.CurrentRows)
+ ' GlobalDTUnidadesMedida = Dv.ToTable
+ ' Dv.Dispose()
+ ' Else
+ ' GlobalDTUnidadesMedida = DirectCast(HttpContext.Current.Application("GlobalDTUnidadesMedida"), DataTable)
+ ' End If
+ ' End Get
+ ' Set(value As DataTable)
+ ' HttpContext.Current.Application("GlobalDTUnidadesMedida") = value
+ ' End Set
+ 'End Property
+ 'Property GlobalDTUnidadesMedidaAlias(Optional CveEmpresa As Integer = -1) As DataTable
+ ' Get
+ ' If CveEmpresa <> -1 Then
+ ' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTUnidadesMedidaAlias"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
+ ' GlobalDTUnidadesMedidaAlias = Dv.ToTable
+ ' Dv.Dispose()
+ ' Else
+ ' GlobalDTUnidadesMedidaAlias = DirectCast(HttpContext.Current.Application("GlobalDTUnidadesMedidaAlias"), DataTable)
+ ' End If
+ ' End Get
+ ' Set(value As DataTable)
+ ' HttpContext.Current.Application("GlobalDTUnidadesMedidaAlias") = value
+ ' End Set
+ 'End Property
Property GlobalDTEstatusOrdenCompra() As DataTable
Get
GlobalDTEstatusOrdenCompra = DirectCast(HttpContext.Current.Application("GlobalDTEstatusOrdenCompra"), DataTable)
@@ -6341,6 +6362,45 @@ Namespace Modelos
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
@@ -6698,51 +6758,64 @@ Namespace Modelos
'Fin Ruta
'Cliente
- Property GlobalDTCliente(CveEmpresa As Integer, Optional Estatus As Integer = 1) As DataTable
- Get
- If CveEmpresa <> -1 Then
-
- Dim StrSQL As New StringBuilder
- StrSQL.AppendFormat("CveEmpresa = {0}", CveEmpresa)
- If Estatus >= 0 Then StrSQL.AppendFormat(" AND EstatusBool = {0} ", Estatus)
-
- If HttpContext.Current.Application("GlobalDTCliente") Is Nothing Then
- Dim ObjClientes As New ClsClientes
- If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, -1, Estatus:=-1) Then HttpContext.Current.Application("GlobalDTCliente") = ObjClientes.DtResultados Else HttpContext.Current.Application("GlobalDTCliente") = Nothing
- ObjClientes.Dispose()
-
- Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTCliente"), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows)
- GlobalDTCliente = Dv.ToTable
- Dv.Dispose()
-
- Else
- Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTCliente"), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows)
- GlobalDTCliente = Dv.ToTable
- Dv.Dispose()
- End If
-
- Else
- GlobalDTCliente = DirectCast(HttpContext.Current.Application("GlobalDTCliente"), DataTable)
- End If
- End Get
- Set(value As DataTable)
- HttpContext.Current.Application("GlobalDTCliente") = value
- End Set
- End Property
- Property GlobalDTClienteClasificaciones(CveEmpresa As Integer) As DataTable
- Get
- If CveEmpresa <> -1 Then
-
- Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTClienteClasificaciones"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
- GlobalDTClienteClasificaciones = Dv.ToTable
- Dv.Dispose()
- Else
- GlobalDTClienteClasificaciones = DirectCast(HttpContext.Current.Application("GlobalDTClienteClasificaciones"), DataTable)
- End If
- End Get
- Set(value As DataTable)
- HttpContext.Current.Application("GlobalDTClasificacionesCliente") = value
- End Set
+ Property GlobalDTCliente(CveEmpresa As Integer, Optional Estatus As Integer = 1) As DataTable
+ Get
+ Dim AppNombre As String = String.Format("GlobalDTCliente{0}", CveEmpresa)
+ 'sino existe, recarga los datos
+ If HttpContext.Current.Application(AppNombre) Is Nothing Then
+ Dim ObjClientes As New ClsClientes
+ If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa, Estatus:=-1) Then HttpContext.Current.Application(AppNombre) = ObjClientes.DtResultados
+ ObjClientes.Dispose()
+ End If
+
+
+ If CveEmpresa <> -1 Then
+
+ Dim StrSQL As New StringBuilder
+ StrSQL.AppendFormat("CveEmpresa = {0}", CveEmpresa)
+ If Estatus >= 0 Then StrSQL.AppendFormat(" AND EstatusBool = {0} ", Estatus)
+
+ Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows)
+ GlobalDTCliente = Dv.ToTable
+ Dv.Dispose()
+
+ Else
+ GlobalDTCliente = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
+ End If
+ End Get
+ Set(value As DataTable)
+ Dim AppNombre As String = String.Format("GlobalDTCliente{0}", CveEmpresa)
+ HttpContext.Current.Application(AppNombre) = value
+ 'Dim ObjClientes As New ClsClientes
+ 'If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa, Estatus:=-1) Then Application(AppNombre) = ObjClientes.DtResultados
+ 'ObjClientes.Dispose()
+ End Set
+ End Property
+ Property GlobalDTClienteClasificaciones(CveEmpresa As Integer) As DataTable
+ Get
+ Dim AppNombre As String = String.Format("GlobalDTClienteClasificaciones{0}", CveEmpresa)
+ 'sino existe, recarga los datos
+ If HttpContext.Current.Application(AppNombre) Is Nothing Then
+ Dim ObjClientes As New ClsClientes
+ If ObjClientes.GetClienteClasificacion(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjClientes.DtResultados
+ ObjClientes.Dispose()
+ End If
+ If CveEmpresa <> -1 Then
+
+ Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
+ GlobalDTClienteClasificaciones = Dv.ToTable
+ Dv.Dispose()
+ Else
+ GlobalDTClienteClasificaciones = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
+ End If
+ End Get
+ Set(value As DataTable)
+ Dim AppNombre As String = String.Format("GlobalDTClienteClasificaciones{0}", CveEmpresa)
+ HttpContext.Current.Application(AppNombre) = value
+ 'Dim ObjClientes As New ClsClientes
+ 'If ObjClientes.GetClienteClasificacion(CveEmpresa) Then Application(AppNombre) = ObjClientes.DtResultados
+ 'ObjClientes.Dispose()
+ End Set
End Property
Property GlobalDTEstatusOrdenServicios(CveEmpresa As Integer) As DataTable
Get
diff --git a/App_Code/Timbrado.vb b/App_Code/Timbrado.vb
index dbb113a45..eb476418f 100644
--- a/App_Code/Timbrado.vb
+++ b/App_Code/Timbrado.vb
@@ -356,13 +356,15 @@ Public Class Timbrado
Else
conector.EstableceCredenciales("vSGxMFWnNRy/nDoowxqrqw==|Sia123654")
End If
-
+ MsgCancelacion.AppendFormat("-3.2")
Dim resultadoCancelacion As Profact.TimbraCFDI.ResultadoCancelacionAck
resultadoCancelacion = conector.CancelaCFDIAck(RFCEmisor, FolioFiscal)
CancelacionFecha = Now
Dim resp As Profact.TimbraCFDI.ResultadoConsulta
resp = conector.ObtieneCFDI(RFCEmisor, FolioFiscal)
+ MsgCancelacion.AppendFormat("-3.3")
If resultadoCancelacion.Exitoso Then
+ MsgCancelacion.AppendFormat("-3.4")
CancelacionMensaje = resultadoCancelacion.Descripcion
Dim xmlDoc As New System.Xml.XmlDocument()
@@ -372,20 +374,22 @@ Public Class Timbrado
xmlDoc.LoadXml(resp.Xml)
End Try
-
+ MsgCancelacion.AppendFormat("-3.4.1")
Dim xpath As String = "Acuse/Folios"
Dim nodes = xmlDoc.SelectNodes(xpath)
CancelacionState = xmlDoc.GetElementsByTagName("EstatusUUID")(0).InnerText.ToEntero
-
+ MsgCancelacion.AppendFormat("-3.4.2")
xpath = "Acuse/Signature"
nodes = xmlDoc.SelectNodes(xpath)
-
+ MsgCancelacion.AppendFormat("-3.4.3")
CancelacionAcuse = xmlDoc.GetElementsByTagName("SignatureValue")(0).InnerText
CancelacionFecha = xmlDoc.SelectSingleNode("Acuse").Attributes("Fecha").Value.ToDate
Retorno = True
Else
+ MsgCancelacion.AppendFormat("-3.5")
CancelacionAcuse = resp.NumeroError
+ CancelacionMensaje = resultadoCancelacion.Xml
Retorno = False
End If
diff --git a/App_Code/modExtensiones.vb b/App_Code/modExtensiones.vb
index 1aa05cd8a..9832061b6 100644
--- a/App_Code/modExtensiones.vb
+++ b/App_Code/modExtensiones.vb
@@ -50,10 +50,10 @@ Namespace Extensiones
Public Function CadenaConexion() As String
Dim BaseDatos As String = "Ventas"
- If Not IsNothing(System.Web.HttpContext.Current) AndAlso Not IsNothing(System.Web.HttpContext.Current.Session) Then
+ 'If Not IsNothing(System.Web.HttpContext.Current) AndAlso Not IsNothing(System.Web.HttpContext.Current.Session) Then
- BaseDatos = CType(System.Web.HttpContext.Current.Session("UsuarioSIG"), Usuario).Empresa.BaseDatosNombre
- End If
+ ' BaseDatos = CType(System.Web.HttpContext.Current.Session("UsuarioSIG"), Usuario).Empresa.BaseDatosNombre
+ 'End If
Return String.Format("Data Source=192.168.0.2;Initial Catalog={0};User Id=JCaudillo;Password=JCau127*953;pooling=True; Min Pool Size=10;Application Name=SIG;", BaseDatos)
diff --git a/Ashx/SIGFacturacion.ashx b/Ashx/SIGFacturacion.ashx
index 97adc819d..8a81cd9fa 100644
--- a/Ashx/SIGFacturacion.ashx
+++ b/Ashx/SIGFacturacion.ashx
@@ -1562,34 +1562,34 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
HttpContext.Current.Application("GlobalDTSATUsosCFDI") = value
End Set
End Property
- Property GlobalDTUnidadesMedida(Optional CveEmpresa As Integer = -1) As DataTable
- Get
- If CveEmpresa <> -1 Then
- Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTUnidadesMedida"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), " UnidadMedida", DataViewRowState.CurrentRows)
- GlobalDTUnidadesMedida = Dv.ToTable
- Dv.Dispose()
- Else
- GlobalDTUnidadesMedida = DirectCast(HttpContext.Current.Application("GlobalDTUnidadesMedida"), DataTable)
- End If
- End Get
- Set(value As DataTable)
- HttpContext.Current.Application("GlobalDTUnidadesMedida") = value
- End Set
- End Property
- Property GlobalDTUnidadesMedidaAlias(Optional CveEmpresa As Integer = -1) As DataTable
- Get
- If CveEmpresa <> -1 Then
- Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTUnidadesMedidaAlias"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
- GlobalDTUnidadesMedidaAlias = Dv.ToTable
- Dv.Dispose()
- Else
- GlobalDTUnidadesMedidaAlias = DirectCast(HttpContext.Current.Application("GlobalDTUnidadesMedidaAlias"), DataTable)
- End If
- End Get
- Set(value As DataTable)
- HttpContext.Current.Application("GlobalDTUnidadesMedidaAlias") = value
- End Set
- End Property
+ 'Property GlobalDTUnidadesMedida(Optional CveEmpresa As Integer = -1) As DataTable
+ ' Get
+ ' If CveEmpresa <> -1 Then
+ ' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTUnidadesMedida"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), " UnidadMedida", DataViewRowState.CurrentRows)
+ ' GlobalDTUnidadesMedida = Dv.ToTable
+ ' Dv.Dispose()
+ ' Else
+ ' GlobalDTUnidadesMedida = DirectCast(HttpContext.Current.Application("GlobalDTUnidadesMedida"), DataTable)
+ ' End If
+ ' End Get
+ ' Set(value As DataTable)
+ ' HttpContext.Current.Application("GlobalDTUnidadesMedida") = value
+ ' End Set
+ 'End Property
+ 'Property GlobalDTUnidadesMedidaAlias(Optional CveEmpresa As Integer = -1) As DataTable
+ ' Get
+ ' If CveEmpresa <> -1 Then
+ ' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTUnidadesMedidaAlias"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
+ ' GlobalDTUnidadesMedidaAlias = Dv.ToTable
+ ' Dv.Dispose()
+ ' Else
+ ' GlobalDTUnidadesMedidaAlias = DirectCast(HttpContext.Current.Application("GlobalDTUnidadesMedidaAlias"), DataTable)
+ ' End If
+ ' End Get
+ ' Set(value As DataTable)
+ ' HttpContext.Current.Application("GlobalDTUnidadesMedidaAlias") = value
+ ' End Set
+ 'End Property
Property GlobalDTEstatusOrdenCompra() As DataTable
Get
GlobalDTEstatusOrdenCompra = DirectCast(HttpContext.Current.Application("GlobalDTEstatusOrdenCompra"), DataTable)
@@ -1657,44 +1657,44 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
HttpContext.Current.Application("GlobalDTProyectos") = value
End Set
End Property
- Property GlobalDTSubProyectos(CveProyecto As Integer, Optional CveSubProyecto As Integer = -1, Optional CveEmpresa As Integer = -1, Optional Estatus As Integer = 1) As DataTable
- Get
+ 'Property GlobalDTSubProyectos(CveProyecto As Integer, Optional CveSubProyecto As Integer = -1, Optional CveEmpresa As Integer = -1, Optional Estatus As Integer = 1) As DataTable
+ ' Get
- If DirectCast(HttpContext.Current.Application("GlobalDTSubProyectos"), DataTable) Is Nothing Or (DirectCast(HttpContext.Current.Application("GlobalDTSubProyectos"), DataTable) IsNot Nothing AndAlso DirectCast(HttpContext.Current.Application("GlobalDTSubProyectos"), DataTable).Rows.Count = 0) Then
- Dim P As New ClsSubProyectos
- If P.GetSubProyectos Then
- HttpContext.Current.Application("GlobalDTSubProyectos") = P.DtResultados
- End If
- P.Dispose()
+ ' If DirectCast(HttpContext.Current.Application("GlobalDTSubProyectos"), DataTable) Is Nothing Or (DirectCast(HttpContext.Current.Application("GlobalDTSubProyectos"), DataTable) IsNot Nothing AndAlso DirectCast(HttpContext.Current.Application("GlobalDTSubProyectos"), DataTable).Rows.Count = 0) Then
+ ' Dim P As New ClsSubProyectos
+ ' If P.GetSubProyectos Then
+ ' HttpContext.Current.Application("GlobalDTSubProyectos") = P.DtResultados
+ ' End If
+ ' P.Dispose()
- Dim msg As String = "aqui no se carga subproyectos"
+ ' Dim msg As String = "aqui no se carga subproyectos"
- End If
+ ' 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)
+ ' 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("GlobalDTSubProyectos"), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows)
- GlobalDTSubProyectos = Dv.ToTable
- Dv.Dispose()
+ ' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTSubProyectos"), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows)
+ ' GlobalDTSubProyectos = Dv.ToTable
+ ' Dv.Dispose()
- Else
- GlobalDTSubProyectos = DirectCast(HttpContext.Current.Application("GlobalDTSubProyectos"), DataTable)
- End If
+ ' Else
+ ' GlobalDTSubProyectos = DirectCast(HttpContext.Current.Application("GlobalDTSubProyectos"), DataTable)
+ ' End If
- End Get
- Set(ByVal value As DataTable)
- If value Is Nothing OrElse value.Rows.Count = 0 Then
- Dim msg As String = "aqui no se carga subproyectos"
+ ' End Get
+ ' Set(ByVal value As DataTable)
+ ' If value Is Nothing OrElse value.Rows.Count = 0 Then
+ ' Dim msg As String = "aqui no se carga subproyectos"
- End If
- HttpContext.Current.Application("GlobalDTSubProyectos") = value
- End Set
- End Property
+ ' End If
+ ' HttpContext.Current.Application("GlobalDTSubProyectos") = 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
@@ -2085,48 +2085,61 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
'Cliente
Property GlobalDTCliente(CveEmpresa As Integer, Optional Estatus As Integer = 1) As DataTable
Get
+ Dim AppNombre As String = String.Format("GlobalDTCliente{0}", CveEmpresa)
+ 'sino existe, recarga los datos
+ If HttpContext.Current.Application(AppNombre) Is Nothing Then
+ Dim ObjClientes As New ClsClientes
+ If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa, Estatus:=-1) Then HttpContext.Current.Application(AppNombre) = ObjClientes.DtResultados
+ ObjClientes.Dispose()
+ End If
+
+
If CveEmpresa <> -1 Then
Dim StrSQL As New StringBuilder
StrSQL.AppendFormat("CveEmpresa = {0}", CveEmpresa)
If Estatus >= 0 Then StrSQL.AppendFormat(" AND EstatusBool = {0} ", Estatus)
- If HttpContext.Current.Application("GlobalDTCliente") Is Nothing Then
- Dim ObjClientes As New ClsClientes
- If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, -1, Estatus:=-1) Then HttpContext.Current.Application("GlobalDTCliente") = ObjClientes.DtResultados Else HttpContext.Current.Application("GlobalDTCliente") = Nothing
- ObjClientes.Dispose()
-
- Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTCliente"), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows)
- GlobalDTCliente = Dv.ToTable
- Dv.Dispose()
-
- Else
- Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTCliente"), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows)
- GlobalDTCliente = Dv.ToTable
- Dv.Dispose()
- End If
+ Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows)
+ GlobalDTCliente = Dv.ToTable
+ Dv.Dispose()
Else
- GlobalDTCliente = DirectCast(HttpContext.Current.Application("GlobalDTCliente"), DataTable)
+ GlobalDTCliente = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End If
End Get
Set(value As DataTable)
- HttpContext.Current.Application("GlobalDTCliente") = value
+ Dim AppNombre As String = String.Format("GlobalDTCliente{0}", CveEmpresa)
+ HttpContext.Current.Application(AppNombre) = value
+ 'Dim ObjClientes As New ClsClientes
+ 'If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa, Estatus:=-1) Then Application(AppNombre) = ObjClientes.DtResultados
+ 'ObjClientes.Dispose()
End Set
End Property
Property GlobalDTClienteClasificaciones(CveEmpresa As Integer) As DataTable
Get
+ Dim AppNombre As String = String.Format("GlobalDTClienteClasificaciones{0}", CveEmpresa)
+ 'sino existe, recarga los datos
+ If HttpContext.Current.Application(AppNombre) Is Nothing Then
+ Dim ObjClientes As New ClsClientes
+ If ObjClientes.GetClienteClasificacion(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjClientes.DtResultados
+ ObjClientes.Dispose()
+ End If
If CveEmpresa <> -1 Then
- Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTClienteClasificaciones"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
+ Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTClienteClasificaciones = Dv.ToTable
Dv.Dispose()
Else
- GlobalDTClienteClasificaciones = DirectCast(HttpContext.Current.Application("GlobalDTClienteClasificaciones"), DataTable)
+ GlobalDTClienteClasificaciones = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End If
End Get
Set(value As DataTable)
- HttpContext.Current.Application("GlobalDTClasificacionesCliente") = value
+ Dim AppNombre As String = String.Format("GlobalDTClienteClasificaciones{0}", CveEmpresa)
+ HttpContext.Current.Application(AppNombre) = value
+ 'Dim ObjClientes As New ClsClientes
+ 'If ObjClientes.GetClienteClasificacion(CveEmpresa) Then Application(AppNombre) = ObjClientes.DtResultados
+ 'ObjClientes.Dispose()
End Set
End Property
Property GlobalDTEstatusOrdenServicios(CveEmpresa As Integer) As DataTable
diff --git a/Ashx/SIGWeb.ashx b/Ashx/SIGWeb.ashx
index 0dc50dcd3..a1d1c9720 100644
--- a/Ashx/SIGWeb.ashx
+++ b/Ashx/SIGWeb.ashx
@@ -1,72 +1,72 @@
<%@ WebHandler Language="VB" Class="SIGWeb" %>
-Imports System
-Imports System.Web
-Imports System.Data
-Imports Newtonsoft.Json
-Imports Extensiones
-Imports System.IO
-
-Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
-
- Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
- context.Response.ContentType = "text/plain"
- Try
- Select Case context.Request("metodo")
- Case "getps"
- GETPS(context)
- Case "getps2"
- GETPS(context, "PSCodigoClasificacion")
- Case "getpsalmacen"
- getpsalmacen(context)
- Case "Uploadfile"
- uploadfile(context)
- Case "Downfile"
- Downfile(context)
- Case "GetImg"
- GetImg(context)
- Case "getpssat"
- GETPSSAT(context)
- Case "getpsusados"
- GETPSUSADOS(context)
- Case "getumsat"
- GETUMSAT(context)
- Case "getcliente"
- GetClientes(context)
- Case "getproveedores"
- GetProveedores(context)
- Case "getfraccionarancelaria"
- GetFraccionArancelaria(context)
- Case "GetUser"
+Imports System
+Imports System.Web
+Imports System.Data
+Imports Newtonsoft.Json
+Imports Extensiones
+Imports System.IO
+
+Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
+
+ Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
+ context.Response.ContentType = "text/plain"
+ Try
+ Select Case context.Request("metodo")
+ Case "getps"
+ GETPS(context)
+ Case "getps2"
+ GETPS(context, "PSCodigoClasificacion")
+ Case "getpsalmacen"
+ getpsalmacen(context)
+ Case "Uploadfile"
+ uploadfile(context)
+ Case "Downfile"
+ Downfile(context)
+ Case "GetImg"
+ GetImg(context)
+ Case "getpssat"
+ GETPSSAT(context)
+ Case "getpsusados"
+ GETPSUSADOS(context)
+ Case "getumsat"
+ GETUMSAT(context)
+ Case "getcliente"
+ GetClientes(context)
+ Case "getproveedores"
+ GetProveedores(context)
+ Case "getfraccionarancelaria"
+ GetFraccionArancelaria(context)
+ Case "GetUser"
GetUser(context)
- Case "ActualizaPreP"
- ActualizaPrePoliza(context)
-
- End Select
- Catch ex As Exception
- ex.GuardaLog(ex.Message)
- End Try
- End Sub
-
-
- Private Sub GetUser(ByVal context As HttpContext)
- Dim usuario As String = context.Request("usuario").ToString()
- Dim CveUsuario As Integer = -1
- Dim objs As New ClsSisUsuarios
- objs.GetWSusuarios(usuario)
- If objs.DtResultados.Rows.Count > 0 Then
- CveUsuario = objs.DtResultados.Rows(0)("CveUsuario").ToString().ToEntero()
- End If
- objs.Dispose()
- If CveUsuario > 0 Then
- CveUsuario = 1
- End If
-
- context.Response.Write(CveUsuario.ToString())
- context.Response.StatusCode = 200
+ Case "ActualizaPreP"
+ ActualizaPrePoliza(context)
+
+ End Select
+ Catch ex As Exception
+ ex.GuardaLog(ex.Message)
+ End Try
End Sub
- Private Sub ActualizaPrePoliza(ByVal context As HttpContext)
+
+ Private Sub GetUser(ByVal context As HttpContext)
+ Dim usuario As String = context.Request("usuario").ToString()
+ Dim CveUsuario As Integer = -1
+ Dim objs As New ClsSisUsuarios
+ objs.GetWSusuarios(usuario)
+ If objs.DtResultados.Rows.Count > 0 Then
+ CveUsuario = objs.DtResultados.Rows(0)("CveUsuario").ToString().ToEntero()
+ End If
+ objs.Dispose()
+ If CveUsuario > 0 Then
+ CveUsuario = 1
+ End If
+
+ context.Response.Write(CveUsuario.ToString())
+ context.Response.StatusCode = 200
+ End Sub
+
+ Private Sub ActualizaPrePoliza(ByVal context As HttpContext)
Dim CvePrePoliza As Integer = context.Request("CvePrePoliza").ToString.ToEntero
Dim CveEmpresa As Integer = context.Request("CveEmpresa").ToString.ToEntero
Dim CveUsuario As Integer = context.Request("CveUsuario").ToString.ToEntero
@@ -96,555 +96,594 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
ObjConta.Dispose()
'context.Response.Write(CveUsuario.ToString())
- context.Response.StatusCode = Retorno
- End Sub
-
- Private Sub GetImg(ByVal context As HttpContext)
- Dim Url As String = Decripta(context.Request("r").ToString)
-
- Dim usuario As Usuario = UsuarioActual(context)
- If Not IsNothing(usuario) Then
- Url = String.Format("{0}Empresas\{1}\{2}", AppDomain.CurrentDomain.BaseDirectory, usuario.CveEmpresa, Url)
- Dim FileInfo As FileInfo = New FileInfo(Url)
- If FileInfo.Exists Then
- context.Response.ContentType = "image/png"
- context.Response.Flush()
- context.Response.WriteFile(FileInfo.FullName)
- context.Response.End()
- End If
-
- End If
+ context.Response.StatusCode = Retorno
End Sub
-#Region "File"
+ Private Sub GetImg(ByVal context As HttpContext)
+ Dim Url As String = Decripta(context.Request("r").ToString)
- Private Sub Downfile(ByVal context As HttpContext)
- Dim savepath As String = ""
- Dim tempPath As String = ""
- tempPath = String.Format("{0}{1}", System.Configuration.ConfigurationManager.AppSettings("FolderPath"), "/Temp")
- savepath = context.Server.MapPath(tempPath)
- Dim nombre As String = String.Format("{0}\{1}", savepath, context.Request("nombre"))
- File.Delete(nombre)
- context.Response.StatusCode = 200
- End Sub
-
- Private Sub uploadfile(ByVal context As HttpContext)
- Dim postedFile As HttpPostedFile
- Dim savepath As String = ""
- Dim tempPath As String = ""
- tempPath = String.Format("{0}{1}", System.Configuration.ConfigurationManager.AppSettings("FolderPath"), "/Temp")
- savepath = context.Server.MapPath(tempPath)
- Dim filename As String
- Dim tick As String
- tick = (DateTime.Now.Ticks + 1).ToString()
- If Not Directory.Exists(savepath) Then
- Directory.CreateDirectory(savepath)
- End If
- If context.Request.Files.Count = 0 Then
- Dim copyFile As String = context.Request("File")
- Dim Cve As String = context.Request("Cve")
-
- If copyFile <> "" Then
- Dim ext As Integer = copyFile.IndexOf(","c) + 1
-
- Dim extncion As String = copyFile.Substring(5, ext - 5)
- If extncion.Contains("image/") Then extncion = extncion.Replace("image/", "").Replace(";base64,", "")
- 'Dim extncion As String =
- filename = String.Format("{0}-{1}.{2}", tick, Cve, extncion)
-
- Dim msf As New MemoryStream(Convert.FromBase64String(copyFile.Substring(ext)))
- Dim stem As Stream = New FileStream(String.Format("{0}\{1}", savepath, filename), FileMode.Create)
- msf.WriteTo(stem)
- msf.Close()
- stem.Close()
-
- End If
- Else
-
- postedFile = context.Request.Files(0)
- filename = String.Format("{0}-{1}", tick, postedFile.FileName)
-
- postedFile.SaveAs((savepath & "\") + filename)
- End If
- context.Response.Write(tick)
- context.Response.StatusCode = 200
+ Dim usuario As Usuario = UsuarioActual(context)
+ If Not IsNothing(usuario) Then
+ Url = String.Format("{0}Empresas\{1}\{2}", AppDomain.CurrentDomain.BaseDirectory, usuario.CveEmpresa, Url)
+ Dim FileInfo As FileInfo = New FileInfo(Url)
+ If FileInfo.Exists Then
+ context.Response.ContentType = "image/png"
+ context.Response.Flush()
+ context.Response.WriteFile(FileInfo.FullName)
+ context.Response.End()
+ End If
+
+ End If
End Sub
-#End Region
-#Region "Get Cliente"
- Private Function GetClientes(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 dt As DataTable = DirectCast(context.Application("GlobalDTCliente"), DataTable).FiltraParametros($"CveEmpresa = {CveEmpresa}")
- If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
- DtRetorno = dt.FiltraParametros($"NombreComercial like '%{Name}%'")
- End If
- End If
-
- If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then
- DtRetorno.Columns("CveCliente").ColumnName = "id"
- DtRetorno.Columns("NombreComercial").ColumnName = "text"
- retorno = JsonConvert.SerializeObject(DtRetorno).ToString
- context.Response.Write(retorno)
- Else
- context.Response.Write("[]")
- End If
-
- Return retorno
+#Region "File"
+
+ Private Sub Downfile(ByVal context As HttpContext)
+ Dim savepath As String = ""
+ Dim tempPath As String = ""
+ tempPath = String.Format("{0}{1}", System.Configuration.ConfigurationManager.AppSettings("FolderPath"), "/Temp")
+ savepath = context.Server.MapPath(tempPath)
+ Dim nombre As String = String.Format("{0}\{1}", savepath, context.Request("nombre"))
+ File.Delete(nombre)
+ context.Response.StatusCode = 200
+ End Sub
+
+ Private Sub uploadfile(ByVal context As HttpContext)
+ Dim postedFile As HttpPostedFile
+ Dim savepath As String = ""
+ Dim tempPath As String = ""
+ tempPath = String.Format("{0}{1}", System.Configuration.ConfigurationManager.AppSettings("FolderPath"), "/Temp")
+ savepath = context.Server.MapPath(tempPath)
+ Dim filename As String
+ Dim tick As String
+ tick = (DateTime.Now.Ticks + 1).ToString()
+ If Not Directory.Exists(savepath) Then
+ Directory.CreateDirectory(savepath)
+ End If
+ If context.Request.Files.Count = 0 Then
+ Dim copyFile As String = context.Request("File")
+ Dim Cve As String = context.Request("Cve")
+
+ If copyFile <> "" Then
+ Dim ext As Integer = copyFile.IndexOf(","c) + 1
+
+ Dim extncion As String = copyFile.Substring(5, ext - 5)
+ If extncion.Contains("image/") Then extncion = extncion.Replace("image/", "").Replace(";base64,", "")
+ 'Dim extncion As String =
+ filename = String.Format("{0}-{1}.{2}", tick, Cve, extncion)
+
+ Dim msf As New MemoryStream(Convert.FromBase64String(copyFile.Substring(ext)))
+ Dim stem As Stream = New FileStream(String.Format("{0}\{1}", savepath, filename), FileMode.Create)
+ msf.WriteTo(stem)
+ msf.Close()
+ stem.Close()
+
+ End If
+ Else
+
+ postedFile = context.Request.Files(0)
+ filename = String.Format("{0}-{1}", tick, postedFile.FileName)
+
+ postedFile.SaveAs((savepath & "\") + filename)
+ End If
+ context.Response.Write(tick)
+ context.Response.StatusCode = 200
+ End Sub
+#End Region
+
+#Region "Get Cliente"
+ Private Function GetClientes(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 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) 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($"CveEmpresa = {CveEmpresa}")
+ If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
+ DtRetorno = dt.FiltraParametros($"NombreComercial like '%{Name}%'")
+ End If
+ End If
+
+ If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then
+ DtRetorno.Columns("CveCliente").ColumnName = "id"
+ DtRetorno.Columns("NombreComercial").ColumnName = "text"
+ retorno = JsonConvert.SerializeObject(DtRetorno).ToString
+ context.Response.Write(retorno)
+ Else
+ context.Response.Write("[]")
+ End If
+
+ Return retorno
End Function
-#End Region
+#End Region
-#Region "Get Proveedor"
- Private Function GetProveedores(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 dt As DataTable = DirectCast(context.Application("GlobalDTCompProveedores"), DataTable).FiltraParametros($"CveEmpresa = {CveEmpresa}")
- If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
- DtRetorno = dt.FiltraParametros($"RazonSocial like '%{Name}%'")
- End If
- End If
-
- If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then
- DtRetorno.Columns("CveProveedor").ColumnName = "id"
- DtRetorno.Columns("RazonSocial").ColumnName = "text"
- retorno = JsonConvert.SerializeObject(DtRetorno).ToString
- context.Response.Write(retorno)
- Else
- context.Response.Write("[]")
- End If
-
- Return retorno
+#Region "Get Proveedor"
+ Private Function GetProveedores(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 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($"CveEmpresa = {CveEmpresa}")
+ If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
+ DtRetorno = dt.FiltraParametros($"RazonSocial like '%{Name}%'")
+ End If
+ End If
+
+ If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then
+ DtRetorno.Columns("CveProveedor").ColumnName = "id"
+ DtRetorno.Columns("RazonSocial").ColumnName = "text"
+ retorno = JsonConvert.SerializeObject(DtRetorno).ToString
+ context.Response.Write(retorno)
+ Else
+ context.Response.Write("[]")
+ End If
+
+ Return retorno
End Function
-#End Region
+#End Region
-#Region " GET PS "
- Private Function getpsalmacen(ByVal context As HttpContext) As String
-
- Dim usuario As Usuario = UsuarioActual(context)
- Dim CveEmpresa As String
- Dim retorno As String = ""
- Dim DtPSRetorno As DataTable = Nothing
-
- If IsNothing(usuario) Then
- context.Response.Write("")
- Else
- CveEmpresa = usuario.CveEmpresa
-
- DtPSRetorno = New DataTable
- DtPSRetorno.Columns.Add(New DataColumn("id", System.Type.GetType("System.Int32")))
- DtPSRetorno.Columns.Add(New DataColumn("existencia", System.Type.GetType("System.Int32")))
- DtPSRetorno.Columns.Add(New DataColumn("almacen", System.Type.GetType("System.String")))
-
- Dim CvePS = IfNull(context.Request("cveps"), "0").ToString.ToEntero
- Dim objInv As New ClsInventarios
- If objInv.GetExistenciasProducto(CvePS, -1, CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm")) Then
-
- ' limpio los almacenes donde no tiene ningun producto existencia
- For i = objInv.DtResultados.Columns.Count - 1 To 1 Step -1
-
- If Not objInv.DtResultados.Columns(i).ColumnName.Contiene("CveAlmacen", "Almacen", "Existencia") Then
- objInv.DtResultados.Columns.RemoveAt(i)
- End If
- Next
-
- DtPSRetorno = objInv.DtResultados.FiltraParametros("CveAlmacen > 0 and Existencia > 0")
- End If
-
- objInv.Dispose()
-
- End If
-
- If DtPSRetorno IsNot Nothing AndAlso DtPSRetorno.Rows.Count > 0 Then
- DtPSRetorno.Columns("CveAlmacen").ColumnName = "id"
- DtPSRetorno.Columns("Almacen").ColumnName = "almacen"
- DtPSRetorno.Columns("Existencia").ColumnName = "existencia"
- retorno = JsonConvert.SerializeObject(DtPSRetorno).ToString
- context.Response.Write(retorno)
- Else
- context.Response.Write("[]")
- End If
-
- Return retorno
- End Function
-
- Private Function GETPS(ByVal context As HttpContext, Optional PSCodigoDescripcion As String = "PSCodigo") As String
- Dim retorno As String = ""
- Dim DtPSRetorno As DataTable = Nothing
-
- 'NOTA:
- ' EN EL WHERE DE LINQ NO SE DEBE USAS EL OPERADOR 'AND' SABE PORQUE FUNCIONA DIFERENTE SE DEBE USAR 'ANDALSO',
- ' EJEMPLO UNA CONDICION AND DE DOS CAMPOS ARROJA CERO RESULTADOS PERO SI SE PONE ESTAS DOS CONDICIONES POR SEPARADO ARROJA DATOS
- Dim usuario As Usuario = UsuarioActual(context)
- Dim CveEmpresa As String
- If IsNothing(usuario) Then
- context.Response.Write("")
- Else
- CveEmpresa = usuario.CveEmpresa
- Dim FuePorXml = IfNull(context.Request("FuePorXml"), "-1").ToString.ToEntero
- Dim Name = IfNull(context.Request("Name"), "-1").ToString
- Dim CveClasificacion = IfNull(context.Request("CveClasificacion"), "-1").ToString.ToEntero
- Dim CveSubFamilia = IfNull(context.Request("CveSubFamilia"), "-1").ToString.ToEntero
- Dim CveClasificacionPresupuesto = IfNull(context.Request("CveClasificacionPresupuesto"), "-1").ToString.ToEntero
- Dim Pagina = IfNull(context.Request("Pagina"), "-1").ToString
- Dim Estatus = IfNull(context.Request("Estatus"), "1").ToString
- Dim CveSucursal = IfNull(context.Request("cvesucursal"), "-1").ToString.ToEntero
- Dim CveSubProyecto = IfNull(context.Request("cvesubproyecto"), "-1").ToString.ToEntero
- Dim UsoClasificacion = IfNull(context.Request("usoclasificacion"), "-1").ToString.ToEntero
- Dim AplicaParaVenta = IfNull(context.Request("aplicaparaventa"), "-1").ToString.ToEntero
-
- Dim UsaGlobal As Boolean = True
-
-
- 'verifica existencias
- If Pagina.Contiene("ventas/ventas", "oc/oc", "inv/traspaso") AndAlso CveEmpresa.Contiene(72, 80, 119, 140, 141) Then
- UsaGlobal = False
-
- Dim objInv As New ClsInventarios
- If objInv.GetExistenciasProductosLike(Name, CveClasificacion, CveSubProyecto, Estatus.ToEntero, AplicaParaVenta, CveEmpresa) Then
-
- ' limpio los almacenes donde no tiene ningun producto existencia
- For i = objInv.DtResultados.Columns.Count - 1 To 1 Step -1
+#Region " GET PS "
+ Private Function getpsalmacen(ByVal context As HttpContext) As String
- If Not objInv.DtResultados.Columns(i).ColumnName.Contiene("CvePS", "PSCodigo", "PSCodigoClasificacion") AndAlso objInv.DtResultados.SUM(String.Format("[{0}]", objInv.DtResultados.Columns(i).ColumnName)) = 0 Then
- objInv.DtResultados.Columns.RemoveAt(i)
- End If
- Next
+ Dim usuario As Usuario = UsuarioActual(context)
+ Dim CveEmpresa As String
+ Dim retorno As String = ""
+ Dim DtPSRetorno As DataTable = Nothing
+
+ If IsNothing(usuario) Then
+ context.Response.Write("")
+ Else
+ CveEmpresa = usuario.CveEmpresa
+
+ DtPSRetorno = New DataTable
+ DtPSRetorno.Columns.Add(New DataColumn("id", System.Type.GetType("System.Int32")))
+ DtPSRetorno.Columns.Add(New DataColumn("existencia", System.Type.GetType("System.Int32")))
+ DtPSRetorno.Columns.Add(New DataColumn("almacen", System.Type.GetType("System.String")))
+
+ Dim CvePS = IfNull(context.Request("cveps"), "0").ToString.ToEntero
+ Dim objInv As New ClsInventarios
+ If objInv.GetExistenciasProducto(CvePS, -1, CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm")) Then
+
+ ' limpio los almacenes donde no tiene ningun producto existencia
+ For i = objInv.DtResultados.Columns.Count - 1 To 1 Step -1
+
+ If Not objInv.DtResultados.Columns(i).ColumnName.Contiene("CveAlmacen", "Almacen", "Existencia") Then
+ objInv.DtResultados.Columns.RemoveAt(i)
+ End If
+ Next
+
+ DtPSRetorno = objInv.DtResultados.FiltraParametros("CveAlmacen > 0 and Existencia > 0")
+ End If
+
+ objInv.Dispose()
+
+ End If
+
+ If DtPSRetorno IsNot Nothing AndAlso DtPSRetorno.Rows.Count > 0 Then
+ DtPSRetorno.Columns("CveAlmacen").ColumnName = "id"
+ DtPSRetorno.Columns("Almacen").ColumnName = "almacen"
+ DtPSRetorno.Columns("Existencia").ColumnName = "existencia"
+ retorno = JsonConvert.SerializeObject(DtPSRetorno).ToString
+ context.Response.Write(retorno)
+ Else
+ context.Response.Write("[]")
+ End If
+
+ Return retorno
+ End Function
+
+ Private Function GETPS(ByVal context As HttpContext, Optional PSCodigoDescripcion As String = "PSCodigo") As String
+ Dim retorno As String = ""
+ Dim DtPSRetorno As DataTable = Nothing
+
+ 'NOTA:
+ ' EN EL WHERE DE LINQ NO SE DEBE USAS EL OPERADOR 'AND' SABE PORQUE FUNCIONA DIFERENTE SE DEBE USAR 'ANDALSO',
+ ' EJEMPLO UNA CONDICION AND DE DOS CAMPOS ARROJA CERO RESULTADOS PERO SI SE PONE ESTAS DOS CONDICIONES POR SEPARADO ARROJA DATOS
+ Dim usuario As Usuario = UsuarioActual(context)
+ Dim CveEmpresa As String
+ If IsNothing(usuario) Then
+ context.Response.Write("")
+ Else
+ CveEmpresa = usuario.CveEmpresa
+ Dim FuePorXml = IfNull(context.Request("FuePorXml"), "-1").ToString.ToEntero
+ Dim Name = IfNull(context.Request("Name"), "-1").ToString
+ Dim CveClasificacion = IfNull(context.Request("CveClasificacion"), "-1").ToString.ToEntero
+ Dim CveSubFamilia = IfNull(context.Request("CveSubFamilia"), "-1").ToString.ToEntero
+ Dim CveClasificacionPresupuesto = IfNull(context.Request("CveClasificacionPresupuesto"), "-1").ToString.ToEntero
+ Dim Pagina = IfNull(context.Request("Pagina"), "-1").ToString
+ Dim Estatus = IfNull(context.Request("Estatus"), "1").ToString
+ Dim CveSucursal = IfNull(context.Request("cvesucursal"), "-1").ToString.ToEntero
+ Dim CveSubProyecto = IfNull(context.Request("cvesubproyecto"), "-1").ToString.ToEntero
+ Dim UsoClasificacion = IfNull(context.Request("usoclasificacion"), "-1").ToString.ToEntero
+ Dim AplicaParaVenta = IfNull(context.Request("aplicaparaventa"), "-1").ToString.ToEntero
+
+ Dim UsaGlobal As Boolean = True
+
+
+ 'verifica existencias
+ If Pagina.Contiene("ventas/ventas", "oc/oc", "inv/traspaso") AndAlso CveEmpresa.Contiene(72, 80, 119, 140, 141) Then
+ UsaGlobal = False
+
+ Dim objInv As New ClsInventarios
+ If objInv.GetExistenciasProductosLike(Name, CveClasificacion, CveSubProyecto, Estatus.ToEntero, AplicaParaVenta, CveEmpresa) Then
+
+ ' limpio los almacenes donde no tiene ningun producto existencia
+
+ Dim i As Integer = 0
+ While i < objInv.DtResultados.Columns.Count
+
+ If Not objInv.DtResultados.Columns(i).ColumnName.Contiene("CvePS", "PSCodigo", "PSCodigoClasificacion") AndAlso objInv.DtResultados.SUM(String.Format("[{0}]", objInv.DtResultados.Columns(i).ColumnName)) = 0 Then
+ objInv.DtResultados.Columns.RemoveAt(i)
+ Else
+ i = i + 1
+ End If
+ End While
DtPSRetorno = objInv.DtResultados
- End If
-
- objInv.Dispose()
-
+ End If
+
+ objInv.Dispose()
+
End If
If usuario.Empresa.Funcionalidad(558) = "1" Then
Try
- Dim NobreFiltroColumna As String = DtPSRetorno.Columns(3).ColumnName
- DtPSRetorno = DtPSRetorno.FiltraParametros($"{NobreFiltroColumna} > 0")
+ Dim NombreFiltroColumna As String = DtPSRetorno.Columns(3).ColumnName
+ DtPSRetorno = DtPSRetorno.FiltraParametros("", String.Format("{0} DESC,PSCodigo", NombreFiltroColumna))
Catch ex As Exception
End Try
- End If
-
+ End If
+
+ 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()
+
+ End If
+
+
+ Dim DTPS = DirectCast(context.Application(AppNombre), EnumerableRowCollection(Of DataRow))
+ 'Dim DTPS = ClsPaginas.GlobalDTPSSimplificado(CveEmpresa).AsEnumerable
+
+ If DTPS IsNot Nothing Then
+
+
+ 'APLICACION DE FILTROS
+ DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveEmpresa) = CveEmpresa))
+ If Estatus = 1 Then
+ DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveEstado) = 1))
+ ElseIf Estatus = -1 Then
+
+ End If
+
+ 'If FuePorXml >= 0 Then
+ ' DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!FuePorXML) = FuePorXml))
+ 'End If
+
+ If Name <> "-1" Then
+ If PSCodigoDescripcion = "PSCodigo" Then
+ DTPS = DTPS.Where((Function(a) a!PSCodigo.ToString.ToLower Like ("*" + Name.ToLower + "*")))
+ Else
+ DTPS = DTPS.Where((Function(a) a!PSCodigoClasificacion.ToString.ToLower Like ("*" + Name.ToLower + "*")))
+ End If
+ End If
+
+ If CveClasificacion > 0 Then
+ DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveClasificacion) = CveClasificacion))
+ ElseIf CveClasificacion = -1 Then
+ DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveClasificacion) >= 0))
+ End If
+
+ If AplicaParaVenta > 0 Then
+ DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!AplicaParaVenta) = 1))
+ End If
+
+ 'If CveSubFamilia > 0 Then
+ ' DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveSubFamilia) = CveSubFamilia))
+ ' 'ElseIf CveSubFamilia = -1 Then
+ ' 'DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveSubFamilia) > 0))
+ 'End If
+
+ If CveClasificacionPresupuesto > 0 Then
+ DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveClasificacionPresupuesto) = CveClasificacionPresupuesto))
+ End If
+
+ If UsoClasificacion > 0 Then DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!UsoClasificacion) = UsoClasificacion))
+
+ If Pagina <> "-1" Then
+ If Pagina = "Compras" Then
+ DTPS = DTPS.Where((Function(a) a!CveTipoPS = 1 AndAlso a!CveEstado = 1))
+ ElseIf Pagina = "Compras2" Then
+ DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveTipoPS) = 1 AndAlso (Convert.ToInt32(a!CveEstado) = 1 OrElse Convert.ToInt32(a!CveEstado) = 2)))
+ ElseIf Pagina = "Inventarios" Then
+ DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveTipoPS) = 2))
+ End If
+ End If
+
+ 'Try, generado para cuando el resultado no tiene valores(The source contains no DataRows.), no detenga la ejecucion, no se le puso un count previo, porque el costo se duplica, al preguntar y luego ordenar y convertir a datatable
+ Try
+ DtPSRetorno = New DataView(DTPS.OrderBy(Function(a) a!PSCodigo).CopyToDataTable).ToTable(True, {"CvePS", "PSCodigo", "PSCodigoClasificacion"})
+
+ Catch ex As Exception
+ DtPSRetorno = Nothing
+ End Try
+
+ End If
+ 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
+ DtPSRetorno.Columns().Remove("PSCodigoClasificacion")
+ Else
+ DtPSRetorno.Columns().Remove("PSCodigo")
+ End If
+ retorno = JsonConvert.SerializeObject(DtPSRetorno).ToString
+ context.Response.Write(retorno)
+ Else
+ context.Response.Write("[]")
+ End If
+ End If
+
+ Return retorno
+ 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 serializer As System.Web.Script.Serialization.JavaScriptSerializer = New System.Web.Script.Serialization.JavaScriptSerializer()
+ Dim rows As New List(Of Dictionary(Of String, Object))
+ Dim row As Dictionary(Of String, Object)
+
+ For Each dr As DataRow In dt.Rows
+ row = New Dictionary(Of String, Object)
+ For Each col As DataColumn In dt.Columns
+ row.Add(col.ColumnName, dr(col))
+ Next
+ rows.Add(row)
+ Next
+ Return serializer.Serialize(rows)
+ End Function
+ ReadOnly Property UsuarioActual(ByVal context As HttpContext) As Usuario
+ Get
+ UsuarioActual = DirectCast(context.Session("UsuarioSIG"), Usuario)
+ End Get
+ End Property
+#End Region
+
+
+#Region " GET PS SAT "
+ 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"})
+
+ If DtPSRetorno IsNot Nothing AndAlso DtPSRetorno.Rows.Count > 0 Then
+ DtPSRetorno.Columns("CveSATPS").ColumnName = "id"
+ DtPSRetorno.Columns("SATClaveProductoServicio").ColumnName = "text"
+ retorno = JsonConvert.SerializeObject(DtPSRetorno).ToString
+ context.Response.Write(retorno)
+ Else
+ context.Response.Write("[]")
+ End If
+ DtPSRetorno.Dispose()
+ Return retorno
+ End Function
+#End Region
+
+
+#Region " GET UM SAT "
+ Private Function GETUMSAT(ByVal context As HttpContext) As String
+ Dim retorno As String = ""
+
+ Dim DTUM = DirectCast(context.Application("GlobalDTPSATUM"), EnumerableRowCollection(Of DataRow))
+ Dim DtPSRetorno As DataTable
+
+ Dim Name = IfNull(context.Request("Name"), "-1").ToString
+
+ If Name <> "-1" Then
+ DTUM = DTUM.Where((Function(a) a!ClaveNombre.ToString.ToLower Like ("*" + Name.ToLower + "*")))
+ End If
+
+ DtPSRetorno = New DataView(DTUM.OrderBy(Function(a) a!Nombre).CopyToDataTable).ToTable(True, {"CveSATUnidadMedida", "ClaveNombre"})
+
+ If DtPSRetorno IsNot Nothing AndAlso DtPSRetorno.Rows.Count > 0 Then
+ DtPSRetorno.Columns("CveSATUnidadMedida").ColumnName = "id"
+ DtPSRetorno.Columns("ClaveNombre").ColumnName = "text"
+ retorno = JsonConvert.SerializeObject(DtPSRetorno).ToString
+ context.Response.Write(retorno)
+ Else
+ context.Response.Write("[]")
+ End If
+ Return retorno
+ End Function
+#End Region
+
+#Region " GET FRACCION ARANCELARIA "
+ Private Function GetFraccionArancelaria(ByVal context As HttpContext) As String
+ Dim retorno As String = ""
+
+ Dim DT = DirectCast(context.Application("GlobalDTFraccionArancelaria"), EnumerableRowCollection(Of DataRow))
+ Dim DtRetorno As DataTable
+
+ Dim Name = IfNull(context.Request("Name"), "-1").ToString
+
+ If Name <> "-1" Then
+ DT = DT.Where((Function(a) a!ClaveSATFraccionArancelariaDescripcion.ToString.ToLower Like ($"*{Name.ToLower}*")))
+ End If
+
+ DtRetorno = New DataView(DT.OrderBy(Function(a) a!ClaveSATFraccionArancelaria).CopyToDataTable).ToTable(True, {"CveFraccionArancelaria", "ClaveSATFraccionArancelariaDescripcion"})
+
+ If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then
+ DtRetorno.Columns("CveFraccionArancelaria").ColumnName = "id"
+ DtRetorno.Columns("ClaveSATFraccionArancelariaDescripcion").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
+
+
+#Region "USADOS"
+
+ Private Function GETPSUSADOS(ByVal context As HttpContext) As String
+ Dim retorno As String = ""
+ Dim DtPSRetorno 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 FuePorXml = IfNull(context.Request("FuePorXml"), "-1").ToString.ToEntero
+ Dim Name = IfNull(context.Request("Name"), "-1").ToString
+ Dim CveClasificacion = IfNull(context.Request("CveClasificacion"), "-1").ToString.ToEntero
+ Dim CveSubFamilia = IfNull(context.Request("CveSubFamilia"), "-1").ToString.ToEntero
+ Dim CveClasificacionPresupuesto = IfNull(context.Request("CveClasificacionPresupuesto"), "-1").ToString.ToEntero
+ Dim Pagina = IfNull(context.Request("Pagina"), "-1").ToString
+ Dim Estatus = IfNull(context.Request("Estatus"), "1").ToString
+ Dim CveSucursal = IfNull(context.Request("cvesucursal"), "-1").ToString.ToEntero
+ Dim CveSubProyecto = IfNull(context.Request("cvesubproyecto"), "-1").ToString.ToEntero
+ Dim UsoClasificacion = IfNull(context.Request("usoclasificacion"), "-1").ToString.ToEntero
+ Dim UsaGlobal As Boolean = True
+
+
If UsaGlobal Then
- 'Dim DTPS = DirectCast(context.Application("GlobalDTPSSimplificado"), EnumerableRowCollection(Of DataRow))
- Dim DTPS = ClsPaginas.GlobalDTPSSimplificado(CveEmpresa).AsEnumerable
-
- If DTPS IsNot Nothing Then
-
-
- 'APLICACION DE FILTROS
- DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveEmpresa) = CveEmpresa))
- If Estatus = 1 Then
- DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveEstado) = 1))
- ElseIf Estatus = -1 Then
-
- End If
-
- 'If FuePorXml >= 0 Then
- ' DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!FuePorXML) = FuePorXml))
- 'End If
-
- If Name <> "-1" Then
- If PSCodigoDescripcion = "PSCodigo" Then
- DTPS = DTPS.Where((Function(a) a!PSCodigo.ToString.ToLower Like ("*" + Name.ToLower + "*")))
- Else
- DTPS = DTPS.Where((Function(a) a!PSCodigoClasificacion.ToString.ToLower Like ("*" + Name.ToLower + "*")))
- End If
- End If
-
- If CveClasificacion > 0 Then
- DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveClasificacion) = CveClasificacion))
- ElseIf CveClasificacion = -1 Then
- DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveClasificacion) >= 0))
- End If
-
- If AplicaParaVenta > 0 Then
- DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!AplicaParaVenta) = 1))
- End If
-
- 'If CveSubFamilia > 0 Then
- ' DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveSubFamilia) = CveSubFamilia))
- ' 'ElseIf CveSubFamilia = -1 Then
- ' 'DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveSubFamilia) > 0))
- 'End If
-
- If CveClasificacionPresupuesto > 0 Then
- DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveClasificacionPresupuesto) = CveClasificacionPresupuesto))
- End If
-
- If UsoClasificacion > 0 Then DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!UsoClasificacion) = UsoClasificacion))
-
- If Pagina <> "-1" Then
- If Pagina = "Compras" Then
- DTPS = DTPS.Where((Function(a) a!CveTipoPS = 1 AndAlso a!CveEstado = 1))
- ElseIf Pagina = "Compras2" Then
- DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveTipoPS) = 1 AndAlso (Convert.ToInt32(a!CveEstado) = 1 OrElse Convert.ToInt32(a!CveEstado) = 2)))
- ElseIf Pagina = "Inventarios" Then
- DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveTipoPS) = 2))
- End If
- End If
-
- 'Try, generado para cuando el resultado no tiene valores(The source contains no DataRows.), no detenga la ejecucion, no se le puso un count previo, porque el costo se duplica, al preguntar y luego ordenar y convertir a datatable
- Try
- DtPSRetorno = New DataView(DTPS.OrderBy(Function(a) a!PSCodigo).CopyToDataTable).ToTable(True, {"CvePS", "PSCodigo", "PSCodigoClasificacion"})
-
- Catch ex As Exception
- DtPSRetorno = Nothing
- End Try
-
- End If
- 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
- DtPSRetorno.Columns().Remove("PSCodigoClasificacion")
- Else
- DtPSRetorno.Columns().Remove("PSCodigo")
- End If
- retorno = JsonConvert.SerializeObject(DtPSRetorno).ToString
- context.Response.Write(retorno)
- Else
- context.Response.Write("[]")
- End If
- End If
-
- Return retorno
- End Function
-#End Region
+ Dim DTPS = DirectCast(context.Application(String.Format("GlobalDTPSSimplificado{0}", CveEmpresa)), EnumerableRowCollection(Of DataRow))
+ If DTPS IsNot Nothing Then
+ 'APLICACION DE FILTROS
+ DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveEmpresa) = CveEmpresa))
+ If Estatus = 1 Then
+ DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveEstado) = 1))
+ ElseIf Estatus = -1 Then
- Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable
- Get
- Return False
- End Get
- End Property
+ End If
+ If Name <> "-1" Then
+ DTPS = DTPS.Where((Function(a) a!PSCodigo.ToString.ToLower Like ("*" + Name.ToLower + "*")))
+ End If
+ If CveClasificacion > 0 Then
+ DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveClasificacion) = CveClasificacion))
+ ElseIf CveClasificacion = -1 Then
+ DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveClasificacion) >= 0))
+ End If
-#Region "Funciones"
- Public Function GetJson(ByVal dt As DataTable) As String
-
- Dim serializer As System.Web.Script.Serialization.JavaScriptSerializer = New System.Web.Script.Serialization.JavaScriptSerializer()
- Dim rows As New List(Of Dictionary(Of String, Object))
- Dim row As Dictionary(Of String, Object)
-
- For Each dr As DataRow In dt.Rows
- row = New Dictionary(Of String, Object)
- For Each col As DataColumn In dt.Columns
- row.Add(col.ColumnName, dr(col))
- Next
- rows.Add(row)
- Next
- Return serializer.Serialize(rows)
- End Function
- ReadOnly Property UsuarioActual(ByVal context As HttpContext) As Usuario
- Get
- UsuarioActual = DirectCast(context.Session("UsuarioSIG"), Usuario)
- End Get
- End Property
-#End Region
+ If CveClasificacionPresupuesto > 0 Then
+ DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveClasificacionPresupuesto) = CveClasificacionPresupuesto))
+ End If
+ If UsoClasificacion > 0 Then DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!UsoClasificacion) = UsoClasificacion))
-#Region " GET PS SAT "
- 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"})
-
- If DtPSRetorno IsNot Nothing AndAlso DtPSRetorno.Rows.Count > 0 Then
- DtPSRetorno.Columns("CveSATPS").ColumnName = "id"
- DtPSRetorno.Columns("SATClaveProductoServicio").ColumnName = "text"
- retorno = JsonConvert.SerializeObject(DtPSRetorno).ToString
- context.Response.Write(retorno)
- Else
- context.Response.Write("[]")
- End If
- DtPSRetorno.Dispose()
- Return retorno
- End Function
-#End Region
+ If Pagina <> "-1" Then
+ If Pagina = "Compras" Then
+ DTPS = DTPS.Where((Function(a) a!CveTipoPS = 1 AndAlso a!CveEstado = 1))
+ ElseIf Pagina = "Compras2" Then
+ DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveTipoPS) = 1 AndAlso (Convert.ToInt32(a!CveEstado) = 1 OrElse Convert.ToInt32(a!CveEstado) = 2)))
+ ElseIf Pagina = "Inventarios" Then
+ DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveTipoPS) = 2))
+ End If
+ End If
+ Try
+ DtPSRetorno = New DataView(DTPS.OrderBy(Function(a) a!PSCodigo).CopyToDataTable).ToTable(True, {"CvePS", "PSCodigo", "CveTamaño"})
+ DtPSRetorno = DtPSRetorno.FiltraParametros("CveTamaño > 0")
+ Catch ex As Exception
+ DtPSRetorno = Nothing
+ End Try
+ End If
-#Region " GET UM SAT "
- Private Function GETUMSAT(ByVal context As HttpContext) As String
- Dim retorno As String = ""
-
- Dim DTUM = DirectCast(context.Application("GlobalDTPSATUM"), EnumerableRowCollection(Of DataRow))
- Dim DtPSRetorno As DataTable
-
- Dim Name = IfNull(context.Request("Name"), "-1").ToString
-
- If Name <> "-1" Then
- DTUM = DTUM.Where((Function(a) a!ClaveNombre.ToString.ToLower Like ("*" + Name.ToLower + "*")))
- End If
-
- DtPSRetorno = New DataView(DTUM.OrderBy(Function(a) a!Nombre).CopyToDataTable).ToTable(True, {"CveSATUnidadMedida", "ClaveNombre"})
-
- If DtPSRetorno IsNot Nothing AndAlso DtPSRetorno.Rows.Count > 0 Then
- DtPSRetorno.Columns("CveSATUnidadMedida").ColumnName = "id"
- DtPSRetorno.Columns("ClaveNombre").ColumnName = "text"
- retorno = JsonConvert.SerializeObject(DtPSRetorno).ToString
- context.Response.Write(retorno)
- Else
- context.Response.Write("[]")
- End If
- Return retorno
- End Function
-#End Region
+ End If
+ If DtPSRetorno IsNot Nothing AndAlso DtPSRetorno.Rows.Count > 0 Then
+ DtPSRetorno.Columns("CvePS").ColumnName = "id"
+ DtPSRetorno.Columns("PSCodigo").ColumnName = "text"
+ retorno = JsonConvert.SerializeObject(DtPSRetorno).ToString
+ context.Response.Write(retorno)
+ Else
+ context.Response.Write("[]")
+ End If
+ End If
-#Region " GET FRACCION ARANCELARIA "
- Private Function GetFraccionArancelaria(ByVal context As HttpContext) As String
- Dim retorno As String = ""
-
- Dim DT = DirectCast(context.Application("GlobalDTFraccionArancelaria"), EnumerableRowCollection(Of DataRow))
- Dim DtRetorno As DataTable
-
- Dim Name = IfNull(context.Request("Name"), "-1").ToString
-
- If Name <> "-1" Then
- DT = DT.Where((Function(a) a!ClaveSATFraccionArancelariaDescripcion.ToString.ToLower Like ($"*{Name.ToLower}*")))
- End If
-
- DtRetorno = New DataView(DT.OrderBy(Function(a) a!ClaveSATFraccionArancelaria).CopyToDataTable).ToTable(True, {"CveFraccionArancelaria", "ClaveSATFraccionArancelariaDescripcion"})
-
- If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then
- DtRetorno.Columns("CveFraccionArancelaria").ColumnName = "id"
- DtRetorno.Columns("ClaveSATFraccionArancelariaDescripcion").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
-
-
-#Region "USADOS"
-
- Private Function GETPSUSADOS(ByVal context As HttpContext) As String
- Dim retorno As String = ""
- Dim DtPSRetorno 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 FuePorXml = IfNull(context.Request("FuePorXml"), "-1").ToString.ToEntero
- Dim Name = IfNull(context.Request("Name"), "-1").ToString
- Dim CveClasificacion = IfNull(context.Request("CveClasificacion"), "-1").ToString.ToEntero
- Dim CveSubFamilia = IfNull(context.Request("CveSubFamilia"), "-1").ToString.ToEntero
- Dim CveClasificacionPresupuesto = IfNull(context.Request("CveClasificacionPresupuesto"), "-1").ToString.ToEntero
- Dim Pagina = IfNull(context.Request("Pagina"), "-1").ToString
- Dim Estatus = IfNull(context.Request("Estatus"), "1").ToString
- Dim CveSucursal = IfNull(context.Request("cvesucursal"), "-1").ToString.ToEntero
- Dim CveSubProyecto = IfNull(context.Request("cvesubproyecto"), "-1").ToString.ToEntero
- Dim UsoClasificacion = IfNull(context.Request("usoclasificacion"), "-1").ToString.ToEntero
- Dim UsaGlobal As Boolean = True
-
-
-
-
- If UsaGlobal Then
-
-
-
- Dim DTPS = ClsPaginas.GlobalDTPSSimplificado(CveEmpresa).AsEnumerable ' DirectCast(context.Application("GlobalDTPSSimplificado"), EnumerableRowCollection(Of DataRow))
-
-
- If DTPS IsNot Nothing Then
-
- 'APLICACION DE FILTROS
- DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveEmpresa) = CveEmpresa))
- If Estatus = 1 Then
- DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveEstado) = 1))
- ElseIf Estatus = -1 Then
-
- End If
-
- If Name <> "-1" Then
- DTPS = DTPS.Where((Function(a) a!PSCodigo.ToString.ToLower Like ("*" + Name.ToLower + "*")))
- End If
-
- If CveClasificacion > 0 Then
- DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveClasificacion) = CveClasificacion))
- ElseIf CveClasificacion = -1 Then
- DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveClasificacion) >= 0))
- End If
-
- If CveClasificacionPresupuesto > 0 Then
- DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveClasificacionPresupuesto) = CveClasificacionPresupuesto))
- End If
-
- If UsoClasificacion > 0 Then DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!UsoClasificacion) = UsoClasificacion))
-
- If Pagina <> "-1" Then
- If Pagina = "Compras" Then
- DTPS = DTPS.Where((Function(a) a!CveTipoPS = 1 AndAlso a!CveEstado = 1))
- ElseIf Pagina = "Compras2" Then
- DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveTipoPS) = 1 AndAlso (Convert.ToInt32(a!CveEstado) = 1 OrElse Convert.ToInt32(a!CveEstado) = 2)))
- ElseIf Pagina = "Inventarios" Then
- DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveTipoPS) = 2))
- End If
- End If
-
- Try
- DtPSRetorno = New DataView(DTPS.OrderBy(Function(a) a!PSCodigo).CopyToDataTable).ToTable(True, {"CvePS", "PSCodigo", "CveTamaño"})
- DtPSRetorno = DtPSRetorno.FiltraParametros("CveTamaño > 0")
- Catch ex As Exception
- DtPSRetorno = Nothing
- End Try
- End If
-
- End If
- If DtPSRetorno IsNot Nothing AndAlso DtPSRetorno.Rows.Count > 0 Then
- DtPSRetorno.Columns("CvePS").ColumnName = "id"
- DtPSRetorno.Columns("PSCodigo").ColumnName = "text"
- retorno = JsonConvert.SerializeObject(DtPSRetorno).ToString
- context.Response.Write(retorno)
- Else
- context.Response.Write("[]")
- End If
- End If
-
- Return retorno
+ Return retorno
End Function
-#End Region
+#End Region
End Class
\ No newline at end of file
diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb
index 5e5d27d25..c86542405 100644
--- a/Bancos/ProveedoresAbonar.aspx.vb
+++ b/Bancos/ProveedoresAbonar.aspx.vb
@@ -496,7 +496,7 @@ Partial Class Bancos_ProveedoresAbonar
ViewState("CveCuentaComplementaria") = ObjProveedor.CveCuentaProveedoresComplementaria
If Serie <> "" AndAlso Serie <> "-1" Then
- Dim dr As DataRow = GlobalDTProveedorSucursales(CveProveedor).FiltroPrimero(String.Format("Serie = '{0}'", Serie))
+ Dim dr As DataRow = GlobalDTProveedorSucursales(CveProveedor, UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("Serie = '{0}'", Serie))
If dr IsNot Nothing Then
TxtObservaciones.Text = String.Format("Suc. {0}", dr("ProveedorSucursal"))
HdnObs.Value = TxtObservaciones.Text
diff --git a/Bancos/RepCobradoDetalle.aspx.vb b/Bancos/RepCobradoDetalle.aspx.vb
index 049cdeff8..90671a616 100644
--- a/Bancos/RepCobradoDetalle.aspx.vb
+++ b/Bancos/RepCobradoDetalle.aspx.vb
@@ -112,7 +112,7 @@ Partial Class Ventas_RepRecuperacionDetalle
DivProveedores.Visible = True
Dim ObjProveedores As New ClsCompProveedores
- If ObjProveedores.GetSucursales(CveProveedor) Then
+ If ObjProveedores.GetSucursales(CveProveedor, UsuarioActual.CveEmpresa) Then
If ObjProveedores.DtResultados.Rows.Count > 0 Then
DdlProveedorSucursal.DataSource = ObjProveedores.DtResultados
End If
diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb
index be31eebe3..5fac2308b 100644
--- a/Compras/Compras.aspx.vb
+++ b/Compras/Compras.aspx.vb
@@ -4134,8 +4134,9 @@ Partial Class Compras_Compras
'si hay necesidad de actualizar el globaldtps
If RegeneraPS Then
- Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalDT)
- Hilo.Start()
+ 'Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalDT)
+ 'Hilo.Start()
+ GeneraGlobalDT(Nothing)
End If
Dim CvePlantillaPrePoliza As Integer
@@ -17498,15 +17499,17 @@ Partial Class Compras_Compras
End Sub
Private Sub RecargaGlobalEquivalencias()
- Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalEquivalencias)
- Hilo.Start()
+ 'Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalEquivalencias)
+ 'Hilo.Start()
+ GeneraGlobalEquivalencias()
End Sub
Private Sub GeneraGlobalEquivalencias()
- Dim ObjPS = New ClsProductosServicios
- If ObjPS.GetPSEquivalencias(-1, -1) Then
- GlobalDTProductosServiciosEquivalencias(-1, -1, UsuarioActual.CveEmpresa) = ObjPS.DtResultados
- End If
- ObjPS.Dispose()
+ GlobalDTProductosServiciosEquivalencias(-1, -1, UsuarioActual.CveEmpresa) = Nothing
+ 'Dim ObjPS = New ClsProductosServicios
+ 'If ObjPS.GetPSEquivalencias(-1, -1) Then
+ ' GlobalDTProductosServiciosEquivalencias(-1, -1, UsuarioActual.CveEmpresa) = ObjPS.DtResultados
+ 'End If
+ 'ObjPS.Dispose()
End Sub
#End Region
@@ -17658,23 +17661,26 @@ Partial Class Compras_Compras
End Sub
Private Sub RecargaGlobalUM()
- Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalUM)
- Hilo.Start()
+ 'Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalUM)
+ 'Hilo.Start()
+ GeneraGlobalUM()
End Sub
- Private Sub GeneraGlobalUM()
- Dim ObjPS = New ClsProductosServicios
- Dim OjbUM As New ClsUnidadesMedida
-
- If ObjPS.GetPSEquivalencias(-1, -1) Then
- GlobalDTProductosServiciosEquivalencias(-1, -1, UsuarioActual.CveEmpresa) = ObjPS.DtResultados
- End If
-
- If OjbUM.GetUnidadesMedidaAlias(-1) Then
- GlobalDTUnidadesMedidaAlias = OjbUM.DtResultados
- End If
-
- ObjPS.Dispose()
- OjbUM.Dispose()
+ Private Sub GeneraGlobalUM()
+ GlobalDTProductosServiciosEquivalencias(-1, -1, UsuarioActual.CveEmpresa) = Nothing
+ GlobalDTUnidadesMedidaAlias(UsuarioActual.CveEmpresa) = Nothing
+ 'Dim ObjPS = New ClsProductosServicios
+ 'Dim OjbUM As New ClsUnidadesMedida
+
+ 'If ObjPS.GetPSEquivalencias(-1, -1) Then
+ ' GlobalDTProductosServiciosEquivalencias(-1, -1, UsuarioActual.CveEmpresa) = ObjPS.DtResultados
+ 'End If
+
+ 'If OjbUM.GetUnidadesMedidaAlias(-1) Then
+ ' GlobalDTUnidadesMedidaAlias = OjbUM.DtResultados
+ 'End If
+
+ 'ObjPS.Dispose()
+ 'OjbUM.Dispose()
End Sub
#End Region
@@ -19062,7 +19068,7 @@ Partial Class Compras_Compras
RecargaPSGlobal()
End Sub
Private Sub RecargaPSGlobal()
- GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) = Nothing
+ 'GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) = Nothing
'Dim ObjPS As New ClsProductosServicios
'If ObjPS.GetPSSimplificado(-1) Then Application("GlobalDTPSSimplificado") = ObjPS.DtResultados.AsEnumerable()
diff --git a/Compras/Proveedores.aspx.vb b/Compras/Proveedores.aspx.vb
index 389ffd36f..859af37e3 100644
--- a/Compras/Proveedores.aspx.vb
+++ b/Compras/Proveedores.aspx.vb
@@ -1498,7 +1498,7 @@ Partial Class Compras_Proveedores
Next
End If
- If ObjProveedores.GetSucursales(-1) Then Application("GlobalDTProveedorSucursales") = ObjProveedores.DtResultados
+ GlobalDTProveedorSucursales(-1, UsuarioActual.CveEmpresa) = Nothing
End If
Next
End If
@@ -1533,8 +1533,8 @@ Partial Class Compras_Proveedores
If ObjContaAC IsNot Nothing Then ObjContaAC.Commit()
'ACTUALIZAR GLOBAL
- If ObjProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaGlobalDT, -1, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, -1) Then
- GlobalDTCompProveedores(-1) = ObjProveedores.DtResultados
+ If ObjProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaGlobalDT, -1, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then
+ GlobalDTCompProveedores(UsuarioActual.CveEmpresa) = ObjProveedores.DtResultados
Else
ErrorBancos = True
End If
@@ -1617,8 +1617,8 @@ Partial Class Compras_Proveedores
If tIdContaProveedor > 0 AndAlso CreoCuenta Then ObjProveedores.UpdateProveedorIdCuentaAC(CveProveedor, tIdContaProveedor)
- If ObjProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaGlobalDT, -1, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, -1) Then
- GlobalDTCompProveedores(-1) = ObjProveedores.DtResultados
+ If ObjProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaGlobalDT, -1, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then
+ GlobalDTCompProveedores(UsuarioActual.CveEmpresa) = ObjProveedores.DtResultados
End If
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
@@ -2016,7 +2016,7 @@ Partial Class Compras_Proveedores
Public Sub CargaProveedorSucursales()
CveTempSucursal = -1
- TempDTSucursales = GlobalDTProveedorSucursales(CveProveedor)
+ TempDTSucursales = GlobalDTProveedorSucursales(CveProveedor, UsuarioActual.CveEmpresa)
TempDTSucursales.Columns.Add("CveSucursalTemp", GetType(String))
TempDTSucursalesOrigin = TempDTSucursales.Copy()
GVSucursales.DataSource = TempDTSucursales
@@ -2081,7 +2081,7 @@ Partial Class Compras_Proveedores
If EsEditarSucursal = 0 Then
If ObjProveedor.AddSucursal(CveProveedor, TxtProveedorSucursal2.Text.Trim, TextSucursalDireccion.Text.Trim, TextSucursalTelefono.Text.Trim, TxtSucursalSerie.Text.Trim, TxtContactoSucursal.Text, TxtCorreoSucursal.Text, UsuarioActual.CveUsuario, TxtLimiteCreditoSuc.Text.ToDouble, TxtPlazoCobranzaSuc.Text.ToEntero) Then
'recargo el globaldt
- If ObjProveedor.GetSucursales(-1) Then Application("GlobalDTProveedorSucursales") = ObjProveedor.DtResultados
+ GlobalDTProveedorSucursales(-1, UsuarioActual.CveEmpresa) = Nothing
Alert("La nueva Sucursal del Proveedor se guardó correctamente.", TipoMensaje.MsgInformacion)
CargaProveedorSucursales()
End If
@@ -2089,7 +2089,7 @@ Partial Class Compras_Proveedores
If CveProveedorSucursal > 0 And ObjProveedor.UpdateSucursal(TxtProveedorSucursal2.Text, TextSucursalDireccion.Text.Trim, TextSucursalTelefono.Text.Trim, TxtSucursalSerie.Text, False, TxtCorreoSucursal.Text, TxtContactoSucursal.Text, CveProveedorSucursal, CveProveedor, TxtLimiteCreditoSuc.Text.ToDouble, TxtPlazoCobranzaSuc.Text.ToEntero) Then
'recargo el globaldt
- If ObjProveedor.GetSucursales(-1) Then Application("GlobalDTProveedorSucursales") = ObjProveedor.DtResultados
+ GlobalDTProveedorSucursales(-1, UsuarioActual.CveEmpresa) = Nothing
CargaProveedorSucursales()
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
End If
@@ -2149,7 +2149,7 @@ Partial Class Compras_Proveedores
If ObjProveedor.RemoveProveedorContacto(-1, CveProveedorSucursal) Then
If ObjProveedor.RemoveSucursal(CveProveedor, CveProveedorSucursal) Then
'GVSucursales.EditIndex = -1
- If ObjProveedor.GetSucursales(-1) Then Application("GlobalDTProveedorSucursales") = ObjProveedor.DtResultados
+ GlobalDTProveedorSucursales(-1, UsuarioActual.CveEmpresa) = Nothing
CargaProveedorSucursales()
CargaContactos(ObjProveedor)
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
@@ -3162,7 +3162,7 @@ Partial Class Compras_Proveedores
End Sub
Protected Sub MostrarFiltro()
- If GlobalDTProveedorSucursales(CveProveedor).Rows.Count > 1 Then
+ If GlobalDTProveedorSucursales(CveProveedor, UsuarioActual.CveEmpresa).Rows.Count > 1 Then
'tHistorial.Visible = True
'tCxP.Visible = True
'tAnticipos.Visible = True
@@ -3187,7 +3187,7 @@ Partial Class Compras_Proveedores
End If
End Sub
Protected Sub CargaRB(R As DropDownList)
- R.DataSource = GlobalDTProveedorSucursales(CveProveedor)
+ R.DataSource = GlobalDTProveedorSucursales(CveProveedor, UsuarioActual.CveEmpresa)
R.DataBind()
R.Items.Insert(0, New ListItem("Todas", "-1"))
If CveProveedorSucursal > 0 Then R.SelectedValue = CveProveedorSucursal.ToString Else R.SelectedValue = "-1"
diff --git a/Contratos/Contrato.aspx.vb b/Contratos/Contrato.aspx.vb
index 8e01e82c8..d4594f75c 100644
--- a/Contratos/Contrato.aspx.vb
+++ b/Contratos/Contrato.aspx.vb
@@ -1679,7 +1679,7 @@ Partial Class Contratos_Default
End Sub
Private Sub ElProductoChange()
DdlUM.Items.Clear()
- DdlUM.DataSource = GlobalDTProductosServiciosEquivalencias(DdlProductows.SelectedValue.ToEntero, -1)
+ DdlUM.DataSource = GlobalDTProductosServiciosEquivalencias(DdlProductows.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa)
DdlUM.DataBind()
UpTitulos.Update()
End Sub
@@ -1711,7 +1711,7 @@ Partial Class Contratos_Default
End Sub
Private Sub ElProductoChangeInsumos()
DdlUMInsumos.Items.Clear()
- DdlUMInsumos.DataSource = GlobalDTProductosServiciosEquivalencias(DdlProductowsInsumos.SelectedValue.ToEntero, -1)
+ DdlUMInsumos.DataSource = GlobalDTProductosServiciosEquivalencias(DdlProductowsInsumos.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa)
DdlUMInsumos.DataBind()
UpTitulos.Update()
End Sub
@@ -1913,7 +1913,7 @@ Partial Class Contratos_Default
End If
End If
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
- e.Row.FCDropDownList("DdlUMEdit").DataSource = GlobalDTProductosServiciosEquivalencias(e.Row.DataKey("CvePS").ToString.ToEntero, -1)
+ e.Row.FCDropDownList("DdlUMEdit").DataSource = GlobalDTProductosServiciosEquivalencias(e.Row.DataKey("CvePS").ToString.ToEntero, -1, UsuarioActual.CveEmpresa)
e.Row.FCDropDownList("DdlUMEdit").DataBind()
e.Row.FCDropDownList("DdlUMEdit").SelectedValue = e.Row.DataKey("CveUM")
End If
@@ -2099,7 +2099,7 @@ Partial Class Contratos_Default
End If
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
- e.Row.FCDropDownList("DdlUMEdit").DataSource = GlobalDTProductosServiciosEquivalencias(e.Row.DataKey("CvePS").ToString.ToEntero, -1)
+ e.Row.FCDropDownList("DdlUMEdit").DataSource = GlobalDTProductosServiciosEquivalencias(e.Row.DataKey("CvePS").ToString.ToEntero, -1, UsuarioActual.CveEmpresa)
e.Row.FCDropDownList("DdlUMEdit").DataBind()
e.Row.FCDropDownList("DdlUMEdit").SelectedValue = e.Row.DataKey("CveUM")
End If
diff --git a/General/SaldosIniciales.aspx.vb b/General/SaldosIniciales.aspx.vb
index b78138a65..930cd697c 100644
--- a/General/SaldosIniciales.aspx.vb
+++ b/General/SaldosIniciales.aspx.vb
@@ -725,7 +725,7 @@ Partial Class General_SaldosIniciales
If Not CveUnidadMedida > 0 AndAlso UnidadMedida <> "" Then
If ObjUM.AddUnidadMedida(UnidadMedida, UnidadMedida, "", "", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).ToEntero > 0 Then
- If ObjUM.GetUnidadesMedida() Then Application("GlobalDTUnidadesMedida") = ObjUM.DtResultados
+ If ObjUM.GetUnidadesMedida(UsuarioActual.CveEmpresa) Then GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa) = Nothing
CveUnidadMedida = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveUnidadMedida", $"UnidadMedida = '{UnidadMedida}'").ToString.ToEntero
End If
End If
@@ -1179,8 +1179,9 @@ Partial Class General_SaldosIniciales
If Not ErrorClientes Then
- ObjClientes.Commit()
- If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, -1) Then Application("GlobalDTCliente") = ObjClientes.DtResultados
+ ObjClientes.Commit()
+ 'If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, -1) Then Application("GlobalDTCliente") = ObjClientes.DtResultados
+ GlobalDTCliente(UsuarioActual.CveEmpresa) = Nothing
If Contador > 0 Then
Alert(String.Format("Se agregaron: {0} Clientes correctamente. Se Omitieron: {1} Clientes ya que ya se encontraban registrados.", NumRows - Contador, Contador), TipoMensaje.MsgInformacion)
Else
diff --git a/Global.asax b/Global.asax
index b5dc90938..ebb88fa8b 100644
--- a/Global.asax
+++ b/Global.asax
@@ -480,8 +480,9 @@
Dim ObjAcumuladores As New ClsAcumuladores()
If ObjAcumuladores.TamañoGet(-1, -1) Then Application("GlobalDTAcumTamaños") = ObjAcumuladores.DtResultados Else Application("GlobalDTAcumTamaños") = Nothing
- If ObjAcumuladores.TiposDefectoGet(-1, -1) Then Application("GlobalDTAcumTiposDefecto") = ObjAcumuladores.DtResultados Else Application("GlobalDTAcumTiposDefecto") = Nothing
- If ObjAcumuladores.TiposUsoGet(-1, -1) Then Application("GlobalDTAcumTiposUso") = ObjAcumuladores.DtResultados Else Application("GlobalDTAcumTiposUso") = Nothing
+ If ObjAcumuladores.TiposDefectoGet(-1, -1) Then Application("GlobalDTAcumTiposDefecto") = ObjAcumuladores.DtResultados Else Application("GlobalDTAcumTiposDefecto") = Nothing
+ If ObjAcumuladores.TiposUsoGet(-1, -1) Then Application("GlobalDTAcumTiposUso") = ObjAcumuladores.DtResultados Else Application("GlobalDTAcumTiposUso") = Nothing
+ 'If ObjAcumuladores.GarantiasMesesGet(-1, -1) Then Application("GlobalDTAcumGarantiasMesesTipoUso") = ObjAcumuladores.DtResultados.FiltraParametros("", DistinctColumns:={"CveMarca", "CveTipoUso", "TipoUso"}) Else Application("GlobalDTAcumGarantiasMesesTipoUso") = Nothing
ObjAcumuladores.Dispose()
'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
diff --git a/Inventarios/Consignaciones.aspx.vb b/Inventarios/Consignaciones.aspx.vb
index 7706639b3..e39887743 100644
--- a/Inventarios/Consignaciones.aspx.vb
+++ b/Inventarios/Consignaciones.aspx.vb
@@ -1431,7 +1431,7 @@ Partial Class Inventarios_Consignaciones
HFProducto.Value = DdlProducto.SelectedValue
End If
- DdlUnidad.DataSource = GlobalDTProductosServiciosEquivalencias(HFProducto.Value.ToEntero, -1)
+ DdlUnidad.DataSource = GlobalDTProductosServiciosEquivalencias(HFProducto.Value.ToEntero, -1, UsuarioActual.CveEmpresa)
DdlUnidad.DataBind()
UpDatos.Update()
End Sub
diff --git a/Inventarios/Equivalencias.aspx.vb b/Inventarios/Equivalencias.aspx.vb
index 6ce650e01..b35114939 100644
--- a/Inventarios/Equivalencias.aspx.vb
+++ b/Inventarios/Equivalencias.aspx.vb
@@ -193,11 +193,11 @@ Partial Class Inventarios_Equivalencias
#Region " RECARGA GLOBAL "
Private Sub RecargaGlobal()
- Dim equivalencias As New ClsProductosServicios
- If equivalencias.GetPSEquivalencias(-1, -1) Then
- GlobalDTProductosServiciosEquivalencias(-1, -1) = equivalencias.DtResultados
- End If
- equivalencias.Dispose()
+ 'Dim equivalencias As New ClsProductosServicios
+ 'If equivalencias.GetPSEquivalencias(-1, -1) Then
+ ' GlobalDTProductosServiciosEquivalencias(-1, -1) = equivalencias.DtResultados
+ 'End If
+ 'equivalencias.Dispose()
End Sub
#End Region
diff --git a/Inventarios/KardexAlmacenHorizontal.aspx.vb b/Inventarios/KardexAlmacenHorizontal.aspx.vb
index 6a63652a6..229a2ddb1 100644
--- a/Inventarios/KardexAlmacenHorizontal.aspx.vb
+++ b/Inventarios/KardexAlmacenHorizontal.aspx.vb
@@ -128,7 +128,7 @@ Partial Class Inventarios_KardexAlmacen
Dim CveAlmacen As Integer = ddlAlmacen.SelectedValue.ToEntero
Dim CveProveedorCompra As Integer = If(DdlProveedor.SelectedValue.ToEntero > 0, DdlProveedor.SelectedValue.ToEntero, -1)
- If ObjMovimientos.GetKardexAlmacenHorizontal(CvePS, FechaF, CveAlmacen, DdlUnidadMedida.SelectedValue.ToEntero, CveProveedorCompra, DdlTipoAlmacen.SelectedValue.ToEntero(), If(ChkIncluyeTransitorios.Checked, 1, 0), DdlClasificacion_SelectedIndexChanged.selectedvalue.toentero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CondicionExistencias:=DdlExistencia.SelectedValue) Then
+ If ObjMovimientos.GetKardexAlmacenHorizontal(CvePS, FechaF, CveAlmacen, DdlUnidadMedida.SelectedValue.ToEntero, CveProveedorCompra, DdlTipoAlmacen.SelectedValue.ToEntero(), If(ChkIncluyeTransitorios.Checked, 1, 0), DdlClasificacion.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CondicionExistencias:=DdlExistencia.SelectedValue) Then
If ObjMovimientos.DtResultados IsNot Nothing AndAlso ObjMovimientos.DtResultados.Rows.Count > 0 Then
dt = ObjMovimientos.DtResultados
Dim ListaBorrar As New List(Of DataColumn)
diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb
index 48d9ecba0..44e5f7e9c 100644
--- a/Inventarios/RecepcionAlmacen.aspx.vb
+++ b/Inventarios/RecepcionAlmacen.aspx.vb
@@ -2137,7 +2137,7 @@ Partial Class Inventarios_RecepcionAlmacen
If EntregaDirecta Then
If Not ErrorMovInv Then
Dim CveVenta As Integer = 0
- Dim Dt As DataTable
+ Dim Dt As DataTable = Nothing
If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then
If ObjInventario.DtResultados.Rows.Count > 0 Then
diff --git a/Inventarios/TrasladoSolicitud.aspx.vb b/Inventarios/TrasladoSolicitud.aspx.vb
index ecb98f793..50115c258 100644
--- a/Inventarios/TrasladoSolicitud.aspx.vb
+++ b/Inventarios/TrasladoSolicitud.aspx.vb
@@ -863,7 +863,7 @@ Partial Class Inventarios_TrasladoSolicitud
Dim drPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlProductoServicio.SelectedValue.ToEntero).FiltroPrimero("")
DdlUM.Items.Clear()
If UsuarioActual.Empresa.UsaInventarios Then
- DdlUM.DataSource = GlobalDTProductosServiciosEquivalencias(DdlProductoServicio.SelectedValue.ToEntero, -1)
+ DdlUM.DataSource = GlobalDTProductosServiciosEquivalencias(DdlProductoServicio.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa)
Else
DdlUM.DataSource = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa)
End If
diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb
index 32f164658..968a7bc62 100644
--- a/OC/OC.aspx.vb
+++ b/OC/OC.aspx.vb
@@ -1299,7 +1299,7 @@ Partial Class OC
'CARGAMOS LA SUCURSAL SI NO EXISTE SE AGREGA MATRIZ
Dim CveProveedorSucursal As Integer = IIf(objOC.CveProveedorSucursal.ToEntero = -1, 0, objOC.CveProveedorSucursal.ToEntero).ToString.ToEntero
DivProveedorSucursal.Visible = True
- DdlProveedorSucursal.DataSource = GlobalDTProveedorSucursales(objOC.CveProveedor)
+ DdlProveedorSucursal.DataSource = GlobalDTProveedorSucursales(objOC.CveProveedor, UsuarioActual.CveEmpresa)
DdlProveedorSucursal.DataBind()
DdlProveedorSucursal.Items.Insert(0, New ListItem("Matriz", "0"))
DdlProveedorSucursal.SelectedValueExist(CveProveedorSucursal)
@@ -1334,7 +1334,7 @@ Partial Class OC
If objOC.CveProveedorSucursal.ToEntero > 0 Then
DivProveedorSucursal.Visible = True
- DdlProveedorSucursal.DataSource = GlobalDTProveedorSucursales(objOC.CveProveedor)
+ DdlProveedorSucursal.DataSource = GlobalDTProveedorSucursales(objOC.CveProveedor, UsuarioActual.CveEmpresa)
DdlProveedorSucursal.DataBind()
DdlProveedorSucursal.SelectedValueExist(objOC.CveProveedorSucursal.ToString)
End If
@@ -1830,7 +1830,7 @@ Partial Class OC
If Cvepsgvd > 0 Then
Dim CboUM As DropDownList = Gvr.FCDropDownList("CboUnidadMedidaEdit")
Dim TxtPU As TextBox = Gvr.FCTextBox("TxtImporteEdit")
- CboUM.DataSource = GlobalDTProductosServiciosEquivalencias(Cvepsgvd, -1)
+ CboUM.DataSource = GlobalDTProductosServiciosEquivalencias(Cvepsgvd, -1, UsuarioActual.CveEmpresa)
CboUM.DataBind()
End If
End Sub
@@ -1879,7 +1879,7 @@ Partial Class OC
CboUnidadMedida.Items.Clear()
- CboUnidadMedida.DataSource = GlobalDTProductosServiciosEquivalencias(DdlP2.SelectedValue.ToEntero, -1)
+ CboUnidadMedida.DataSource = GlobalDTProductosServiciosEquivalencias(DdlP2.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa)
CboUnidadMedida.DataBind()
If CveEmpresaActual = 119 Then
@@ -5131,7 +5131,7 @@ Partial Class OC
DivProveedorSucursal.Visible = False
DivProveedorContacto.Visible = False
Else
- If Objeto.GetSucursales(DdlProveedores.SelectedValue.ToEntero) Then
+ If Objeto.GetSucursales(DdlProveedores.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
If Objeto.DtResultados.Rows.Count > 0 Then
DivProveedorSucursal.Visible = True
DdlProveedorSucursal.Items.Insert(0, New ListItem("Seleccione", "-1"))
@@ -5597,7 +5597,7 @@ Partial Class OC
Dim Body As String = GeneraCorreoProveedor(CveOrdenCompra, CveProveedor) 'genero los datos de la OC
Dim Correo As String = ""
'si tiene seleccionada una sucursal, obtengo su correo, sino tiene especificado tomo el correo principal del proveedor
- If DdlProveedorSucursal.SelectedValue.ToEntero > 0 Then Correo = GlobalDTProveedorSucursales(CveProveedor).FiltroPrimeroValor("Correo", $"CveProveedorSucursal={DdlProveedorSucursal.SelectedValue}")
+ If DdlProveedorSucursal.SelectedValue.ToEntero > 0 Then Correo = GlobalDTProveedorSucursales(CveProveedor, UsuarioActual.CveEmpresa).FiltroPrimeroValor("Correo", $"CveProveedorSucursal={DdlProveedorSucursal.SelectedValue}")
If Correo = "" Then Correo = GlobalDTCompProveedores(CveEmpresaActual).FiltraParametros($"CveProveedor = {CveProveedor}")(0)("ContactoMail").ToString
Try
@@ -7315,10 +7315,10 @@ Partial Class OC
RecargaPSGlobal()
End Sub
Private Sub RecargaPSGlobal()
- GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) = Nothing
+ 'GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) = Nothing
'Dim ObjPS As New ClsProductosServicios
- 'If ObjPS.GetPSSimplificado(-1) Then Application("GlobalDTPSSimplificado") = ObjPS.DtResultados.AsEnumerable()
+ 'If ObjPS.GetPSSimplificado(UsuarioActual.CveEmpresa) Then Application(String.Format("GlobalDTPSSimplificado{0}", UsuarioActual.CveEmpresa)) = ObjPS.DtResultados.AsEnumerable()
'ObjPS.Dispose()
End Sub
@@ -7329,11 +7329,12 @@ Partial Class OC
Hilo.Start()
End Sub
Private Sub GeneraGlobalEquivalencias()
- Dim ObjPS = New ClsProductosServicios
- If ObjPS.GetPSEquivalencias(-1, -1) Then
- GlobalDTProductosServiciosEquivalencias(-1, -1) = ObjPS.DtResultados
- End If
- ObjPS.Dispose()
+ 'Dim dtt As DataTable = GlobalDTProductosServiciosEquivalencias(-1, -1, UsuarioActual.CveEmpresa)
+ 'Dim ObjPS = New ClsProductosServicios
+ 'If ObjPS.GetPSEquivalencias(-1, UsuarioActual.CveEmpresa) Then
+ ' GlobalDTProductosServiciosEquivalencias(-1, -1, UsuarioActual.CveEmpresa) = ObjPS.DtResultados
+ 'End If
+ 'ObjPS.Dispose()
End Sub
#End Region
diff --git a/PyME/Sistemas/WizardRegistro.aspx.vb b/PyME/Sistemas/WizardRegistro.aspx.vb
index 23848c795..15c8a9d38 100644
--- a/PyME/Sistemas/WizardRegistro.aspx.vb
+++ b/PyME/Sistemas/WizardRegistro.aspx.vb
@@ -326,7 +326,7 @@ Partial Class Sistemas_WizardRegistro
End If
CargaGVClasificacion()
- If objunidadesMedida.GetUnidadesMedida() Then
+ If objunidadesMedida.GetUnidadesMedida(CveEmpresa) Then
DtUM = objunidadesMedida.DtResultados.FiltraParametros(String.Format("CveEmpresa = {0}", CveEmpresa))
GvUM.DataSource = DtUM
GvUM.DataBind()
@@ -1259,7 +1259,7 @@ Partial Class Sistemas_WizardRegistro
Else
Dim ObjFolio As New ClsGralFolios
If ModalidadModal = "Insertar" Then
- If ObjFolio.AddFolios(DdlSubProyecto.SelectedValue.ToEntero, DdlTipoDocto.SelectedValue, TxtFolioInicial.Text.ToEntero, TxtFolioInicial.Text.ToEntero, TxtFolioFinal.Text.ToEntero, "", 100, CveEmpresa) Then
+ If ObjFolio.AddFolios(DdlSubProyecto.SelectedValue.ToEntero, DdlTipoDocto.SelectedValue, "", TxtFolioInicial.Text.ToEntero, TxtFolioInicial.Text.ToEntero, TxtFolioFinal.Text.ToEntero, "", 100, CveEmpresa) Then
Alert("El Folio se agrego correctamente.", TipoMensaje.MsgInformacion)
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarFolio"))
End If
@@ -1267,7 +1267,7 @@ Partial Class Sistemas_WizardRegistro
If ModalidadModal = "Actualizar" Then
If CveModal > 0 Then
Dim CveFolio = CveModal
- If ObjFolio.UpdateFolios(DdlSubProyecto.SelectedValue.ToEntero, DdlTipoDocto.SelectedValue, TxtFolioInicial.Text.ToEntero, TxtFolioActual.Text.ToEntero, TxtFolioFinal.Text.ToEntero, "", If(ChkEstatus.Checked, True, False), 100, CveFolio) Then
+ If ObjFolio.UpdateFolios(DdlSubProyecto.SelectedValue.ToEntero, DdlTipoDocto.SelectedValue, "", TxtFolioInicial.Text.ToEntero, TxtFolioActual.Text.ToEntero, TxtFolioFinal.Text.ToEntero, "", If(ChkEstatus.Checked, True, False), 100, CveFolio) Then
Alert("El Folio se actualizo correctamente.", TipoMensaje.MsgInformacion)
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarFolio"))
End If
@@ -1781,7 +1781,7 @@ Partial Class Sistemas_WizardRegistro
Private Sub CargaDdlUM()
DdlUM.Items.Clear()
Dim ObjUM As New ClsUnidadesMedida
- If ObjUM.GetUnidadesMedida() Then
+ If ObjUM.GetUnidadesMedida(CveEmpresa) Then
DdlUM.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlUM.DataSource = ObjUM.DtResultados.FiltraParametros("CveEmpresa = " & CveEmpresa)
DdlUM.DataBind()
@@ -1852,7 +1852,7 @@ Partial Class Sistemas_WizardRegistro
Alert(String.Format("Se agregaron: {0} Unidades de Medida correctamente.", NumRows), TipoMensaje.MsgInformacion)
- If ObjUnidadesMedida.GetUnidadesMedida() Then
+ If ObjUnidadesMedida.GetUnidadesMedida(CveEmpresa) Then
GvUM.DataSource = ObjUnidadesMedida.DtResultados.FiltraParametros($"CveEmpresa = {CveEmpresa}")
GvUM.DataBind()
End If
@@ -1893,7 +1893,7 @@ Partial Class Sistemas_WizardRegistro
Private Sub CargaGVUM()
Dim ObjUM As New ClsUnidadesMedida
- If ObjUM.GetUnidadesMedida() Then
+ If ObjUM.GetUnidadesMedida(CveEmpresa) Then
GvUM.DataSource = ObjUM.DtResultados.FiltraParametros(String.Format("CveEmpresa={0}", CveEmpresa))
GvUM.DataBind()
End If
@@ -2063,7 +2063,7 @@ Partial Class Sistemas_WizardRegistro
'Obtengo Unidades de medida
Dim ObjUM As New ClsUnidadesMedida
Dim DTUM As New DataTable
- If ObjUM.GetUnidadesMedida() Then
+ If ObjUM.GetUnidadesMedida(CveEmpresa) Then
DTUM = ObjUM.DtResultados.FiltraParametros(String.Format("CveEmpresa={0}", CveEmpresa))
End If
ObjUM.Dispose()
@@ -2780,7 +2780,8 @@ Partial Class Sistemas_WizardRegistro
If Not ErrorClientes Then
ObjClientes.Commit()
- If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, -1) Then Application("GlobalDTCliente") = ObjClientes.DtResultados
+ 'If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, -1) Then Application("GlobalDTCliente") = ObjClientes.DtResultados
+
If Contador > 0 Then
Alert(String.Format("Se agregaron: {0} Clientes correctamente. Se Omitieron: {1} Clientes ya que ya se encontraban registrados.", NumRows - Contador, Contador), TipoMensaje.MsgInformacion)
Else
@@ -2957,7 +2958,7 @@ Partial Class Sistemas_WizardRegistro
ObjPS.Dispose()
Dim ObjUM As New ClsUnidadesMedida
- If ObjUM.GetUnidadesMedida() Then
+ If ObjUM.GetUnidadesMedida(CveEmpresa) Then
CveUnidadMedida = ObjUM.DtResultados.FiltraParametros($"CveEmpresa={CveEmpresa}").FiltroPrimeroValor("CveUnidadMedida").ToString.ToEntero
End If
ObjUM.Dispose()
@@ -3061,7 +3062,7 @@ Partial Class Sistemas_WizardRegistro
ObjPS.Dispose()
Dim ObjUM As New ClsUnidadesMedida
- If ObjUM.GetUnidadesMedida() Then
+ If ObjUM.GetUnidadesMedida(CveEmpresa) Then
CveUnidadMedida = ObjUM.DtResultados.FiltraParametros($"CveEmpresa={CveEmpresa}").FiltroPrimeroValor("CveUnidadMedida").ToString.ToEntero
End If
ObjUM.Dispose()
diff --git a/Sistemas/CatSesiones.aspx.vb b/Sistemas/CatSesiones.aspx.vb
index c60aab305..ea507a6fc 100644
--- a/Sistemas/CatSesiones.aspx.vb
+++ b/Sistemas/CatSesiones.aspx.vb
@@ -221,6 +221,7 @@ Partial Class Sistemas_CatSesiones
Private Sub CargaProductosServiciosSimplificado()
GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) = Nothing
+ Dim dt As DataTable = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
'Dim ObjPS As New ClsProductosServicios
'If ObjPS.GetPSSimplificado(-1) Then Application("GlobalDTPSSimplificado") = ObjPS.DtResultados.AsEnumerable() Else Application("GlobalDTPSSimplificado") = Nothing
'ObjPS.Dispose()
@@ -321,12 +322,13 @@ Partial Class Sistemas_CatSesiones
Private Sub CargaSubProyectos()
'Carga SubProyectos
+ GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa) = Nothing
Dim ObjSubProyectos As New ClsSubProyectos
- If ObjSubProyectos.GetSubProyectos Then
- Application("GlobalDTSubProyectos") = ObjSubProyectos.DtResultados
- Else
- Application("GlobalDTSubProyectos") = Nothing
- End If
+ 'If ObjSubProyectos.GetSubProyectos Then
+ ' Application("GlobalDTSubProyectos") = ObjSubProyectos.DtResultados
+ 'Else
+ ' Application("GlobalDTSubProyectos") = Nothing
+ 'End If
If ObjSubProyectos.GetSubProyectosUsuarios Then
Application("GlobalDTProyectosUsuarios") = ObjSubProyectos.DtResultados.FiltraParametros("", "", {"Proyecto", "CveProyecto", "CveUsuario", "CveEmpresa", "CveEstatusProyecto"})
Application("GlobalDTSubProyectosUsuarios") = ObjSubProyectos.DtResultados
@@ -447,7 +449,7 @@ Partial Class Sistemas_CatSesiones
Dim ObjProveedores As New ClsCompProveedores
If ObjProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaGlobalDT, -1, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, -1) Then Application("GlobalDTCompProveedores") = ObjProveedores.DtResultados Else Application("GlobalDTCompProveedores") = Nothing
If ObjProveedores.GetClasificacionProveedores Then Application("GlobalDTProveedorClasificacion") = ObjProveedores.DtResultados Else Application("GlobalDTProveedorClasificacion") = Nothing
- If ObjProveedores.GetSucursales(-1) Then Application("GlobalDTProveedorSucursales") = ObjProveedores.DtResultados Else Application("GlobalDTProveedorSucursales") = Nothing
+ If ObjProveedores.GetSucursales(-1, -1) Then Application("GlobalDTProveedorSucursales") = ObjProveedores.DtResultados Else Application("GlobalDTProveedorSucursales") = Nothing
ObjProveedores.Dispose()
End Sub
@@ -461,7 +463,15 @@ Partial Class Sistemas_CatSesiones
End Sub
Protected Sub BtnRefresh_Click(sender As Object, e As EventArgs) Handles BtnRefresh.Click
- Gv.DataSource = DirectCast(Application(DdlVariable.SelectedValue), DataTable)
+ Dim dt As DataTable = Nothing
+ Select Case DdlVariable.SelectedValue
+ Case ""
+ dt = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
+ Case Else
+ dt = DirectCast(Application(DdlVariable.SelectedValue & UsuarioActual.CveEmpresa), DataTable)
+ End Select
+
+ Gv.DataSource = dt
Gv.DataBind()
End Sub
diff --git a/Ventas/CatUnidadesMedida.aspx.vb b/Ventas/CatUnidadesMedida.aspx.vb
index 2120cc5da..6f6318edc 100644
--- a/Ventas/CatUnidadesMedida.aspx.vb
+++ b/Ventas/CatUnidadesMedida.aspx.vb
@@ -30,7 +30,7 @@ Partial Class CatUnidadesMedida
Dim ObjUnidadesMedida As New ClsUnidadesMedida
- If ObjUnidadesMedida.GetUnidadesMedida() Then
+ If ObjUnidadesMedida.GetUnidadesMedida(UsuarioActual.CveEmpresa) Then
GlobalDTUnidadesMedida = ObjUnidadesMedida.DtResultados
ViewState("DTUnidadesMedida") = ObjUnidadesMedida.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GvDatos.DataSource = ViewState("DTUnidadesMedida")
@@ -81,7 +81,7 @@ Partial Class CatUnidadesMedida
Dim ObjUnidadesMedida As New ClsUnidadesMedida
- If ObjUnidadesMedida.GetUnidadesMedidaAlias(cve) Then
+ If ObjUnidadesMedida.GetUnidadesMedidaAlias(UsuarioActual.CveEmpresa, cve) Then
ViewState("DTUnidadesMedidaAlias") = ObjUnidadesMedida.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
Else
ViewState("DTUnidadesMedidaAlias") = Nothing
diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb
index 30ad1dc8b..d2d59eace 100644
--- a/Ventas/Clientes.aspx.vb
+++ b/Ventas/Clientes.aspx.vb
@@ -2597,19 +2597,21 @@ Partial Class Clientes
#Region "G L O B L A L"
Private Sub RecargaGlobal()
- Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalDT)
- Hilo.Start()
+ 'Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalDT)
+ 'Hilo.Start()
+ GeneraGlobalDT()
End Sub
Private Sub GeneraGlobalDT()
- Dim Objclientes As New ClsClientes
- If Objclientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, -1, Estatus:=-1) Then
- Application("GlobalDTCliente") = Objclientes.DtResultados
- End If
- Objclientes.Dispose()
- End Sub
+ GlobalDTCliente(UsuarioActual.CveEmpresa) = Nothing
+ 'Dim Objclientes As New ClsClientes
+ 'If Objclientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, -1, Estatus:=-1) Then
+ ' Application("GlobalDTCliente") = Objclientes.DtResultados
+ 'End If
+ 'Objclientes.Dispose()
+ End Sub
#End Region
-
-
+
+
#Region "G R I D V I E W S"
Protected Sub GVHistorial_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVHistorial.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb
index c63687031..e00126eae 100644
--- a/Ventas/PV.aspx.vb
+++ b/Ventas/PV.aspx.vb
@@ -2866,6 +2866,10 @@ Partial Class PV
End If
End If
+ If ChkAjuste.Checked Then
+ CalculaMesesUso()
+ UpAjuste.Update()
+ End If
End If
@@ -4662,9 +4666,19 @@ Partial Class PV
RFVLocalidadC.Visible = False
RFVEstadoC.Visible = False
RFVPaisC.Visible = False
+ TxtNombreCliente.Focus()
DdlMetodoCliente.SelectedValueExist(1)
DdlFormaCliente.SelectedValueExist(1)
+ 'carga datos particulares de la sucursal
+ Dim dr As DataRow = GlobalDTSubProyectos(-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero).FiltroPrimero("")
+
+ If dr IsNot Nothing Then
+ TxtCPCliente.Text = dr("CP").ToString
+ TxtEstadoCliente.Text = dr("Estado").ToString
+ TxtCiudadCliente.Text = dr("Municipio").ToString
+ TxtLocalidadCliente.Text = dr("Localidad").ToString
+ End If
Else
Dim ObjCliente As New ClsClientes
If ObjCliente.ValidaClienteRFC(TxtRFCCliente.Text, UsuarioActual.CveEmpresa) Then
@@ -4914,15 +4928,17 @@ Partial Class PV
End Sub
Private Sub RecargaGlobalCliente()
- Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalDTCliente)
- Hilo.Start()
+ 'Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalDTCliente)
+ 'Hilo.Start()
+ GeneraGlobalDTCliente()
End Sub
- Private Sub GeneraGlobalDTCliente()
- Dim Objclientes As New ClsClientes
- If Objclientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, -1, Estatus:=-1, TipoCliente:=-1) Then
- Application("GlobalDTCliente") = Objclientes.DtResultados
- End If
- Objclientes.Dispose()
+ Private Sub GeneraGlobalDTCliente()
+ GlobalDTCliente(UsuarioActual.CveEmpresa) = Nothing
+ 'Dim Objclientes As New ClsClientes
+ 'If Objclientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, -1, Estatus:=-1, TipoCliente:=-1) Then
+ ' Application("GlobalDTCliente") = Objclientes.DtResultados
+ 'End If
+ 'Objclientes.Dispose()
End Sub
#End Region
@@ -5198,13 +5214,19 @@ Partial Class PV
Dim CvePSParametro As Integer = DdlPSAjuste.SelectedValue.ToEntero
Dim PrecioSugerido As Decimal = 0
Dim drPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSParametro).FiltroPrimero("")
+ Dim CveMarca As Integer
If drPS IsNot Nothing Then
PrecioSugerido = drPS("Precio").ToString.ToDecimal
+ CveMarca = drPS("CveMarca").ToString.ToEntero
End If
TxtPUFactura.Text = PrecioSugerido.FormatoNumero(2)
+ DdlTipoUso.Items.Clear()
+ DdlTipoUso.DataSource = GlobalDTAcumGarantiasMesesTipoUso(UsuarioActual.CveEmpresa, CveMarca)
+ DdlTipoUso.Items.Insert(0, New ListItem("Seleccione", "-1"))
+ DdlTipoUso.DataBind()
End If
If Not DdlPSAjuste.SelectedValue.ToEntero > 0 AndAlso DdlFacturas.SelectedValue.ToEntero > 0 Then
diff --git a/Ventas/ProductosServicios.aspx.vb b/Ventas/ProductosServicios.aspx.vb
index a0ae980b3..02e41c2ce 100644
--- a/Ventas/ProductosServicios.aspx.vb
+++ b/Ventas/ProductosServicios.aspx.vb
@@ -1326,11 +1326,12 @@ Partial Class ProductosyServicios
#Region "G L O B L A L"
Private Sub RecargaGlobal()
- Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalDT)
- Hilo.Start()
+ 'Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalDT)
+ 'Hilo.Start()
+ GeneraGlobalDT()
End Sub
Private Sub GeneraGlobalDT()
- GlobalDTPSAdicionales(-1, UsuarioActual.CveEmpresa) = Nothing
+
GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) = Nothing
GlobalDTProductosServiciosAlias(UsuarioActual.CveEmpresa) = Nothing
GlobalDTImpuestosLocales(-1, UsuarioActual.CveEmpresa) = Nothing
@@ -1339,23 +1340,23 @@ Partial Class ProductosyServicios
'Dim ObjPS As New ClsProductosServicios
- 'If ObjPS.GetPSSimplificado(-1) Then Application("GlobalDTPSSimplificado") = ObjPS.DtResultados.AsEnumerable()
+ 'If ObjPS.GetPSSimplificado(UsuarioActual.CveEmpresa) Then Application(String.Format("GlobalDTPSSimplificado{0}", UsuarioActual.CveEmpresa)) = ObjPS.DtResultados.AsEnumerable()
- 'If ObjPS.GetPSAlias(-1, -1) Then
- ' GlobalDTProductosServiciosAlias(-1) = ObjPS.DtResultados
+ ''If ObjPS.GetPSAlias(-1, UsuarioActual.CveEmpresa) Then
+ ' GlobalDTProductosServiciosAlias(UsuarioActual.CveEmpresa) = ObjPS.DtResultados
'End If
- 'If ObjPS.GetPSImpuestosLocales(-1, -1) Then
- ' GlobalDTImpuestosLocales(-1, -1) = ObjPS.DtResultados
+ 'If ObjPS.GetPSImpuestosLocales(-1, UsuarioActual.CveEmpresa) Then
+ ' GlobalDTImpuestosLocales(-1, UsuarioActual.CveEmpresa) = ObjPS.DtResultados
'End If
- 'If ObjPS.GetPSEquivalencias(-1, -1) Then
+ 'If ObjPS.GetPSEquivalencias(-1, UsuarioActual.CveEmpresa) Then
' GlobalDTProductosServiciosEquivalencias(-1, -1, UsuarioActual.CveEmpresa) = ObjPS.DtResultados
'End If
- ''If ObjPS.GetPSAdicionales(-1, -1) Then
- '' GlobalDTPSAdicionales(-1, -1) = ObjPS.DtResultados
- ''End If
+ 'If ObjPS.GetPSAdicionales(-1, UsuarioActual.CveEmpresa) Then
+ ' GlobalDTPSAdicionales(-1, UsuarioActual.CveEmpresa) = ObjPS.DtResultados
+ 'End If
'ObjPS.Dispose()
End Sub
@@ -1401,8 +1402,9 @@ Partial Class ProductosyServicios
End Sub
Private Sub RecargaGlobalEquivalencias()
- Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalEquivalencias)
- Hilo.Start()
+ 'Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalEquivalencias)
+ 'Hilo.Start()
+ GeneraGlobalEquivalencias()
End Sub
Private Sub GeneraGlobalEquivalencias()
GlobalDTProductosServiciosEquivalencias(-1, -1, UsuarioActual.CveEmpresa) = Nothing
diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx
index cc817e97b..01639bdf5 100644
--- a/Ventas/Ventas.aspx
+++ b/Ventas/Ventas.aspx
@@ -5834,18 +5834,7 @@
-
-
-
-
-
-
-
- ó
-
-
-
-
+
@@ -7284,10 +7273,10 @@
$(".select2-container.select2-container--default.select2-container--open .select2-dropdown .select2anothertable").scrollTop(stop);
}
function CargaExistenciaAlmacenes(data, params) {
- var div = $('');
+ var div = $('');
$('.select2-container.select2-container--default.select2-container--open .select2-dropdown .select2anothertable').remove();
$('.select2-container.select2-container--default.select2-container--open .select2-dropdown').prepend(div);
- var table = $('