Files
SIG/Ashx/SIGFacturacion.ashx
2020-07-09 17:07:46 -07:00

3759 lines
178 KiB
Plaintext

<%@ WebHandler Language="VB" Class="SIGFacturacion" %>
Imports System
Imports System.Web
Imports System.Net.Http
Imports System.Web.Http
Imports System.Data
Imports Newtonsoft.Json
Imports Newtonsoft.Json.Linq
Imports Extensiones
Imports System.IO
Imports Modelos
Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
context.Response.ContentType = "application/json"
Try
If context.Request.InputStream IsNot Nothing Then
Using reader As New StreamReader(context.Request.InputStream)
Dim json = reader.ReadToEnd
If Not String.IsNullOrEmpty(json) Then
Dim JsonRequest As JObject = JObject.Parse(json)
If JsonRequest IsNot Nothing Then
Dim Metodo = JsonRequest("Metodo").ToString()
If Metodo = "FactMasivaRemisiones" Then
Dim pCveEmpresa = JsonRequest("CveEmpresa").ToString()
Dim pFechaI As String = ""
Dim pFechaF As String = ""
If JsonRequest("FechaI") IsNot Nothing AndAlso JsonRequest("FechaF") IsNot Nothing Then
pFechaI = JsonRequest("FechaI")
pFechaF = JsonRequest("FechaF")
End If
IniciaFacturacionMasiva(context, pCveEmpresa, pFechaI, pFechaF)
End If
End If
End If
End Using
End If
Catch ex As Exception
ex.GuardaLog(ex.Message)
End Try
End Sub
Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable
Get
Return False
End Get
End Property
Private Sub IniciaFacturacionMasiva(ByVal context As HttpContext, pCveEmpresa As String, pFechaI As String, pFechaF As String)
Dim JsonRetorno As New JObject()
Dim CveEmpresa As Integer = pCveEmpresa.ToEntero()
If CveEmpresa > 0 Then
Dim Usuario = ValidaUsuarioSistema(CveEmpresa)
Dim FechaI, FechaF As DateTime
'EnviarCorreoFactura(New Modelos.Factura(Usuario, 844966, 1, context.ModExtensiones.DirectorioBaseEmpresas), Usuario)
If String.IsNullOrEmpty(pFechaI) AndAlso String.IsNullOrEmpty(pFechaF) Then
Dim FechaReferencia = Now
If FechaReferencia.DayOfWeek = DayOfWeek.Sunday Then
Dim Sabado = FechaReferencia.AddDays(-1)
Dim DomingoAnterior = FechaReferencia.AddDays(-7)
FechaI = New DateTime(DomingoAnterior.Year, DomingoAnterior.Month, DomingoAnterior.Day, 0, 0, 0)
FechaF = New DateTime(Sabado.Year, Sabado.Month, Sabado.Day, 23, 59, 59)
JsonRetorno = EjecutarFacturacionMasiva(Usuario, FechaI, FechaF, Usuario.Empresa.FacturaProduccion)
End If
Else
FechaI = pFechaI.ToDateTime()
FechaF = pFechaF.ToDateTime()
JsonRetorno = EjecutarFacturacionMasiva(Usuario, FechaI, FechaF, Usuario.Empresa.FacturaProduccion)
End If
End If
context.Response.Write(JsonRetorno)
End Sub
Public Shared Function GetNextWeekday(ByVal start As DateTime, ByVal day As DayOfWeek, hora As TimeSpan) As DateTime
Dim daysToAdd As Integer = (CInt(day) - CInt(start.DayOfWeek) + 7) Mod 7
Dim fecha = start.AddDays(daysToAdd)
Return (fecha.Date + hora)
End Function
Public Shared Function GetLastWeekday(ByVal start As DateTime, ByVal day As DayOfWeek, hora As TimeSpan) As DateTime
Dim daysToAdd As Integer = (CInt(day) - CInt(start.DayOfWeek) - 7) Mod 7
Dim fecha = start.AddDays(daysToAdd)
Return (fecha.Date + hora)
End Function
Private Function EjecutarFacturacionMasiva(UsuarioActual As Usuario, FechaI As DateTime, FechaF As DateTime, Optional Produccion As Boolean = True) As JObject
Dim Facturas As New JArray()
Dim DebeTimbrar As Boolean = True
Dim Json As New JObject(
New JProperty("Empresa", UsuarioActual.Empresa.Empresa),
New JProperty("Usuario", UsuarioActual.Usuario),
New JProperty("FechaI", FechaI.ToString("dd/MM/yyy HH:mm:ss")),
New JProperty("FechaF", FechaF.ToString("dd/MM/yyy HH:mm:ss"))
)
Dim DTClientes As DataTable = Nothing
Dim DTRemisionesPS As DataTable = Nothing
Dim ObjCliente As New ClsClientes
If ObjCliente.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, TipoCliente:=-1) Then
If ObjCliente.DtResultados.Rows.Count > 0 Then
DTClientes = ObjCliente.DtResultados.Copy()
End If
End If
ObjCliente.Dispose()
If DTClientes IsNot Nothing Then
'QUITAR CLIENTES QUE NO DEBEN DE ESTAR
DTClientes = DTClientes.FiltraParametros("CveCliente NOT IN (265989,265991,265994,266010,266011,266013) ")
For Each RowCliente As DataRow In DTClientes.Rows
Dim CveCliente As Integer = RowCliente("CveCliente").ToString().ToEntero()
Dim DatosRemisiones As JObject = CargaRemisiones(FechaI, FechaF, CveCliente)
Dim CveRemisiones As String = DatosRemisiones("VentasConcatenadas").ToString()
If Not String.IsNullOrEmpty(CveRemisiones) Then
Dim ObjClientes As New ClsClientes
If ObjClientes.GetVentasRemisionesTotales(CveCliente, CveRemisiones, 1) Then
DTRemisionesPS = ObjClientes.DtResultados.Copy()
End If
ObjClientes.Dispose()
If DTRemisionesPS IsNot Nothing AndAlso DTRemisionesPS.Rows.Count > 0 Then
Dim Resp As New Modelos.Factura.MMensajeFactura
Dim CveSubProyectoMatriz As Integer = GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", "TipoSucursal = 1").ToEntero()
Dim ObjFactura = CreaFactura(Resp, UsuarioActual, DTRemisionesPS, RowCliente("CveCliente").ToString().ToEntero(), CveSubProyectoMatriz, 1, DatosRemisiones, FechaI, FechaF)
If ObjFactura IsNot Nothing Then
Resp = ObjFactura.EmitirFactura(DebeTimbrar)
End If
If Resp.CveVenta > 0 AndAlso Not Resp.TieneError Then
If Resp.SeTimbro OrElse Not Produccion Then
EnviarCorreo(ObjFactura, UsuarioActual)
End If
End If
Facturas.Add(JObject.Parse(JsonConvert.SerializeObject(Resp)))
DTRemisionesPS.Dispose()
'ObjFactura.Dispose()
End If
End If
DTRemisionesPS = Nothing
Next
DTClientes.Dispose()
End If
Json.Add(New JProperty("Facturas", Facturas))
Return Json
End Function
Private Function CargaRemisiones(FechaI As DateTime, FechaF As DateTime, CveCliente As Integer) As JObject
Dim json As New JObject()
Dim VentasArray As New JArray
Dim DTRemisiones As DataTable = Nothing
Dim ObjVentas As New ClsVentas
If ObjVentas.GetRemisionesSinFacturar(FechaI, FechaF, CveCliente, -1, 1, -1) Then
DTRemisiones = ObjVentas.DtResultados.FiltraParametros("CveContrato = 0")
End If
ObjVentas.Dispose()
Dim sbRemisiones As New StringBuilder
Dim MensajeRemisiones As New StringBuilder
Dim ObsOC As New StringBuilder
Dim ObsPedido As New StringBuilder
Dim ObsInv As New StringBuilder
If DTRemisiones IsNot Nothing AndAlso DTRemisiones.Rows.Count > 0 Then
MensajeRemisiones.Append("Remisiones: ")
For Each Dr As DataRow In DTRemisiones.Rows
VentasArray.Add(New JObject(New JProperty("CveVenta", Dr("CveVenta").ToString)))
sbRemisiones.AppendFormat("{0},", Dr("CveVenta").ToString)
MensajeRemisiones.AppendFormat("{0} {1}, ", Dr("Folio"), If(Dr("ObsFact").ToString.Length > 0, String.Format("({0})", Dr("ObsFact")), ""))
ObsOC.AppendFormat("{0}, ", Dr("ObsOC"))
ObsPedido.AppendFormat("{0}, ", Dr("ObsPedido"))
ObsInv.AppendFormat("{0}, ", Dr("ObsInv"))
Next
sbRemisiones.Remove(sbRemisiones.Length - 1, 1)
DTRemisiones.Dispose()
End If
DTRemisiones = Nothing
json.Add(New JProperty("Ventas", VentasArray))
json.Add(New JProperty("VentasConcatenadas", sbRemisiones.ToString()))
json.Add(New JProperty("Observaciones", MensajeRemisiones.ToString()))
json.Add(New JProperty("OrdenCompra", ObsOC.ToString()))
json.Add(New JProperty("Pedido", ObsPedido.ToString()))
json.Add(New JProperty("Almacen", ObsInv.ToString()))
Return json
End Function
#Region "V A L I D A - D A T O S"
Private Function ValidaUsuarioSistema(CveEmpresa As Integer) As Usuario
Dim UsuarioActual As Usuario = Nothing
Dim ObjUsuarios As New ClsSisUsuarios
If ObjUsuarios.GetUsuarios(100) Then
If ObjUsuarios.DtResultados.Rows.Count > 0 Then
Dim Usuario = ObjUsuarios.DtResultados.Rows(0)("Usuario").ToString()
Dim Contrasenia = ObjUsuarios.DtResultados.Rows(0)("Contraseña").ToString()
UsuarioActual = ObjUsuarios.ValidaUsuario(Usuario, Contrasenia, IMEI, CveEmpresa)
UsuarioActual.CveEmpresa = CveEmpresa
CreaObjetoEmpresa(UsuarioActual)
End If
End If
ObjUsuarios.Dispose()
Return UsuarioActual
End Function
Private Sub CreaObjetoEmpresa(ByRef UsuarioActual As Usuario)
Dim ObjEmpresa As New ClsSisEmpresas()
If ObjEmpresa.GetEmpresas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1") Then
If ObjEmpresa.GetEmpresasFuncionalidades(UsuarioActual.CveEmpresa) Then
Dim dttmp As Data.DataTable = ObjEmpresa.DtResultados
Dim EmpresasFuncionalidades As New HybridDictionary
For Each Row As Data.DataRow In dttmp.Rows
EmpresasFuncionalidades.Add(Convert.ToInt32(Row("CveFuncionalidad")), Row("Valor").ToString)
Next
ObjEmpresa.Empresa.SetFuncionalidades(EmpresasFuncionalidades)
End If
UsuarioActual.Empresa = ObjEmpresa.Empresa
End If
ObjEmpresa.Dispose()
End Sub
#End Region
#Region "D E F I N I R - O B J E T O S"
Private Function CreaFactura(Resp As Modelos.Factura.MMensajeFactura, UsuarioActual As Usuario, DTRemisionesPS As DataTable, CveCliente As Integer, CveSubProyecto As Integer, CveMoneda As Integer, DatosRemisiones As JObject, FechaI As DateTime, FechaF As DateTime) As Modelos.Factura
Try
Dim Folio As String = ""
Dim Serie As String = ""
Dim ObjFolios As New ClsGralFolios()
If ObjFolios.GetFolios("Ing", UsuarioActual.CveEmpresa) Then
Dim DT As DataTable = ObjFolios.DtResultados.FiltraParametros(String.Format(" Estado = 'Activo' AND CveSubProyecto = {0}", CveSubProyecto))
If DT.Rows.Count > 0 Then
Serie = DT.Rows(0)("Serie").ToString()
Folio = DT.Rows(0)("FActual").ToString()
End If
DT.Dispose()
End If
ObjFolios.Dispose()
Dim ObjFactura = New Modelos.Factura(UsuarioActual)
ObjFactura.TipoMensajeRespuesta = Modelos.TipoMensajeRespuesta.TextoLimpio
ObjFactura.Serie = Serie
ObjFactura.Folio = Folio.ToEntero()
ObjFactura.TipoMensajeRespuesta = TipoMensajeRespuesta.TextoLimpio
ObjFactura.Version = "3.3"
ObjFactura.FolioFiscal = ""
ObjFactura.CveUsuario = UsuarioActual.CveUsuario
ObjFactura.CveEmpresa = UsuarioActual.CveEmpresa
ObjFactura.TipoCambio = 1
ObjFactura.ConvertirPesos = False
ObjFactura.CveMoneda = CveMoneda
ObjFactura.Moneda = GlobalDTMonedas.FiltroPrimeroValor("Moneda", String.Format("CveMoneda = {0} ", CveMoneda))
ObjFactura.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", String.Format("CveMoneda = {0} ", CveMoneda))
ObjFactura.TipoDocto = "Ing"
ObjFactura.RefDocto = ""
ObjFactura.CveMesa = -1
ObjFactura.Fecha = Now
ObjFactura.CvePrePoliza = -1
ObjFactura.FechaPago = Now
ObjFactura.MotivoDescuento = ""
ObjFactura.FechaEjecucion = Now
ObjFactura.UsuarioCreo = UsuarioActual.Usuario
ObjFactura.CveCondicionEntrega = -1
ObjFactura.CondicionEntrega = ""
ObjFactura.NumeroCuenta = ""
ObjFactura.CondicionesPago = 0
ObjFactura.FormaPago = 0
ObjFactura.PedidoContrato = ""
ObjFactura.NumeroContrato = ""
ObjFactura.DescripcionContrato = ""
ObjFactura.CveCorte = -1
ObjFactura.TipoDocumento = "Ingresos"
ObjFactura.Alfa1 = ""
ObjFactura.Alfa2 = ""
ObjFactura.Alfa3 = ""
ObjFactura.CveContrato = -1
ObjFactura.ConvertirPesos = False
ObjFactura.CveSubProyecto = CveSubProyecto
ObjFactura.CveSubProyectoCobranza = CveSubProyecto
ObjFactura.CveSubProyectoEjecucion = CveSubProyecto
ObjFactura.SubProyecto = New SubProyectoModel(GlobalDTSubProyectos(-1).FiltroPrimero(String.Format("CveSubProyecto = {0}", CveSubProyecto)))
ObjFactura.SubProyectoMatriz = New SubProyectoModel(GlobalDTSubProyectos(-1, CveSubProyecto:=-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("TipoSucursal=1"))
'CLIENTE
ObjFactura.CveCliente = CveCliente
ObjFactura.SetCliente()
ObjFactura.CveAlmacen = -1
Dim ObjCliente As New ClsClientes
If ObjCliente.GetClientes(CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, -1, TipoCliente:=-1) Then
If ObjCliente.DtResultados.Rows.Count > 0 Then
ObjFactura.CveFormaPago33 = ObjCliente.CveFormaPago33
ObjFactura.FormaPago33 = GlobalDTVtaFormaPago.FiltroPrimeroValor("FormaPago", String.Format("CveFormaPago = {0}", ObjCliente.CveFormaPago33))
ObjFactura.FormaPagoSAT33 = GlobalDTVtaFormaPago.FiltroPrimeroValor("ClaveFormaPagoSAT", String.Format("CveFormaPago = {0}", ObjCliente.CveFormaPago33))
ObjFactura.CveMetodoPago33 = ObjCliente.CveMetodoPago33
ObjFactura.MetodoPago33 = GlobalDTVtaMetodoPago.FiltroPrimeroValor("MetodoPago", String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago33))
ObjFactura.ClaveMetodoPagoSAT = GlobalDTVtaMetodoPago.FiltroPrimeroValor("ClaveMetodoPagoSAT", String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago33))
ObjFactura.CveUsoCFDI = ObjCliente.CveUsoCFDI
ObjFactura.UsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("Descripcion", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI))
ObjFactura.ClaveUsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI))
ObjFactura.CveMetodoPago = ObjCliente.CveMetodoPago
If GlobalDTMetodosPago.FiltraParametros(String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago)).Rows.Count > 0 Then
ObjFactura.MetodoPago = GlobalDTMetodosPago.FiltraParametros(String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago)).Rows(0)("MetodoPago").ToString
Else
ObjFactura.CveMetodoPago = 1
ObjFactura.MetodoPago = "Efectivo"
End If
End If
End If
If ObjCliente.GetSucursales(CveCliente) Then
If ObjCliente.DtResultados.Rows.Count > 0 Then
ObjFactura.CveClienteSucursal = If(String.IsNullOrEmpty(ObjCliente.DtResultados.FiltroPrimeroValor("CveClienteSucursal", "Estatus = 'Activo'")), -1, ObjCliente.DtResultados.FiltroPrimeroValor("CveClienteSucursal", "Estatus = 'Activo'").ToEntero())
Else
ObjFactura.CveClienteSucursal = -1
End If
End If
ObjCliente.Dispose()
'DETALLES
ObjFactura.DtDetalle = CreaDTDetalle(Resp, UsuarioActual, DTRemisionesPS)
ObjFactura.DtRemisionesPS = DTRemisionesPS
Dim TotalImporte As Decimal = ObjFactura.DtDetalle.SUM("TotalImporte").ToDecimal()
Dim ImporteIVA As Decimal = ObjFactura.DtDetalle.SUM("ImporteIVA").ToDecimal()
Dim ImporteRetIVA As Decimal = ObjFactura.DtDetalle.SUM("ImporteRetIVA").ToDecimal()
Dim ImporteRetISR As Decimal = ObjFactura.DtDetalle.SUM("ImporteRetISR").ToDecimal()
Dim ImporteIEPS As Decimal = ObjFactura.DtDetalle.SUM("ImporteIEPS").ToDecimal()
Dim Descuento As Decimal = ObjFactura.DtDetalle.SUM("Descuento").ToDecimal()
Dim Amortizacion As Decimal = 0
Dim Total As Decimal = (TotalImporte + ImporteIVA + ImporteIEPS) - (ImporteRetIVA + ImporteRetISR + Descuento + Amortizacion)
'DETALLES
ObjFactura.SubTotal = TotalImporte
ObjFactura.Descuento = Descuento
ObjFactura.Amortizacion = Amortizacion
ObjFactura.IVA = ImporteIVA
ObjFactura.RetIVA = ImporteRetIVA
ObjFactura.RetISR = ImporteRetISR
ObjFactura.IEPS = ImporteIEPS
ObjFactura.Total = Total
ObjFactura.TotalOtrosConceptos = 0
'VALIDA PROMOCIONES Y EXISTENCIAS
Dim ObjVentas As New ClsVentas
If ObjVentas.GetPromocionesPS(-1, Now, CveSubProyecto, ObjFactura.CveCliente, ObjFactura.CveVendedor, UsuarioActual.CveEmpresa) Then
ObjFactura.DtPromociones = ObjVentas.DtResultados.Copy()
End If
If ObjVentas.GetRemisionesSinFacturar(FechaI, FechaF, CveCliente, -1, 1, -1) Then
ObjFactura.DtRemisiones = ObjVentas.DtResultados.FiltraParametros("CveContrato = 0")
End If
ObjVentas.Dispose()
ObjFactura.Observaciones = DatosRemisiones("Observaciones").ToString()
ObjFactura.OrdenCompra = DatosRemisiones("OrdenCompra").ToString()
ObjFactura.PedidoContrato = DatosRemisiones("Pedido").ToString()
ObjFactura.ObservacionesAlmacen = DatosRemisiones("Almacen").ToString()
For Each Venta As JObject In DatosRemisiones("Ventas")
ObjFactura.RemisionesLista.Add(Venta("CveVenta"))
Next
ObjFactura.Timbre = PreParaTimbre(ObjFactura)
ObjFactura.FemsaFactura = New Modelos.FemsaFactura() With {
.AplicaFEMSA = False,
.FEMSA_Version = 1
}
Return ObjFactura
Catch ex As Exception
Resp.Mensajes.Add(ex.ToString())
Return Nothing
End Try
End Function
Private Function PreParaTimbre(Obj As Modelos.Factura) As CFDITimbre
Dim Timbre As New CFDITimbre
Timbre.Comprobante.TipoComprobante = If(Obj.TipoDocto.Contiene("Ing", "Ant"), "I", If(Obj.TipoDocto.Contiene("Egs", "Dev"), "E", ""))
Timbre.Comprobante.Folio = Obj.Folio.ToString
Timbre.Comprobante.Serie = Obj.Serie
Timbre.Comprobante.Fecha = Obj.FechaCP
Timbre.Comprobante.FormadePago = Obj.FormaPagoSAT33
Timbre.Comprobante.CondicionesdePago = Obj.FormaPago33
Timbre.Comprobante.MetodoPago = Obj.ClaveMetodoPagoSAT
Timbre.Comprobante.Subtotal = Obj.SubTotal
Timbre.Comprobante.Descuentos = Obj.Descuento
Timbre.Comprobante.Moneda = Obj.MonedaSAT
Timbre.Comprobante.TipoCambio = If(Obj.CveMoneda = 1, "1", Obj.TipoCambio.ToString)
Timbre.Comprobante.Total = Obj.Total
Timbre.Comprobante.LugarExpedicion = Obj.SubProyecto.CP
Timbre.Comprobante.Confirmacion = ""
Timbre.Receptor.RFC = Obj.Cliente.RFC
Timbre.Receptor.Nombre = Obj.Cliente.Nombre
Timbre.Receptor.ResidenciaFiscal = ""
Timbre.Receptor.NumeroRegistroTributario = ""
Timbre.Receptor.UsoCFDI = Obj.ClaveUsoCFDI
If Obj.CveTipoRelacion > 0 Then
Select Case Obj.CveTipoRelacion
Case 1
Timbre.CFDIRelacionados.TipoRelacion = "01"
Timbre.CFDIRelacionados.TipoRelacionTexto = "01-Nota de Crédito aplicada a Ingreso"
Case 2
Timbre.CFDIRelacionados.TipoRelacion = "02"
Timbre.CFDIRelacionados.TipoRelacionTexto = "02-Nota de débito de los documentos relacionados"
Case 3
Timbre.CFDIRelacionados.TipoRelacion = "03"
Timbre.CFDIRelacionados.TipoRelacionTexto = "03-Devolución aplicada a Ingreso"
Case 4
Timbre.CFDIRelacionados.TipoRelacion = "04"
Timbre.CFDIRelacionados.TipoRelacionTexto = "04-Refacturación de Ingreso"
Case 7
Timbre.CFDIRelacionados.TipoRelacion = "07"
Timbre.CFDIRelacionados.TipoRelacionTexto = "07-CFDI por aplicación de anticipo"
Case 8
Timbre.CFDIRelacionados.TipoRelacion = "08"
Timbre.CFDIRelacionados.TipoRelacionTexto = "08-Factura generada por pagos en parcialidades "
Case 9
Timbre.CFDIRelacionados.TipoRelacion = "09"
Timbre.CFDIRelacionados.TipoRelacionTexto = "09-Factura generada por pagos diferidos"
End Select
End If
Dim totSubTotal As Decimal = Obj.SubTotal
Dim totIVA As Decimal = Obj.IVA
Dim totRetIVA As Decimal = Obj.RetIVA
Dim totRetISR As Decimal = Obj.RetISR
Dim i As Integer = 1
'DETALLES
Dim tPS As String = ""
For Each drr As DataRow In Obj.DtDetalle.Rows
If drr("PS").ToString.Length = 1 Then
tPS = drr("Obs").ToString
Else
If drr("PS").ToString.Length = 0 Then
tPS = ""
Else
tPS = String.Format("{0} {1}", drr("PS"), drr("Obs"))
End If
End If
'CONDICIONANTE, ESPECIAL
If Obj.CveEmpresa = 15 Then drr("UM") = "" 'LES COMENTAN QUE NO DEBE IR LA ETIQUETA DE LA UNIDAD EN EL PRODUCTO
Dim concepto As New CFDIConceptos With {.Cantidad = drr("Cantidad").ToString.ToDecimal,
.Descripcion = tPS,
.ValorUnitario = drr("PU").ToString.ToDecimal,
.Importe = drr("TotalImporte").ToString.ToDecimal,
.Descuento = drr("Descuento").ToString.ToDecimal,
.Unidad = drr("UM").ToString,
.ClaveUnidad = drr("SATClaveUM").ToString,
.ClaveProdServ = drr("SATClaveProdServ").ToString,
.Noidentificacion = drr("Noidentificacion").ToString,
.CuentaPredial = drr("CuentaPredial").ToString}
'VERIFICA SUMA SUBTOTALES
If i = Obj.DtDetalle.Rows.Count AndAlso totSubTotal <> concepto.Importe Then 'PROCESO DE AJUSTA DE DECIMALES
concepto.Importe = totSubTotal
End If
totSubTotal = totSubTotal - concepto.Importe
'SIEMPRE ESTAMOS AGREGANDO EL IVA
concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = drr("PorcentajeIVA").ToString.ToDecimal, .Impuesto = "002", .Importe = drr("ImporteIVA").ToString.ToDecimal})
If drr("ImporteIEPS").ToString.ToDouble > 0 Then
concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = drr("PorcentajeIEPS").ToString.ToDecimal, .Impuesto = "003", .Importe = drr("ImporteIEPS").ToString.ToDecimal})
End If
If drr("ImporteRetIVA").ToString.ToDouble > 0 Then 'si hay retenciones
concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "R", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = drr("PorcentajeRetIVA").ToString.ToDecimal, .Impuesto = "002", .Importe = drr("ImporteRetIVA").ToString.ToDecimal})
End If
If drr("ImporteRetISR").ToString.ToDouble > 0 Then 'retención de ISR
concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "R", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = drr("PorcentajeRetISR").ToString.ToDecimal, .Impuesto = "001", .Importe = drr("ImporteRetISR").ToString.ToDecimal})
End If
Timbre.Conceptos.Add(concepto)
i += 1
Next
Return Timbre
End Function
Private Function CreaDTDetalle(ByRef Retorno As Modelos.Factura.MMensajeFactura, UsuarioActual As Usuario, DtRemisionesPS As DataTable) As DataTable
Dim TmpDT = New DataTable
TmpDT.Columns.Add("CveVenta", GetType(Integer))
TmpDT.Columns.Add("Consec", GetType(Integer))
TmpDT.Columns.Add("Cantidad", GetType(Decimal))
TmpDT.Columns.Add("Codigo", GetType(String))
TmpDT.Columns.Add("CveUM", GetType(Integer))
TmpDT.Columns.Add("UM", GetType(String))
TmpDT.Columns.Add("SATClaveUM", GetType(String))
TmpDT.Columns.Add("CveClasificacion", GetType(Integer))
TmpDT.Columns.Add("Clasificacion", GetType(String))
TmpDT.Columns.Add("CvePS", GetType(Integer))
TmpDT.Columns.Add("PS", GetType(String))
TmpDT.Columns.Add("CodigoPS", GetType(String))
TmpDT.Columns.Add("SATClaveProdServ", GetType(String))
TmpDT.Columns.Add("NoIdentificacion", GetType(String))
TmpDT.Columns.Add("CveTipoPS", GetType(Integer))
TmpDT.Columns.Add("CveTipoInvPS", GetType(Integer))
TmpDT.Columns.Add("Serie", GetType(String))
TmpDT.Columns.Add("CuentaPredial", GetType(String))
TmpDT.Columns.Add("Obs", GetType(String))
TmpDT.Columns.Add("TiempoEntrega", GetType(String))
TmpDT.Columns.Add("PU", GetType(Decimal))
TmpDT.Columns.Add("IVA", GetType(Decimal))
TmpDT.Columns.Add("ImporteIVA", GetType(Decimal))
TmpDT.Columns.Add("PorcentajeIVA", GetType(Decimal))
TmpDT.Columns.Add("ImporteRetIVA", GetType(Decimal))
TmpDT.Columns.Add("ImporteRetISR", GetType(Decimal))
TmpDT.Columns.Add("PorcentajeRetIVA", GetType(Decimal))
TmpDT.Columns.Add("PorcentajeRetISR", GetType(Decimal))
TmpDT.Columns.Add("ImporteIEPS", GetType(Decimal))
TmpDT.Columns.Add("IEPS", GetType(Decimal))
TmpDT.Columns.Add("PorcentajeIEPS", GetType(Decimal))
TmpDT.Columns.Add("Descuento", GetType(Decimal))
TmpDT.Columns.Add("TipoDescuento", GetType(Integer))
TmpDT.Columns.Add("TotalImporte", GetType(Decimal))
TmpDT.Columns.Add("Total", GetType(Decimal))
'Para uso del módulo contable
TmpDT.Columns.Add("AsientoContableVentas", GetType(Integer))
TmpDT.Columns.Add("IdCtaContVentas", GetType(Integer))
TmpDT.Columns.Add("AplicaParaConcepto", GetType(Boolean))
TmpDT.Columns.Add("CveProyecto", GetType(Integer))
TmpDT.Columns.Add("Proyecto", GetType(String))
TmpDT.Columns.Add("CveSubProyecto", GetType(Integer))
TmpDT.Columns.Add("SubProyecto", GetType(String))
'TipoDescuento: 1 = Descuento * PU; 2 = Descuento por Total del concepto
TmpDT.Columns.Add("CvePresupuestoIngreso", GetType(Integer))
TmpDT.Columns.Add("CveFuenteRecaudacion", GetType(Integer))
'Contratos
TmpDT.Columns.Add("CveContratoDetalle", GetType(Integer))
'Remisiones a Facturas
TmpDT.Columns.Add("CveVentaDetalle", GetType(Integer))
TmpDT.Columns.Add("CveVentaDetalleRemision", GetType(Integer))
TmpDT.Columns.Add("CveVentaDetalleCotizacion", GetType(Integer))
'Pedido2 a Facturas
TmpDT.Columns.Add("CveVentaDetallePedido2", GetType(Integer))
TmpDT.Columns.Add("Origen", GetType(Integer))
'Ordenes Servicio
TmpDT.Columns.Add("CveOS", GetType(Integer))
TmpDT.Columns.Add("CveOSDetalle", GetType(Integer))
TmpDT.Columns.Add("SeFacturara", GetType(Integer))
TmpDT.Columns.Add("Folio", GetType(Integer))
TmpDT.Columns.Add("Estatus", GetType(String))
'Ordenamiento
TmpDT.Columns.Add("Orden", GetType(Integer))
TmpDT.Columns.Add("TipoDocto", GetType(String))
'OC
TmpDT.Columns.Add("CveOrdenCompraDetalle", GetType(Integer))
TmpDT.Columns.Add("EntregaDirecta", GetType(Integer))
TmpDT.Columns.Add("CveMovimientoDetallePedido", GetType(Integer))
TmpDT.Columns.Add("CantidadFacturadaRem", GetType(Decimal))
TmpDT.Columns.Add("CantidadFacturadaCot", GetType(Decimal))
TmpDT.Columns.Add("CantidadInventario", GetType(Decimal))
TmpDT.Columns.Add("ClaveSATFraccionArancelaria", GetType(String))
TmpDT.Columns.Add("ClaveSATUnidadAduana", GetType(String))
TmpDT.Columns.Add("ClaveSATFraccionArancelariaDescripcion", GetType(String))
TmpDT.Columns.Add("ClaveSATUnidadAduanaDescripcion", GetType(String))
TmpDT.Columns.Add("CveTamaño", GetType(Integer))
Try
For Each Dr As DataRow In DtRemisionesPS.Select()
Dim Row As DataRow = AgregarProductoServicio(Retorno, UsuarioActual, TmpDT, Dr("Consec").ToString.ToEntero(), Dr("Cantidad").ToString.ToDouble(), Dr("CveUM").ToString.ToEntero, Dr("UM").ToString, Dr("CveClasificacion").ToString.ToEntero, Dr("Clasificacion").ToString,
Dr("CvePS").ToString.ToEntero, Dr("PS").ToString, Dr("Obs").ToString, Dr("PU").ToString.ToDecimal, Dr("Descuento").ToString.ToDecimal,
Dr("CveSubProyecto").ToString.ToEntero, CveVentaDetalle:=-1, CveContratoDetalle:=Dr("CveContratoDetalle").ToString.ToEntero,
CveVentaDetalleRemision:=Dr("CveVentaDetalle").ToString.ToEntero, RegeneraIEPS:=True)
If Row IsNot Nothing Then
TmpDT.Rows.Add(Row)
Else
Retorno.Mensajes.Add(String.Format("No se pudo agregar el producto/servicio: {0}", Dr("PS").ToString()))
End If
Next
Catch ex As Exception
Retorno.Mensajes.Add(ex.ToString())
End Try
Return TmpDT
End Function
Private Function AgregarProductoServicio(ByRef Retorno As Modelos.Factura.MMensajeFactura, UsuarioActual As Usuario, TmpDT As DataTable, Consec As Integer, Cantidad As Double, CveUM As Integer, UM As String, CveClasificacion As Integer, Clasificacion As String, CvePS As Integer, PS As String, Obs As String,
PU As Decimal, Descuento As Decimal, CveSubProyecto As Integer,
Optional Serie As String = "", Optional TiempoEntrega As String = "", Optional EntregaDirecta As Integer = 0,
Optional CveContratoDetalle As Integer = 0, Optional CveVentaDetalle As Integer = 0, Optional CveMovimientoDetallePedido As Integer = 0,
Optional CveOrdenCompraDetalle As Integer = 0, Optional CveVentaDetalleRemision As Integer = 0, Optional CveVentaDetalleCotizacion As Integer = 0,
Optional CuentaPredial As String = "", Optional RegeneraIEPS As Boolean = True, Optional CveVentaDetallePedido2 As Integer = 0,
Optional ClienteRetIVA As Double = 0, Optional ClienteRetISR As Double = 0, Optional ClienteDesglosaIEPS As Boolean = True) As DataRow
Dim DrPS As DataRow = Nothing
DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("") ' Estado = -1
If DrPS Is Nothing Then
Retorno.Mensajes.Add("Ocurrió un error al cargar la información del Producto. Por favor vuelva a intentar.")
Return Nothing
End If
'verifica si tiene ventaminima
If Cantidad > 0 AndAlso DrPS("VentaMinima").ToString.ToDouble() > 0 Then
'verifico que la cantidad sea multiplo de venta minima, es decir ventaminima =5, solo puede vender 5,10,15...
If Cantidad < DrPS("VentaMinima").ToString.ToDouble() Then
Retorno.Mensajes.Add("La cantidad es menor que la venta minima")
Return Nothing
End If
End If
If (DrPS("SATClaveUnidadMedida").ToString = "" Or DrPS("SATClavePS").ToString = "") Then
'VALIDA CLAVESAT
If DrPS("SATClavePS").ToString = "" Then
Retorno.Mensajes.Add(String.Format("<b>{0}-{1}</b>: Sin producto SAT<br/>", DrPS("Codigo").ToString, DrPS("PS").ToString))
Return Nothing
ElseIf DrPS("SATClaveUnidadMedida").ToString = "" Then
Retorno.Mensajes.Add(String.Format("<b>{0}-{1}</b>: Sin Unidad Medida SAT<br/>", DrPS("Codigo").ToString, DrPS("PS").ToString))
Return Nothing
End If
End If
If Not ClienteDesglosaIEPS Then
If Not RegeneraIEPS Then
PU = PU * (1 + DrPS("IEPSPorcentaje").ToString.ToDecimal)
End If
DrPS("IEPSPorcentaje") = 0
End If
Dim Row As DataRow = Nothing
Dim TotalCalculableImpuestos As Decimal = 0
PU = Math.Round(PU, 6) ' el precio unitario puede llevar hasta 6 decimales permitidos
Dim DrSubProyecto As DataRow = GlobalDTSubProyectos(-1, CveSubProyecto).Rows(0)
Row = TmpDT.NewRow()
Row("CveProyecto") = DrSubProyecto("CveProyecto").ToString().ToEntero()
Row("Proyecto") = DrSubProyecto("Proyecto").ToString()
Row("CveSubProyecto") = CveSubProyecto
Row("SubProyecto") = DrSubProyecto("SubProyecto").ToString()
Row("Serie") = Serie
Row("TiempoEntrega") = TiempoEntrega
Row("Orden") = TmpDT.Rows.Count + 1
Row("Cantidad") = Cantidad
Row("CveUM") = CveUM
Row("UM") = UM
Row("CveClasificacion") = CveClasificacion
Row("Clasificacion") = Clasificacion
Row("CvePS") = CvePS
Row("Obs") = Obs
TotalCalculableImpuestos = (Cantidad * PU) - Descuento
Row("PU") = PU
Row("Codigo") = DrPS("Codigo")
Row("NoIdentificacion") = DrPS("Codigo")
Row("ClaveSATFraccionArancelaria") = DrPS("ClaveSATFraccionArancelaria")
Row("ClaveSATUnidadAduana") = DrPS("ClaveSATUnidadAduana")
Row("ClaveSATFraccionArancelariaDescripcion") = DrPS("ClaveSATFraccionArancelariaDescripcion")
Row("ClaveSATUnidadAduanaDescripcion") = DrPS("ClaveSATUnidadAduanaDescripcion")
Row("Consec") = Consec
Row("PS") = DrPS("PS")
Row("CodigoPS") = DrPS("PSCodigo").ToString
Row("CveTipoPS") = DrPS("CveTipoPS")
Row("CveTipoInvPS") = DrPS("Inv_CveMetodoInventario")
Row("CveTamaño") = DrPS("CveTamaño")
If CveClasificacion <= 0 Then Row("CveClasificacion") = DrPS("CveClasificacion")
If Clasificacion = "" Then Row("Clasificacion") = DrPS("Clasificacion")
If DrPS("IVA").ToString.Contiene("-1", "") Then
Row("PorcentajeIVA") = DrSubProyecto("IVA")
Else
Row("PorcentajeIVA") = DrPS("IVA")
End If
Row("IVA") = Row("PorcentajeIVA")
Row("ImporteIVA") = Math.Round(Row("PorcentajeIVA").ToString.ToDecimal * TotalCalculableImpuestos, 2)
Row("ImporteRetIVA") = Math.Round(ClienteRetIVA * TotalCalculableImpuestos, 2)
Row("ImporteRetISR") = Math.Round(ClienteRetISR * TotalCalculableImpuestos, 2)
Row("PorcentajeRetIVA") = ClienteRetIVA
Row("PorcentajeRetISR") = ClienteRetISR
Row("PorcentajeIEPS") = DrPS("IEPSPorcentaje")
Row("ImporteIEPS") = Math.Round(DrPS("IEPSPorcentaje").ToString.ToDecimal * TotalCalculableImpuestos, 2)
Row("IEPS") = Row("ImporteIEPS")
Row("Descuento") = Math.Round(Descuento, 2)
Row("TipoDescuento") = "2"
Row("Total") = Cantidad * PU
Row("TotalImporte") = Math.Round(Cantidad * PU, 2)
Row("SATClaveProdServ") = DrPS("SATClavePS")
Row("SATClaveUM") = DrPS("SATClaveUnidadMedida")
Row("EntregaDirecta") = EntregaDirecta
'Contratos
Row("CveContratoDetalle") = CveContratoDetalle
Row("CveVentaDetalle") = CveVentaDetalle
Row("CveMovimientoDetallePedido") = CveMovimientoDetallePedido
Row("CveOrdenCompraDetalle") = CveOrdenCompraDetalle
Row("CveVentaDetalleRemision") = CveVentaDetalleRemision
Row("CveVentaDetalleCotizacion") = CveVentaDetalleCotizacion
Row("CveVentaDetallePedido2") = CveVentaDetallePedido2
Row("CuentaPredial") = CuentaPredial
'RECARGAR GV
Return Row
End Function
#End Region
#Region "E N V I O - C O R R E O"
Private Sub EnviarCorreo(Objfactura As Modelos.Factura, UsuarioActual As Usuario)
Try
Dim Hilo As New System.Threading.Thread(Sub() EnviarCorreoFactura(Objfactura, UsuarioActual))
Hilo.Start()
Catch ex As Exception
OnError("Ocurrió error al mandar el correo de facturación", ex)
End Try
End Sub
Private Function DescargarFactura(CveVenta As Integer, CveEmpresa As Integer) As Byte()
Dim Url = New Uri(String.Format("{0}Compras/PopUpVerFactura.aspx?P={1}", ClsPaginas.UrlSitio, Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta))))
Dim File As Byte() = Nothing
Try
Using httpClient = New HttpClient()
httpClient.Timeout = New TimeSpan(0, 15, 0)
Using request = New HttpRequestMessage(HttpMethod.Get, Url)
request.Headers.Add("ADSToken", Encripta(String.Format("CVEEMPRESA={0}&TICKS={1}&CVEUSUARIO=100", CveEmpresa, DateTime.UtcNow.Ticks)))
Dim response = httpClient.SendAsync(request).Result
If response.StatusCode = Net.HttpStatusCode.OK Then
File = response.Content.ReadAsByteArrayAsync().Result
End If
End Using
End Using
Catch ex As Exception
File = Nothing
OnError("Ocurrió un error al descargar la factura", ex)
End Try
Return File
End Function
Private Sub EnviarCorreoFactura(ObjFactura As Modelos.Factura, UsuarioActual As Usuario)
Dim ObjMail As New ClsSisMail()
Dim ObjVentas As New ClsVentas
Dim ObjCliente As New ClsClientes
Dim Mail As String = ""
Dim MailCC As String = ""
Dim ArchivoXML = ""
Dim ArchivoPDF = ""
Dim ArchivoPDFBytes As Byte() = Nothing
Dim ExistePDF As Boolean = False
Try
ArchivoXML = String.Format("{0}XML\{1}\{2}.xml", UsuarioActual.Empresa.Ruta, ObjFactura.TipoDocto, ObjFactura.SerieFolio)
ArchivoPDF = String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, ObjFactura.TipoDocto, ObjFactura.SerieFolio)
If Not File.Exists(ArchivoPDF) Then
ArchivoPDFBytes = DescargarFactura(ObjFactura.CveVenta, ObjFactura.CveEmpresa)
Else
ExistePDF = True
End If
If ObjFactura.CveClienteSucursal > 0 Then
If ObjCliente.GetSucursales(ObjFactura.CveCliente, ObjFactura.CveClienteSucursal) Then
If ObjCliente.DtResultados.Rows.Count > 0 Then
Dim Correo = ObjCliente.DtResultados.Rows(0)("Correo").ToString
If Correo.Trim.Length > 0 Then
Mail = Correo
End If
MailCC = ObjCliente.NotificarA
End If
End If
Else
If ObjCliente.GetClientes(ObjFactura.CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, TipoCliente:=-1) Then
If ObjCliente.DtResultados.Rows.Count > 0 Then
Mail = If(ObjFactura.TipoDocto = "Cot", ObjCliente.MailCotizacion, ObjCliente.Mail)
End If
End If
End If
Catch ex As Exception
OnError("Ocurrió un error al obtener el correo", ex)
Finally
ObjCliente.Dispose()
End Try
If Not String.IsNullOrEmpty(Mail) Then
Try
Dim Asunto As String = String.Empty
Dim Cuerpo As String = String.Empty
Dim ResultadoMail As Integer = 0
Dim TipoComprobante = ""
If ObjFactura.TipoDocto = "Ing" Then TipoComprobante = "Factura"
If ObjFactura.TipoDocto = "Egs" Then TipoComprobante = "Nota de Crédito"
If ObjFactura.TipoDocto = "Dev" Then TipoComprobante = "Nota de Devolución"
If ObjFactura.TipoDocto = "Rem" Then TipoComprobante = "Remisión"
If ObjFactura.TipoDocto = "Cot" Then TipoComprobante = "Cotización"
If ObjFactura.TipoDocto = "Ant" Then TipoComprobante = "Anticipo"
If UsuarioActual.Empresa.PlantillaMailVenta.Trim.Length > 0 Then
Cuerpo = UsuarioActual.Empresa.PlantillaMailVenta
Cuerpo = Cuerpo.Replace("{""NombreEmpresa""}", UsuarioActual.Empresa.Empresa)
Cuerpo = Cuerpo.Replace("{""NombreCliente""}", ObjFactura.Cliente.NombreComercial)
Cuerpo = Cuerpo.Replace("{""TipoDocumento""}", TipoComprobante)
Cuerpo = Cuerpo.Replace("{""Fecha""}", ObjFactura.Fecha.ToString("dd/MM/yyyy"))
Cuerpo = Cuerpo.Replace("{""Total""}", ObjFactura.Total)
Cuerpo = Cuerpo.Replace("{""FechaVencimiento""}", ObjFactura.FechaVencimiento.ToString("dd/MM/yyyy"))
Cuerpo = Cuerpo.Replace("{""SerieFolio""}", ObjFactura.SerieFolio)
End If
If UsuarioActual.Empresa.AsuntoPlantillaMailVenta.Trim.Length > 0 Then
Asunto = UsuarioActual.Empresa.AsuntoPlantillaMailVenta
Asunto = Asunto.Replace("{""TipoDocumento""}", TipoComprobante)
Asunto = Asunto.Replace("{""Sucursal""}", ObjFactura.SubProyecto.SubProyecto)
Asunto = Asunto.Replace("{""SerieFolio""}", ObjFactura.SerieFolio)
End If
Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail)
LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.Ruta = ArchivoXML})
If ExistePDF Then
LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.Ruta = ArchivoPDF})
Else
LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.ArchivoBinario = ArchivoPDFBytes, .NombreArchivo = String.Format("{0}.pdf", ObjFactura.SerieFolio)})
End If
Dim DisplayName As String = ""
If UsuarioActual.CveEmpresa = 119 Then DisplayName = "Facturación Agroquímicos JAM"
If ObjMail.SendMail(UsuarioActual.Empresa, Mail, Asunto, Cuerpo, If(String.IsNullOrEmpty(MailCC), "", MailCC), LSRutasMail, Displayname:=DisplayName) Then
ResultadoMail = 1
Else
GuardaLogFacturacion($"No se envio el correo {Mail}, {Asunto}, {Cuerpo}, {MailCC},")
GuardaLogFacturacion($"Ruta XML {ArchivoXML}")
ResultadoMail = 3
End If
ObjVentas.UpdateVentaMail(ResultadoMail, ObjFactura.CveVenta)
Catch ex As Exception
OnError("Ocurrió error al mandar el Mail", ex)
GuardaLogFacturacion(ex.ToString())
ObjVentas.UpdateVentaMail(3, ObjFactura.CveVenta)
Finally
ObjVentas.Dispose()
If ObjFactura IsNot Nothing Then
ObjFactura.Dispose()
End If
End Try
End If
End Sub
#End Region
Public Sub GuardaLogFacturacion(Str As String)
Dim ArchivoW As StreamWriter
Dim strLineaTMP As String
' strLineaTMP = Chr(13) & Chr(10) & Day(Now) & "/" & Month(Now) & "/" & Year(Now) & " " & Hour(Now) & ":" & Minuto & ". " & Str & Chr(13) & Chr(10)
strLineaTMP = String.Format("{0}{1}Log: {2}{3}:{4}", Chr(13), Chr(10), Str, DateTime.Now.ToShortDateString, DateTime.Now.ToShortTimeString)
Try
ArchivoW = New StreamWriter(String.Format("{0}\LogFacturacion.txt", ModExtensiones.DirectorioBaseEmpresas), True, System.Text.Encoding.UTF8)
Catch ex As UnauthorizedAccessException
'Alert("No hay permisos para guardar en el Log.", Extensiones.TipoMensaje.MsgError)
Exit Sub
Catch ex As Exception
Exit Sub
End Try
Try
ArchivoW.WriteLine(strLineaTMP)
Catch
End Try
ArchivoW.Close()
ArchivoW.Dispose()
End Sub
#Region "G L O B A L - D T"
Public Property GlobalTipoCambio(Optional Fecha As Date = MinFecha) As Double
Get
If GlobalTipoCambio <= 0 Then
'sino tiene dato lo recargo por si ya esta insertado
If Fecha = MinFecha Then Fecha = Now
Dim ObjGral As New ClsGenerales
If ObjGral.GetTipoCambio(-1, Fecha) AndAlso ObjGral.DtResultados.Rows.Count > 0 Then
HttpContext.Current.Application("GlobalTipoCambio") = ObjGral.DtResultados.Rows(0)("TipoCambio").ToString.ToDouble
Else
HttpContext.Current.Application("GlobalTipoCambio") = 0
End If
ObjGral.Dispose()
End If
Return HttpContext.Current.Application("GlobalTipoCambio").ToString.ToDouble
End Get
Set(value As Double)
HttpContext.Current.Application("GlobalTipoCambio") = value
End Set
End Property
Public Property GlobalTipoCambioEuro(Optional Fecha As Date = MinFecha) As Double
Get
If GlobalTipoCambioEuro <= 0 Then
'sino tiene dato lo recargo por si ya esta insertado
If Fecha = MinFecha Then Fecha = Now
Dim ObjGral As New ClsGenerales
If ObjGral.GetTipoCambio(-1, Fecha) AndAlso ObjGral.DtResultados.Rows.Count > 0 Then
HttpContext.Current.Application("GlobalTipoCambioEuro") = ObjGral.DtResultados.Rows(0)("TipoCambioEuro").ToString.ToDouble
Else
HttpContext.Current.Application("GlobalTipoCambioEuro") = 0
End If
ObjGral.Dispose()
End If
Return HttpContext.Current.Application("GlobalTipoCambioEuro").ToString.ToDouble
End Get
Set(value As Double)
HttpContext.Current.Application("GlobalTipoCambioEuro") = value
End Set
End Property
'Property GlobalValidarCFDI As Boolean
' Get
' GlobalValidarCFDI = CBool(HttpContext.Current.Application("GlobalValidarCFDI"))
' End Get
' Set(value As Boolean)
' HttpContext.Current.Application("GlobalValidarCFDI") = value
' End Set
'End Property
Property GlobalDTUsuarios(Optional CveUsuario As Integer = -1, Optional CveEmpresa As Integer = -1, Optional CveCliente As Integer = -1, Optional CveProveedor As Integer = -1) As DataTable
Get
Dim Str As New StringBuilder
If CveUsuario <> -1 Then Str.AppendFormat("CveUsuario = {0}", CveUsuario)
If CveEmpresa <> -1 Then Str.AppendFormat(" {0} CveEmpresa = {1}", If(Str.Length > 0, "AND", ""), CveEmpresa)
If CveCliente <> -1 Then Str.AppendFormat(" {0} CveCliente = {1}", If(Str.Length > 0, "AND", ""), CveCliente)
If CveProveedor <> -1 Then Str.AppendFormat(" {0} CveProveedor = {1}", If(Str.Length > 0, "AND", ""), CveProveedor)
If CveUsuario <> -1 OrElse CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTUsuarios"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
GlobalDTUsuarios = Dv.ToTable
Dv.Dispose()
Else
GlobalDTUsuarios = DirectCast(HttpContext.Current.Application("GlobalDTUsuarios"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTUsuarios") = value
End Set
End Property
Property GlobalDTNomConceptos(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTNomConceptos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTNomConceptos = Dv.ToTable
Dv.Dispose()
Else
GlobalDTNomConceptos = DirectCast(HttpContext.Current.Application("GlobalDTNomConceptos"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTNomConceptos") = value
End Set
End Property
Property GlobalDTTiposGastos(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTTiposGastos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTTiposGastos = Dv.ToTable
Dv.Dispose()
Else
GlobalDTTiposGastos = DirectCast(HttpContext.Current.Application("GlobalDTTiposGastos"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTTiposGastos") = value
End Set
End Property
Property GlobalDTMFActividad(CveEmpresa As Integer, Optional Estatus As Integer = -1, Optional CveActividad As Integer = -1) As DataTable
Get
Dim dt As DataTable = Nothing
Dim ObjMF As New ClsMF
If ObjMF.GetActividad(CveActividad, CveEmpresa, Estatus) Then
dt = ObjMF.DtResultados
End If
ObjMF.Dispose()
GlobalDTMFActividad = dt
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTActividad") = value
End Set
End Property
Property GlobalDTMFOperador(CveEmpresa As Integer, Optional Estatus As Integer = -1, Optional CveOperador As Integer = -1) As DataTable
Get
Dim dt As DataTable = Nothing
Dim ObjMF As New ClsMF
If ObjMF.GetOperador(CveOperador, CveEmpresa, Estatus) Then
dt = ObjMF.DtResultados
End If
ObjMF.Dispose()
GlobalDTMFOperador = dt
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTOperador") = value
End Set
End Property
Property GlobalDTMFEstatus(CveEmpresa As Integer, Optional Estatus As Integer = -1, Optional CveEstatus As Integer = -1) As DataTable
Get
Dim dt As DataTable = Nothing
Dim ObjMF As New ClsMF
If ObjMF.GetEstatus(CveEstatus, Estatus, CveEmpresa) Then
dt = ObjMF.DtResultados
End If
ObjMF.Dispose()
GlobalDTMFEstatus = dt
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTEstatus") = value
End Set
End Property
Property DtFacturaDefault() As DataTable
Get
DtFacturaDefault = DirectCast(HttpContext.Current.Application("DtFacturaDefault"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("DtFacturaDefault") = value
End Set
End Property
Property Directorio() As String
Get
Directorio = DirectCast(HttpContext.Current.Application("Directorio"), String)
End Get
Set(value As String)
HttpContext.Current.Application("Directorio") = value
End Set
End Property
Property GlobalDTPSATPS() As DataTable
Get
GlobalDTPSATPS = DirectCast(HttpContext.Current.Application("GlobalDTPSATPS"), EnumerableRowCollection(Of DataRow)).CopyToDataTable
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTPSATPS") = value
End Set
End Property
#Region "GLOBALES DE SAT COMERCIO EXTERIOR"
Property GlobalDTClavePedimento() As DataTable
Get
GlobalDTClavePedimento = DirectCast(HttpContext.Current.Application("GlobalDTClavePedimento"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTClavePedimento") = value
End Set
End Property
Property GlobalDTFraccionArancelaria() As DataTable
Get
GlobalDTFraccionArancelaria = DirectCast(HttpContext.Current.Application("GlobalDTFraccionArancelaria"), EnumerableRowCollection(Of DataRow)).CopyToDataTable
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTFraccionArancelaria") = value
End Set
End Property
Property GlobalDTIncoterm() As DataTable
Get
GlobalDTIncoterm = DirectCast(HttpContext.Current.Application("GlobalDTIncoterm"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTIncoterm") = value
End Set
End Property
Property GlobalDTTipoOperacion() As DataTable
Get
GlobalDTTipoOperacion = DirectCast(HttpContext.Current.Application("GlobalDTTipoOperacion"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTTipoOperacion") = value
End Set
End Property
Property GlobalDTSATMotivoTraslado() As DataTable
Get
GlobalDTSATMotivoTraslado = DirectCast(HttpContext.Current.Application("GlobalDTSATMotivoTraslado"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTSATMotivoTraslado") = value
End Set
End Property
Property GlobalDTUnidadAduana() As DataTable
Get
GlobalDTUnidadAduana = DirectCast(HttpContext.Current.Application("GlobalDTUnidadAduana"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTUnidadAduana") = value
End Set
End Property
Property GlobalDTPais() As DataTable
Get
GlobalDTPais = DirectCast(HttpContext.Current.Application("GlobalDTPais"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTPais") = value
End Set
End Property
Property GlobalDTEstado(ClaveSATPais As String) As DataTable
Get
If ClaveSATPais <> "-1" Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTEstado"), DataTable), String.Format("ClaveSATPais = '{0}'", ClaveSATPais), "", DataViewRowState.CurrentRows)
GlobalDTEstado = Dv.ToTable
Dv.Dispose()
Else
GlobalDTEstado = DirectCast(HttpContext.Current.Application("GlobalDTEstado"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTEstado") = value
End Set
End Property
Property GlobalDTMunicipio(ClaveSATEstado As String) As DataTable
Get
If ClaveSATEstado <> "-1" Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTMunicipio"), DataTable), String.Format("ClaveSATEstado = '{0}'", ClaveSATEstado), "", DataViewRowState.CurrentRows)
GlobalDTMunicipio = Dv.ToTable
Dv.Dispose()
Else
GlobalDTMunicipio = DirectCast(HttpContext.Current.Application("GlobalDTMunicipio"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTMunicipio") = value
End Set
End Property
Property GlobalDTColonia(ClaveSATMunicipio As String) As DataTable
Get
If ClaveSATMunicipio <> "-1" Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTColonia"), DataTable), String.Format("ClaveSATMunicipio = '{0}'", ClaveSATMunicipio), "", DataViewRowState.CurrentRows)
GlobalDTColonia = Dv.ToTable
Dv.Dispose()
Else
GlobalDTColonia = DirectCast(HttpContext.Current.Application("GlobalDTColonia"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTColonia") = value
End Set
End Property
#End Region
Property GlobalDTPSATUM() As DataTable
Get
GlobalDTPSATUM = DirectCast(HttpContext.Current.Application("GlobalDTPSATUM"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTPSATUM") = value
End Set
End Property
Property GlobalDTNomConceptosFunciones() As DataTable
Get
GlobalDTNomConceptosFunciones = DirectCast(HttpContext.Current.Application("GlobalDTNomConceptosFunciones"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTNomConceptosFunciones") = value
End Set
End Property
Property GlobalDTUsuarioResponsable() As DataTable
Get
GlobalDTUsuarioResponsable = DirectCast(HttpContext.Current.Application("GlobalDTUsuarioResponsable"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTUsuarioResponsable") = value
End Set
End Property
Property GlobalDTProveedoresCuentas(CveProveedor As Integer, Estatus As Boolean) As DataTable
Get
GlobalDTProveedoresCuentas = DirectCast(HttpContext.Current.Application("GlobalDTProveedoresCuentas"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTProveedoresCuentas") = value
End Set
End Property
Property GlobalDTProveedorClasificacion(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProveedorClasificacion"), DataTable), String.Format("CveEmpresa ={0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTProveedorClasificacion = Dv.ToTable
Dv.Dispose()
Else
GlobalDTProveedorClasificacion = DirectCast(HttpContext.Current.Application("GlobalDTProveedorClasificacion"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTProveedorClasificacion") = value
End Set
End Property
Property GlobalDTProveedorSucursales(CveProveedor As Integer) As DataTable
Get
If CveProveedor <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProveedorSucursales"), DataTable), String.Format("CveProveedor = {0}", CveProveedor), "", DataViewRowState.CurrentRows)
GlobalDTProveedorSucursales = Dv.ToTable
Dv.Dispose()
Else
GlobalDTProveedorSucursales = DirectCast(HttpContext.Current.Application("GlobalDTProveedorSucursales"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTProveedorSucursales") = value
End Set
End Property
Property GlobalDTRoles(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTRoles"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTRoles = Dv.ToTable
Dv.Dispose()
Else
GlobalDTRoles = DirectCast(HttpContext.Current.Application("GlobalDTRoles"), DataTable)
End If
End Get
Set(ByVal value As DataTable)
HttpContext.Current.Application("GlobalDTRoles") = value
End Set
End Property
Property GlobalDTNomSatBancos() As DataTable
Get
GlobalDTNomSatBancos = DirectCast(HttpContext.Current.Application("GlobalDTNomSatBancos"), DataTable)
End Get
Set(ByVal value As DataTable)
HttpContext.Current.Application("GlobalDTNomSatBancos") = value
End Set
End Property
Property GlobalDTNomSatConceptos() As DataTable
Get
GlobalDTNomSatConceptos = DirectCast(HttpContext.Current.Application("GlobalDTNomSatConceptos"), DataTable)
End Get
Set(ByVal value As DataTable)
HttpContext.Current.Application("GlobalDTNomSatConceptos") = value
End Set
End Property
Property GlobalDTNomSatRegimenContratacion() As DataTable
Get
GlobalDTNomSatRegimenContratacion = DirectCast(HttpContext.Current.Application("GlobalDTNomSatRegimenContratacion"), DataTable)
End Get
Set(ByVal value As DataTable)
HttpContext.Current.Application("GlobalDTNomSatRegimenContratacion") = value
End Set
End Property
Property GlobalDTNomSatRiesgoPuesto() As DataTable
Get
GlobalDTNomSatRiesgoPuesto = DirectCast(HttpContext.Current.Application("GlobalDTNomSatRiesgoPuesto"), DataTable)
End Get
Set(ByVal value As DataTable)
HttpContext.Current.Application("GlobalDTNomSatRiesgoPuesto") = value
End Set
End Property
Property GlobalDTNomSatTipoIncapacidad() As DataTable
Get
GlobalDTNomSatTipoIncapacidad = DirectCast(HttpContext.Current.Application("GlobalDTNomSatTipoIncapacidad"), DataTable)
End Get
Set(ByVal value As DataTable)
HttpContext.Current.Application("GlobalDTNomSatTipoIncapacidad") = value
End Set
End Property
Property GlobalDTEmpresas(Optional CveEmpresa As Integer = -1) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTEmpresas"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTEmpresas = Dv.ToTable
Dv.Dispose()
Else
GlobalDTEmpresas = DirectCast(HttpContext.Current.Application("GlobalDTEmpresas"), DataTable)
End If
End Get
Set(ByVal value As DataTable)
HttpContext.Current.Application("GlobalDTEmpresas") = value
End Set
End Property
Property GlobalDTClasificaciones(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1, Optional UsoClasificacion As Integer = -1) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Str As New StringBuilder
Str.AppendFormat("CveEmpresa = {0}", CveEmpresa)
If CveCategoria <> -1 Then Str.AppendFormat(" AND CveCategoria = {0}", CveCategoria)
If UsoClasificacion <> -1 Then Str.AppendFormat(" AND UsoClasificacion IN ({0},3) ", UsoClasificacion)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTClasificaciones"), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows)
GlobalDTClasificaciones = Dv.ToTable
Dv.Dispose()
Else
GlobalDTClasificaciones = DirectCast(HttpContext.Current.Application("GlobalDTClasificaciones"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTClasificaciones") = value
End Set
End Property
Property GlobalDTClasificaciones2(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Str As New StringBuilder
Str.AppendFormat("CveEmpresa = {0}", CveEmpresa)
If CveCategoria <> -1 Then Str.AppendFormat(" AND CveCategoria = {0}", CveCategoria)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTClasificaciones2"), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows)
GlobalDTClasificaciones2 = Dv.ToTable
Dv.Dispose()
Else
GlobalDTClasificaciones2 = DirectCast(HttpContext.Current.Application("GlobalDTClasificaciones2"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTClasificaciones2") = value
End Set
End Property
Property GlobalDTClasificacionesSubProyectos(Optional CveClasificacion As Integer = -1, Optional CveEmpresa As Integer = -1) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Str As New StringBuilder
Str.AppendFormat("CveEmpresa = {0}", CveEmpresa)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTClasificacionesSubProyecto"), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows)
GlobalDTClasificacionesSubProyectos = Dv.ToTable
Dv.Dispose()
Else
GlobalDTClasificacionesSubProyectos = DirectCast(HttpContext.Current.Application("GlobalDTClasificacionesSubProyecto"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTClasificacionesSubProyecto") = value
End Set
End Property
Property GlobalDTACClasificadorObjetoGasto(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Str As New StringBuilder
Str.AppendFormat("CveEmpresa = {0}", CveEmpresa)
If CveCategoria <> -1 Then Str.AppendFormat(" AND CveCategoria = {0}", CveCategoria)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTACClasificadorObjetoGasto"), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows)
GlobalDTACClasificadorObjetoGasto = Dv.ToTable
Dv.Dispose()
Else
GlobalDTACClasificadorObjetoGasto = DirectCast(HttpContext.Current.Application("GlobalDTACClasificadorObjetoGasto"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTACClasificadorObjetoGasto") = value
End Set
End Property
Property GlobalDTClasificacionesDetalle(Optional CveEmpresa As Integer = -1, Optional CveClasificacion As Integer = -1) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Str As New StringBuilder
Str.AppendFormat("CveEmpresa = {0}", CveEmpresa)
If CveClasificacion <> -1 Then Str.AppendFormat(" AND CveClasificacion = {0}", CveClasificacion)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTClasificacionesDetalle"), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows)
GlobalDTClasificacionesDetalle = Dv.ToTable
Dv.Dispose()
Else
GlobalDTClasificacionesDetalle = DirectCast(HttpContext.Current.Application("GlobalDTClasificacionesDetalle"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTClasificacionesDetalle") = value
End Set
End Property
Property GlobalDTSubFamilias(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Str As New StringBuilder
Str.AppendFormat("CveEmpresa = {0}", CveEmpresa)
If CveCategoria <> -1 Then Str.AppendFormat(" AND CveCategoria = {0}", CveCategoria)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTSubFamilias"), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows)
GlobalDTSubFamilias = Dv.ToTable
Dv.Dispose()
Else
GlobalDTSubFamilias = DirectCast(HttpContext.Current.Application("GlobalDTSubFamilias"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTSubFamilias") = value
End Set
End Property
Property GlobalDTFamilias(Optional CveEmpresa As Integer = -1) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTFamilias"), DataTable), String.Format("CveEmpresa = {0} ", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTFamilias = Dv.ToTable
Dv.Dispose()
Else
GlobalDTFamilias = DirectCast(HttpContext.Current.Application("GlobalDTFamilias"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTFamilias") = value
End Set
End Property
Property GlobalDTClasificacionesPresupuestos(Optional CveEmpresa As Integer = -1) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTClasificacionesPresupuestos"), DataTable), String.Format("CveEmpresa = {0} ", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTClasificacionesPresupuestos = Dv.ToTable
Dv.Dispose()
Else
GlobalDTClasificacionesPresupuestos = DirectCast(HttpContext.Current.Application("GlobalDTClasificacionesPresupuestos"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTClasificacionesPresupuestos") = value
End Set
End Property
Property GlobalDTMetodosPago() As DataTable
Get
GlobalDTMetodosPago = DirectCast(HttpContext.Current.Application("GlobalDTMetodosPago"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTMetodosPago") = value
End Set
End Property
Property GlobalDTModulos() As DataTable
Get
GlobalDTModulos = DirectCast(HttpContext.Current.Application("GlobalDTModulos"), DataTable)
End Get
Set(ByVal value As DataTable)
HttpContext.Current.Application("GlobalDTModulos") = value
End Set
End Property
Property GlobalDTMonedas() As DataTable
Get
GlobalDTMonedas = DirectCast(HttpContext.Current.Application("GlobalDTMonedas"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTMonedas") = value
End Set
End Property
Property GlobalDTMonedasAlias() As DataTable
Get
GlobalDTMonedasAlias = DirectCast(HttpContext.Current.Application("GlobalDTMonedasAlias"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTMonedasAlias") = value
End Set
End Property
Property GlobalDTSucursales(Optional CveEmpresa As Integer = -1) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTSucursales"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), " Sucursal", DataViewRowState.CurrentRows)
GlobalDTSucursales = Dv.ToTable
Dv.Dispose()
Else
GlobalDTSucursales = DirectCast(HttpContext.Current.Application("GlobalDTSucursales"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTSucursales") = value
End Set
End Property
Property GlobalDTSATUsosCFDI(Optional EsPersonaFisica As Integer = -1) As DataTable
Get
If EsPersonaFisica <> -1 Then
Dim Tipo As String = ""
If EsPersonaFisica = 1 Then Tipo = "AplicaPersonaFisica = 1" Else Tipo = "AplicaPersonaMoral = 1"
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTSATUsosCFDI"), DataTable), Tipo, " UsoCFDIDescripcion", DataViewRowState.CurrentRows)
GlobalDTSATUsosCFDI = Dv.ToTable
Dv.Dispose()
Else
GlobalDTSATUsosCFDI = DirectCast(HttpContext.Current.Application("GlobalDTSATUsosCFDI"), DataTable)
End If
End Get
Set(ByVal value As DataTable)
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 GlobalDTEstatusOrdenCompra() As DataTable
Get
GlobalDTEstatusOrdenCompra = DirectCast(HttpContext.Current.Application("GlobalDTEstatusOrdenCompra"), DataTable)
End Get
Set(ByVal value As DataTable)
HttpContext.Current.Application("GlobalDTEstatusOrdenCompra") = value
End Set
End Property
Property GlobalDTLeyendasFiscales() As DataTable
Get
GlobalDTLeyendasFiscales = DirectCast(HttpContext.Current.Application("GlobalDTLeyendasFiscales"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTLeyendasFiscales") = value
End Set
End Property
Property GlobalDTEstatusFactura() As DataTable
Get
GlobalDTEstatusFactura = DirectCast(HttpContext.Current.Application("GlobalDTEstatusFactura"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTEstatusFactura") = value
End Set
End Property
Property GlobalDTProyectos(CveEmpresa As Integer, Optional Estatus As Integer = -1) As DataTable
Get
If DirectCast(HttpContext.Current.Application("GlobalDTProyectos"), DataTable) Is Nothing Or (DirectCast(HttpContext.Current.Application("GlobalDTProyectos"), DataTable) IsNot Nothing AndAlso DirectCast(HttpContext.Current.Application("GlobalDTProyectos"), DataTable).Rows.Count = 0) Then
Dim P As New ClsProyectos
If P.GetProyectos Then
HttpContext.Current.Application("GlobalDTProyectos") = P.DtResultados
End If
P.Dispose()
End If
If CveEmpresa <> -1 OrElse Estatus <> -1 Then 'OrElse CveProyecto <> -1
Dim StrSQL As New StringBuilder
If CveEmpresa <> -1 Then StrSQL.AppendFormat("CveEmpresa = {0}", CveEmpresa)
' If CveProyecto <> -1 Then StrSQL.AppendFormat(" {0} CveProyecto = {1}", If(StrSQL.Length > 0, "AND", ""), CveProyecto)
If Estatus <> -1 Then StrSQL.AppendFormat(" {0} CveEstatus = {1}", If(StrSQL.Length > 0, "AND", ""), Estatus)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProyectos"), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows)
GlobalDTProyectos = Dv.ToTable
Dv.Dispose()
Else
GlobalDTProyectos = DirectCast(HttpContext.Current.Application("GlobalDTProyectos"), DataTable)
End If
End Get
Set(ByVal value As DataTable)
If value Is Nothing OrElse value.Rows.Count = 0 Then
End If
HttpContext.Current.Application("GlobalDTProyectos") = value
End Set
End Property
Public Property GlobalDTSubProyectos(CveProyecto As Integer, Optional CveSubProyecto As Integer = -1, Optional CveEmpresa As Integer = -1, Optional Estatus As Integer = 1) As DataTable
Get
Dim AppNombre As String = String.Format("GlobalDTSubProyectos-{0}", CveEmpresa)
'sino existe, recarga los datos
If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Or (DirectCast(HttpContext.Current.Application(AppNombre), DataTable) IsNot Nothing AndAlso DirectCast(HttpContext.Current.Application(AppNombre), DataTable).Rows.Count = 0) Then
Dim P As New ClsSubProyectos
If P.GetSubProyectos(CveEmpresa:=CveEmpresa) Then HttpContext.Current.Application(AppNombre) = P.DtResultados
P.Dispose()
End If
If CveProyecto <> -1 OrElse CveSubProyecto <> -1 OrElse CveEmpresa <> -1 OrElse Estatus <> -1 Then
Dim StrSQL As New StringBuilder
If CveProyecto <> -1 Then StrSQL.AppendFormat(" AND CveProyecto = {0}", CveProyecto)
If CveSubProyecto <> -1 Then StrSQL.AppendFormat(" AND CveSubProyecto = {0}", CveSubProyecto)
If Estatus <> -1 Then StrSQL.AppendFormat(" AND CveEstatus = {0}", Estatus)
If CveEmpresa <> -1 Then StrSQL.AppendFormat(" AND CveEmpresa = {0}", CveEmpresa)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows)
GlobalDTSubProyectos = Dv.ToTable
Dv.Dispose()
Else
GlobalDTSubProyectos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End If
End Get
Set(ByVal value As DataTable)
Dim AppNombre As String = String.Format("GlobalDTSubProyectos-{0}", CveEmpresa)
HttpContext.Current.Application(AppNombre) = value
End Set
End Property
Property GlobalDTSubProyectosUsuarios(CveUsuario As Integer, CveProyecto As Integer, CveEmpresa As Integer, Optional CveSubProyecto As Integer = -1, Optional CveEstatus As Integer = -1) As DataTable
Get
If HttpContext.Current.Application("GlobalDTSubProyectosUsuarios") Is Nothing Then
Dim ObjSubProyectos As New ClsSubProyectos()
If ObjSubProyectos.GetSubProyectosUsuarios Then HttpContext.Current.Application("GlobalDTSubProyectosUsuarios") = ObjSubProyectos.DtResultados Else Alert("Ocurrió un error al cargar los SubProyectos. Por favor comuniquese con sistemas.", TipoMensaje.MsgError)
ObjSubProyectos.Dispose()
End If
If CveUsuario <> -1 OrElse CveProyecto <> -1 OrElse CveSubProyecto <> -1 OrElse CveEmpresa <> -1 OrElse CveEstatus <> -1 Then
Dim StrSQL As New StringBuilder
If CveProyecto <> -1 Then StrSQL.AppendFormat(" AND CveProyecto = {0}", CveProyecto)
If CveSubProyecto <> -1 Then StrSQL.AppendFormat(" AND CveSubProyecto = {0}", CveSubProyecto)
If CveEmpresa <> -1 Then StrSQL.AppendFormat(" AND CveEmpresa = {0}", CveEmpresa)
If CveUsuario <> -1 Then StrSQL.AppendFormat(" AND CveUsuario = {0}", CveUsuario)
If CveEstatus <> -1 Then StrSQL.AppendFormat(" AND CveEstatus = {0}", CveEstatus)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTSubProyectosUsuarios"), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows)
GlobalDTSubProyectosUsuarios = Dv.ToTable
Dv.Dispose()
Dim ObjSubProyectos As New ClsSubProyectos()
If ObjSubProyectos.GetSubProyectosUsuarios(CveUsuario:=CveUsuario, CveProyecto:=CveProyecto, CveSubProyecto:=CveSubProyecto, CveEstatus:=CveEstatus, CveEmpresa:=CveEmpresa) Then
GlobalDTSubProyectosUsuarios = ObjSubProyectos.DtResultados
Else
GlobalDTSubProyectosUsuarios = Nothing
End If
ObjSubProyectos.Dispose()
Else
GlobalDTSubProyectosUsuarios = DirectCast(HttpContext.Current.Application("GlobalDTSubProyectosUsuarios"), DataTable)
End If
End Get
Set(ByVal value As DataTable)
If value Is Nothing OrElse value.Rows.Count = 0 Then
End If
HttpContext.Current.Application("GlobalDTSubProyectosUsuarios") = value
End Set
End Property
Property GlobalDTProyectosUsuarios(CveUsuario As Integer, CveProyecto As Integer, CveEmpresa As Integer, CveEstatus As Integer) As DataTable
Get
If HttpContext.Current.Application("GlobalDTProyectosUsuarios") Is Nothing AndAlso DirectCast(HttpContext.Current.Application("GlobalDTProyectosUsuarios"), DataTable).Rows.Count = 0 Then
Dim ObjSubProyectos As New ClsSubProyectos()
If ObjSubProyectos.GetSubProyectosUsuarios Then HttpContext.Current.Application("GlobalDTProyectosUsuarios") = ObjSubProyectos.DtResultados.FiltraParametros("", "", {"Proyecto", "CveProyecto", "CveUsuario", "CveEmpresa", "CveEstatusProyecto"}) Else Alert("Ocurrió un error al cargar los Proyectos. Por favor comuniquese con sistemas.", TipoMensaje.MsgError)
ObjSubProyectos.Dispose()
GuardaLog("Se Cargo GlobalDTProyectosUsuarios")
End If
If CveUsuario <> -1 OrElse CveProyecto <> -1 OrElse CveEmpresa <> -1 OrElse CveEstatus <> -1 Then
Dim StrSQL As New StringBuilder
If CveProyecto <> -1 Then StrSQL.AppendFormat(" AND CveProyecto = {0}", CveProyecto)
If CveEmpresa <> -1 Then StrSQL.AppendFormat(" AND CveEmpresa = {0}", CveEmpresa)
If CveUsuario <> -1 Then StrSQL.AppendFormat(" AND CveUsuario = {0}", CveUsuario)
If CveEstatus <> -1 Then StrSQL.AppendFormat(" AND CveEstatusProyecto = {0}", CveEstatus)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProyectosUsuarios"), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows)
GlobalDTProyectosUsuarios = Dv.ToTable
Dv.Dispose()
Else
GlobalDTProyectosUsuarios = DirectCast(HttpContext.Current.Application("GlobalDTProyectosUsuarios"), DataTable)
End If
End Get
Set(ByVal value As DataTable)
If value Is Nothing OrElse value.Rows.Count = 0 Then
End If
HttpContext.Current.Application("GlobalDTProyectosUsuarios") = value
End Set
End Property
Property GlobalDTPrecioListas(CveEmpresa As Integer) As DataTable
Get
GlobalDTPrecioListas = DirectCast(HttpContext.Current.Application("GlobalDTPrecioListas"), DataTable).FiltraParametros(String.Format("CveEmpresa = {0}", CveEmpresa))
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTPrecioListas") = value
End Set
End Property
Property GlobalDTMesas() As DataTable
Get
GlobalDTMesas = DirectCast(HttpContext.Current.Application("GlobalDTMesas"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTMesas") = value
End Set
End Property
Property GlobalDTTipoOrdenServicios(CveEmpresa As Integer) As DataTable
Get
GlobalDTTipoOrdenServicios = DirectCast(HttpContext.Current.Application("GlobalDTTipoOrdenServicios"), DataTable).FiltraParametros(String.Format("CveEmpresa = {0}", CveEmpresa))
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTTipoOrdenServicios") = value
End Set
End Property
Property GlobalDTSubTipoOrdenServicios() As DataTable
Get
GlobalDTSubTipoOrdenServicios = DirectCast(HttpContext.Current.Application("GlobalDTSubTipoOrdenServicios"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTSubTipoOrdenServicios") = value
End Set
End Property
Property GlobalDTCaracteristicasOrdenServicios() As DataTable
Get
GlobalDTCaracteristicasOrdenServicios = DirectCast(HttpContext.Current.Application("GlobalDTCaracteristicasOrdenServicios"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTCaracteristicasOrdenServicios") = value
End Set
End Property
Property GlobalDTOrdenesServiciosCaracteristicas() As DataTable
Get
GlobalDTOrdenesServiciosCaracteristicas = DirectCast(HttpContext.Current.Application("GlobalDTOrdenesServiciosCaracteristicas"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTOrdenesServiciosCaracteristicas") = value
End Set
End Property
Property GlobalDTCaracteristicasOpciones() As DataTable
Get
GlobalDTCaracteristicasOpciones = DirectCast(HttpContext.Current.Application("GlobalDTCaracteristicasOpciones"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTCaracteristicasOpciones") = value
End Set
End Property
Property GlobalDTTipoCuentasEquipos(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTTipoCuentasEquipos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTTipoCuentasEquipos = Dv.ToTable
Dv.Dispose()
Else
GlobalDTTipoCuentasEquipos = DirectCast(HttpContext.Current.Application("GlobalDTTipoCuentasEquipos"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTTipoCuentasEquipos") = value
End Set
End Property
Property GlobalDTTipoCuentasEquiposCaracteristicas(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTTipoCuentasEquiposCaracteristicas"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTTipoCuentasEquiposCaracteristicas = Dv.ToTable
Dv.Dispose()
Else
GlobalDTTipoCuentasEquiposCaracteristicas = DirectCast(HttpContext.Current.Application("GlobalDTTipoCuentasEquiposCaracteristicas"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTTipoCuentasEquiposCaracteristicas") = value
End Set
End Property
Property GlobalDTTipoCuentasEquiposOpciones(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTTipoCuentasEquiposOpciones"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTTipoCuentasEquiposOpciones = Dv.ToTable
Dv.Dispose()
Else
GlobalDTTipoCuentasEquiposOpciones = DirectCast(HttpContext.Current.Application("GlobalDTTipoCuentasEquiposOpciones"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTTipoCuentasEquiposOpciones") = value
End Set
End Property
ReadOnly Property GlobalDTPS(CveEmpresa As Integer, Optional CvePS As Integer = -1, Optional SATClavePS As String = "-1", Optional AplicaParaVenta As Integer = -1) As DataTable
Get
Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPS(CvePS, -1, CveEmpresa, SATClavePS:=SATClavePS, pAplicaParaVenta:=AplicaParaVenta) Then
GlobalDTPS = ObjPS.DtResultados
Else
GlobalDTPS = Nothing
End If
ObjPS.Dispose()
End Get
End Property
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
If CveEmpresa <> -1 Then
Dim Cons = DirectCast(HttpContext.Current.Application("GlobalDTPSSimplificado"), 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))
If PSCodigo <> "-1" Then Cons = Cons.Where((Function(a) Convert.ToString(a!PSCodigo) = PSCodigo))
If Estatus >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveEstado) = Estatus))
If AplicaParaVenta >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!AplicaParaVenta) = AplicaParaVenta))
Try
GlobalDTPSSimplificado = Cons.OrderBy(Function(a) a!PSCodigo).CopyToDataTable
Catch ex As Exception
GlobalDTPSSimplificado = New DataTable
End Try
Else
GlobalDTPSSimplificado = DirectCast(HttpContext.Current.Application("GlobalDTPSSimplificado"), EnumerableRowCollection(Of DataRow)).CopyToDataTable
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTPSSimplificado") = value
End Set
End Property
Property GlobalDTProductosServiciosAlias(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 CveEstado = {0} ", Estatus)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProductosServiciosAlias"), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows)
GlobalDTProductosServiciosAlias = Dv.ToTable
Dv.Dispose()
Else
GlobalDTProductosServiciosAlias = DirectCast(HttpContext.Current.Application("GlobalDTProductosServiciosAlias"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTProductosServiciosAlias") = value
End Set
End Property
Property GlobalDTProductosServiciosCaracteristicas(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProductosServiciosCaracteristicas"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTProductosServiciosCaracteristicas = Dv.ToTable
Dv.Dispose()
Else
GlobalDTProductosServiciosCaracteristicas = DirectCast(HttpContext.Current.Application("GlobalDTProductosServiciosCaracteristicas"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTProductosServiciosCaracteristicas") = value
End Set
End Property
Property GlobalDTProductosServiciosCaracteristicasOpciones(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProductosServiciosCaracteristicasOpciones"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTProductosServiciosCaracteristicasOpciones = Dv.ToTable
Dv.Dispose()
Else
GlobalDTProductosServiciosCaracteristicasOpciones = DirectCast(HttpContext.Current.Application("GlobalDTProductosServiciosCaracteristicasOpciones"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTProductosServiciosCaracteristicasOpciones") = value
End Set
End Property
Property GlobalDTInvMetodosInventario() As DataTable
Get
GlobalDTInvMetodosInventario = DirectCast(HttpContext.Current.Application("GlobalDTInvMetodosInventario"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTInvMetodosInventario") = value
End Set
End Property
Property GlobalDTAFCaracteristicasOpciones() As DataTable
Get
GlobalDTAFCaracteristicasOpciones = DirectCast(HttpContext.Current.Application("GlobalDTAFCaracteristicasOpciones"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTAFCaracteristicasOpciones") = value
End Set
End Property
Property GlobalDTAFCaracteristicas() As DataTable
Get
GlobalDTAFCaracteristicas = DirectCast(HttpContext.Current.Application("GlobalDTAFCaracteristicas"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTAFCaracteristicas") = value
End Set
End Property
Property GlobalDTAFCaracteristicasClasificaciones() As DataTable
Get
GlobalDTAFCaracteristicasClasificaciones = DirectCast(HttpContext.Current.Application("GlobalDTAFCaracteristicasClasificaciones"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTAFCaracteristicasClasificaciones") = value
End Set
End Property
Property GlobalDTImpuestosLocales(CvePS As Integer, CveEmpresa As Integer) As DataTable
Get
Dim Str As New StringBuilder
If CvePS > 0 Then Str.AppendFormat("CvePS = {0}", CvePS)
If CveEmpresa > 0 Then Str.AppendFormat("{0} CveEmpresa = {1}", If(CvePS > 0, " AND ", ""), CveEmpresa)
If CvePS > 0 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTImpuestosLocales"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
GlobalDTImpuestosLocales = Dv.ToTable
Dv.Dispose()
Else
GlobalDTImpuestosLocales = DirectCast(HttpContext.Current.Application("GlobalDTImpuestosLocales"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTImpuestosLocales") = value
End Set
End Property
'Bancos
Property GlobalDTBancos() As DataTable
Get
GlobalDTBancos = DirectCast(HttpContext.Current.Application("GlobalDTBancos"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTBancos") = value
End Set
End Property
Property GlobalDTEstatusIE() As DataTable
Get
GlobalDTEstatusIE = DirectCast(HttpContext.Current.Application("GlobalDTEstatusIE"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTEstatusIE") = value
End Set
End Property
Property GlobalDTBancosIE() As DataTable
Get
GlobalDTBancosIE = DirectCast(HttpContext.Current.Application("GlobalDTBancosIE"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTBancosIE") = value
End Set
End Property
Property GlobalDTTipoCuenta() As DataTable
Get
GlobalDTTipoCuenta = DirectCast(HttpContext.Current.Application("GlobalDTTipoCuenta"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTTipoCuenta") = value
End Set
End Property
'Fin Bancos
'Fin EstadoCIvil
'TipoPerioso
Property GlobalDTTipoPeriodo() As DataTable
Get
GlobalDTTipoPeriodo = DirectCast(HttpContext.Current.Application("GlobalDTTipoPeriodo"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTTipoPeriodo") = value
End Set
End Property
'Fin TipoPeriodo
'Periodos
Property GlobalDTNominasPeriodos(CveTipoPeriodo As Integer, CvePeriodo As Integer, CveEmpresa As Integer) As DataTable
Get
Dim Str As New StringBuilder
If CveEmpresa <> -1 Then Str.AppendFormat("CveEmpresa = {0}", CveEmpresa)
If CveTipoPeriodo <> -1 Then Str.AppendFormat(" {0} CveTipoPeriodo = {1}", If(Str.Length > 0, "AND", ""), CveTipoPeriodo)
If CvePeriodo <> -1 Then Str.AppendFormat(" {0} CvePeriodo = {1}", If(Str.Length > 0, "AND", ""), CvePeriodo)
If Str.Length > 0 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTNominasPeriodos"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
GlobalDTNominasPeriodos = Dv.ToTable
Dv.Dispose()
Else
GlobalDTNominasPeriodos = DirectCast(HttpContext.Current.Application("GlobalDTNominasPeriodos"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTNominasPeriodos") = value
End Set
End Property
'Fin Periodos
'Fin Ruta
'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)
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
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTEstatusOrdenServicios"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTEstatusOrdenServicios = Dv.ToTable
Dv.Dispose()
Else
GlobalDTEstatusOrdenServicios = DirectCast(HttpContext.Current.Application("GlobalDTEstatusOrdenServicios"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTEstatusOrdenServicios") = value
End Set
End Property
'Variables para Ventas
Property GlobalDTVendedores(CveEmpresa As Integer, Optional Estatus As Boolean = True, Optional VendedorTipo As Integer = 1) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTVendedores"), 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(HttpContext.Current.Application("GlobalDTVendedores"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTVendedores") = value
End Set
End Property
Property GlobalDTClientesCorporativo(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTClientesCorporativo"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTClientesCorporativo = Dv.ToTable
Dv.Dispose()
Else
GlobalDTClientesCorporativo = DirectCast(HttpContext.Current.Application("GlobalDTClientesCorporativo"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTClientesCorporativo") = value
End Set
End Property
Property GlobalDTCompProveedores(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTCompProveedores"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTCompProveedores = Dv.ToTable
Dv.Dispose()
Else
GlobalDTCompProveedores = DirectCast(HttpContext.Current.Application("GlobalDTCompProveedores"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTCompProveedores") = value
End Set
End Property
'EstatusFactura
Property GlobalDTCompEstatusFactura() As DataTable
Get
GlobalDTCompEstatusFactura = DirectCast(HttpContext.Current.Application("GlobalDTCompEstatusFactura"), DataTable).FiltraParametros("Estatus = 'Activo'")
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTCompEstatusFactura") = value
End Set
End Property
Property GlobalDTContratosSecciones() As DataTable
Get
GlobalDTContratosSecciones = DirectCast(HttpContext.Current.Application("GlobalDTContratosSecciones"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTContratosSecciones") = value
End Set
End Property
Property GlobalDTContratos() As DataTable
Get
GlobalDTContratos = DirectCast(HttpContext.Current.Application("GlobalDTContratos"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTContratos") = value
End Set
End Property
Property GlobalDTContratosTipos() As DataTable
Get
GlobalDTContratosTipos = DirectCast(HttpContext.Current.Application("GlobalDTContratosTipos"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTContratosTipos") = value
End Set
End Property
Property GlobalDTTipoAlmacen(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTTipoAlmacen"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTTipoAlmacen = Dv.ToTable
Dv.Dispose()
Else
GlobalDTTipoAlmacen = DirectCast(HttpContext.Current.Application("GlobalDTTipoAlmacen"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTTipoAlmacen") = value
End Set
End Property
Property GlobalDTInvConceptos() As DataTable
Get
Return DirectCast(HttpContext.Current.Application("GlobalDTInvConceptos"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTInvConceptos") = value
End Set
End Property
Property GlobalDTSeccionAlmacen(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTSeccionAlmacen"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTSeccionAlmacen = Dv.ToTable
Dv.Dispose()
Else
GlobalDTSeccionAlmacen = DirectCast(HttpContext.Current.Application("GlobalDTSeccionAlmacen"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTSeccionAlmacen") = value
End Set
End Property
Property GlobalDTAlmacen(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTAlmacen"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTAlmacen = Dv.ToTable
Dv.Dispose()
Else
GlobalDTAlmacen = DirectCast(HttpContext.Current.Application("GlobalDTAlmacen"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTAlmacen") = value
End Set
End Property
Property GlobalDTAlmacenUsuarios(CveUsuario As Integer, CveEmpresa As Integer, Optional CveTipoAlmacen As Integer = 1) As DataTable
Get
Dim AppNombre As String = String.Format("GlobalDTAlmacenUsuarios-{0}", CveEmpresa)
'sino existe, recarga los datos
If HttpContext.Current.Application(AppNombre) Is Nothing Then
Dim ObjUsr As New ClsSisUsuarios
If ObjUsr.GetAlmacen(-1, CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjUsr.DtResultados
ObjUsr.Dispose()
End If
Dim Str As New StringBuilder
Str.AppendFormat("CveUsuario = {0} AND CveEmpresa = {1} ", CveUsuario, CveEmpresa)
If CveTipoAlmacen > 0 Then Str.AppendFormat("AND CveTipoAlmacen = {0}", CveTipoAlmacen)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
GlobalDTAlmacenUsuarios = Dv.ToTable
Dv.Dispose()
End Get
Set(value As DataTable)
Dim AppNombre As String = String.Format("GlobalDTAlmacenUsuarios-{0}", CveEmpresa)
HttpContext.Current.Application(AppNombre) = value
End Set
'Get
' If CveEmpresa <> -1 Then
' Dim Str As New StringBuilder
' Str.AppendFormat("CveUsuario = {0} AND CveEmpresa = {1} ", CveUsuario, CveEmpresa)
' If CveTipoAlmacen > 0 Then Str.AppendFormat("AND CveTipoAlmacen = {0}", CveTipoAlmacen)
' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTAlmacenUsuarios"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
' GlobalDTAlmacenUsuarios = Dv.ToTable
' Dv.Dispose()
' Else
' GlobalDTAlmacenUsuarios = DirectCast(HttpContext.Current.Application("GlobalDTAlmacenUsuarios"), DataTable)
' End If
'End Get
'Set(value As DataTable)
' HttpContext.Current.Application("GlobalDTAlmacenUsuarios") = value
'End Set
End Property
Property GlobalDTNom_Periodos() As DataTable
Get
GlobalDTNom_Periodos = DirectCast(HttpContext.Current.Application("GlobalDTNom_Periodos"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTNom_Periodos") = value
End Set
End Property
Property GlobalDTVtaFormaPago() As DataTable
Get
GlobalDTVtaFormaPago = DirectCast(HttpContext.Current.Application("GlobalDTVtaFormaPago"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTVtaFormaPago") = value
End Set
End Property
Property GlobalDTVtaMetodoPago() As DataTable
Get
GlobalDTVtaMetodoPago = DirectCast(HttpContext.Current.Application("GlobalDTVtaMetodoPago"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTVtaMetodoPago") = value
End Set
End Property
Property GlobalDTVtaTiposRelacion() As DataTable
Get
GlobalDTVtaTiposRelacion = DirectCast(HttpContext.Current.Application("GlobalDTVtaTiposRelacion"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTVtaTiposRelacion") = value
End Set
End Property
Property GlobalDTTiposDocumentos() As DataTable
Get
GlobalDTTiposDocumentos = DirectCast(HttpContext.Current.Application("GlobalDTTiposDocumentos"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTTiposDocumentos") = value
End Set
End Property
Property GlobalDTCobranzaEstatus(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTVtaCobranzaEstatus"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTCobranzaEstatus = Dv.ToTable
Dv.Dispose()
Else
GlobalDTCobranzaEstatus = DirectCast(HttpContext.Current.Application("GlobalDTVtaCobranzaEstatus"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTVtaCobranzaEstatus") = value
End Set
End Property
#Region "***********************************************************************DT EVENTOS****************************************************************************************"
Property GlobalDTTiposEventos() As DataTable
Get
GlobalDTTiposEventos = DirectCast(HttpContext.Current.Application("GlobalDTTiposEventos"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTTiposEventos") = value
End Set
End Property
Property GlobalDTEventos() As DataTable
Get
GlobalDTEventos = DirectCast(HttpContext.Current.Application("GlobalDTEventos"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTEventos") = value
End Set
End Property
Property GlobalDTOIEventoTarea() As DataTable
Get
GlobalDTOIEventoTarea = DirectCast(HttpContext.Current.Application("GlobalDTOIEventoTarea"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTOIEventoTarea") = value
End Set
End Property
Property GlobalDTOIEstatusEventos() As DataTable
Get
GlobalDTOIEstatusEventos = DirectCast(HttpContext.Current.Application("GlobalDTOIEstatusEventos"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTOIEstatusEventos") = value
End Set
End Property
#End Region
#Region " **********************************************************************DT PROSPECTOS*************************************************************************************"
Property GlobalDTProspectosCaracteristicasClasificaciones() As DataTable
Get
GlobalDTProspectosCaracteristicasClasificaciones = DirectCast(HttpContext.Current.Application("GlobalDTProspectosCaracteristicasClasificaciones"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTProspectosCaracteristicasClasificaciones") = value
End Set
End Property
Property GlobalDTProspectosTiposCaracteristicas() As DataTable
Get
GlobalDTProspectosTiposCaracteristicas = DirectCast(HttpContext.Current.Application("GlobalDTProspectosTiposCaracteristicas"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTProspectosTiposCaracteristicas") = value
End Set
End Property
Property GlobalDTProspectosCaracteristicas(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProspectosCaracteristicas"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTProspectosCaracteristicas = Dv.ToTable
Dv.Dispose()
Else
GlobalDTProspectosCaracteristicas = DirectCast(HttpContext.Current.Application("GlobalDTProspectosCaracteristicas"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTProspectosCaracteristicas") = value
End Set
End Property
Property GlobalDTProspectosCaracteristicasOpciones() As DataTable
Get
GlobalDTProspectosCaracteristicasOpciones = DirectCast(HttpContext.Current.Application("GlobalDTProspectosCaracteristicasOpciones"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTProspectosCaracteristicasOpciones") = value
End Set
End Property
#End Region
#Region "***********************************************************************DT ACTIVOS FIJOS**********************************************************************************"
Property GlobalDTActivoFijos(CveEmpresa As Integer, Optional CveSubTipoActivoFijo As Integer = -1, Optional CveActivoFijo As Integer = -1) As DataTable
Get
Dim dt As DataTable = Nothing
'Dim Str As New StringBuilder
'Str.AppendFormat("CveEmpresa = {0}", CveEmpresa)
'If CveSubTipoActivoFijo <> -1 Then Str.AppendFormat(" AND CveSubTipoActivoFijo = {0}", CveSubTipoActivoFijo)
Dim ObjAF As New ClsAF
'If ObjAF.GetActivosFijos(CveActivoFijo, UsuarioActual.CveEmpresa, "-1", "-1", -1, -1, -1, "-1", -1, -1, -1, -1, -1) Then
If ObjAF.GetActivosFijos(CveActivoFijo, CveEmpresa, "-1", "-1", -1, CveSubTipoActivoFijo, "-1", -1, -1, -1, -1, -1, "", -1) Then
dt = ObjAF.DtResultados
End If
ObjAF.Dispose()
GlobalDTActivoFijos = dt
End Get
Set(ByVal value As DataTable)
HttpContext.Current.Application("GlobalDTActivoFijos") = value
End Set
End Property
Property GlobalDTEstadoActivoFijo() As DataTable
Get
GlobalDTEstadoActivoFijo = DirectCast(HttpContext.Current.Application("GlobalDTEstadoActivoFijo"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTEstadoActivoFijo") = value
End Set
End Property
Property GlobalDTMarcaActivoFijo(CveEmpresa As Integer) As DataTable
Get
Dim dt As DataTable = Nothing
Dim ObjAF As New ClsAF
If ObjAF.GetMarcasActivosFijos(CveEmpresa) Then
dt = ObjAF.DtResultados
End If
ObjAF.Dispose()
GlobalDTMarcaActivoFijo = dt
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTMarcaActivoFijo") = value
End Set
End Property
Property GlobalDTModeloActivoFijo(CveEmpresa As Integer, CveMarca As Integer) As DataTable
Get
Dim dt As DataTable = Nothing
Dim ObjAF As New ClsAF
If ObjAF.GetModelosActivosFijos(CveEmpresa, CveMarca) Then
dt = ObjAF.DtResultados
End If
ObjAF.Dispose()
GlobalDTModeloActivoFijo = dt
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTModeloActivoFijo") = value
End Set
End Property
Property GlobalDTSubTipoActivoFijo(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTSubTipoActivoFijo"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTSubTipoActivoFijo = Dv.ToTable
Dv.Dispose()
Else
GlobalDTSubTipoActivoFijo = DirectCast(HttpContext.Current.Application("GlobalDTSubTipoActivoFijo"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTSubTipoActivoFijo") = value
End Set
End Property
Property GlobalDTTipoActivoFijo(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTTipoActivoFijo"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTTipoActivoFijo = Dv.ToTable
Dv.Dispose()
Else
GlobalDTTipoActivoFijo = DirectCast(HttpContext.Current.Application("GlobalDTTipoActivoFijo"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTTipoActivoFijo") = value
End Set
End Property
#End Region
#Region "***********************************************************************DT GENERALES**************************************************************************************"
Property GlobalDTGralPaises() As DataTable
Get
GlobalDTGralPaises = DirectCast(HttpContext.Current.Application("GlobalDTGralPaises"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTGralPaises") = value
End Set
End Property
Property GlobalDTGralEstados(CvePais As Integer) As DataTable
Get
GlobalDTGralEstados = DirectCast(HttpContext.Current.Application("GlobalDTGralEstados"), DataTable).FiltraParametros(String.Format("CvePais ={0}", CvePais))
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTGralEstados") = value
End Set
End Property
Property GlobalDTGralMunicipios(CveEstado As Integer) As DataTable
Get
GlobalDTGralMunicipios = DirectCast(HttpContext.Current.Application("GlobalDTGralMunicipios"), DataTable).FiltraParametros(String.Format("CveEstado ={0}", CveEstado))
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTGralMunicipios") = value
End Set
End Property
Property GlobalDTGralPoblaciones() As DataTable
Get
GlobalDTGralPoblaciones = DirectCast(HttpContext.Current.Application("GlobalDTGralPoblaciones"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTGralPoblaciones") = value
End Set
End Property
Property GlobalDTGralCategorias(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTGralCategorias"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTGralCategorias = Dv.ToTable
Dv.Dispose()
Else
GlobalDTGralCategorias = DirectCast(HttpContext.Current.Application("GlobalDTGralCategorias"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTGralCategorias") = value
End Set
End Property
Property GlobalDTGralCategorias2(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTCategorias2"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTGralCategorias2 = Dv.ToTable
Dv.Dispose()
Else
GlobalDTGralCategorias2 = DirectCast(HttpContext.Current.Application("GlobalDTCategorias2"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTCategorias2") = value
End Set
End Property
Property GlobalDTGralEscolaridades() As DataTable
Get
GlobalDTGralEscolaridades = DirectCast(HttpContext.Current.Application("GlobalDTGralEscolaridades"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTGralEscolaridades") = value
End Set
End Property
Property GlobalDTGralColectivas(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTGralColectivas"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTGralColectivas = Dv.ToTable
Dv.Dispose()
Else
GlobalDTGralColectivas = DirectCast(HttpContext.Current.Application("GlobalDTGralColectivas"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTGralColectivas") = value
End Set
End Property
#End Region
#Region "***********************************************************************DT PROSPECTOS*************************************************************************************"
Property GlobalDTProspectosSupervisores(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProspectosSupervisores"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTProspectosSupervisores = Dv.ToTable
Dv.Dispose()
Else
GlobalDTProspectosSupervisores = DirectCast(HttpContext.Current.Application("GlobalDTProspectosSupervisores"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTProspectosSupervisores") = value
End Set
End Property
Property GlobalDTProspectosCoordinadores(CveSupervisor As Integer, CveEmpresa As Integer) As DataTable
Get
Dim Str As New StringBuilder
If CveEmpresa <> -1 Then Str.AppendFormat("CveEmpresa = {0}", CveEmpresa)
If CveSupervisor <> -1 Then Str.AppendFormat(" {0} CveSupervisor = {1}", If(Str.Length > 0, "AND", ""), CveSupervisor)
If Str.Length > 0 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProspectosCoordinadores"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
GlobalDTProspectosCoordinadores = Dv.ToTable
Dv.Dispose()
Else
GlobalDTProspectosCoordinadores = DirectCast(HttpContext.Current.Application("GlobalDTProspectosCoordinadores"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTProspectosCoordinadores") = value
End Set
End Property
Property GlobalDTProspectosApoyos(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProspectosApoyos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTProspectosApoyos = Dv.ToTable
Dv.Dispose()
Else
GlobalDTProspectosApoyos = DirectCast(HttpContext.Current.Application("GlobalDTProspectosApoyos"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTProspectosApoyos") = value
End Set
End Property
Property GlobalDTProspectosClasificaciones(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProspectosClasificaciones"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTProspectosClasificaciones = Dv.ToTable
Dv.Dispose()
Else
GlobalDTProspectosClasificaciones = DirectCast(HttpContext.Current.Application("GlobalDTProspectosClasificaciones"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTProspectosClasificaciones") = value
End Set
End Property
Property GlobalDTProspectosEventosTipo(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProspectosEventosTipo"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTProspectosEventosTipo = Dv.ToTable
Dv.Dispose()
Else
GlobalDTProspectosEventosTipo = DirectCast(HttpContext.Current.Application("GlobalDTProspectosEventosTipo"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTProspectosEventosTipo") = value
End Set
End Property
Property GlobalDTProspectosEvento(CveEventoTipo As Integer, CveEmpresa As Integer) As DataTable
Get
Dim Str As New StringBuilder
If CveEmpresa <> -1 Then Str.AppendFormat("CveEmpresa = {0}", CveEmpresa)
If CveEventoTipo <> -1 Then Str.AppendFormat(" {0} CveEventoTipo = {1}", If(Str.Length > 0, "AND", ""), CveEventoTipo)
If Str.Length > 0 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProspectosEvento"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
GlobalDTProspectosEvento = Dv.ToTable
Dv.Dispose()
Else
GlobalDTProspectosEvento = DirectCast(HttpContext.Current.Application("GlobalDTProspectosEvento"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTProspectosEvento") = value
End Set
End Property
Property GlobalDTProspectosEstatus(CveEmpresa As Integer) As DataTable
Get
Dim Str As New StringBuilder
If CveEmpresa <> -1 Then Str.AppendFormat("CveEmpresa = {0}", CveEmpresa)
If Str.Length > 0 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProspectosEstatus"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
GlobalDTProspectosEstatus = Dv.ToTable
Dv.Dispose()
Else
GlobalDTProspectosEstatus = DirectCast(HttpContext.Current.Application("GlobalDTProspectosEstatus"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTProspectosEstatus") = value
End Set
End Property
Property GlobalDTProspectosApoyosTipos(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProspectosApoyosTipos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTProspectosApoyosTipos = Dv.ToTable
Dv.Dispose()
Else
GlobalDTProspectosApoyosTipos = DirectCast(HttpContext.Current.Application("GlobalDTProspectosApoyosTipos"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTProspectosApoyosTipos") = value
End Set
End Property
Property GlobalDTProspectosApoyosTipos() As DataTable
Get
GlobalDTProspectosApoyosTipos = DirectCast(HttpContext.Current.Application("GlobalDTProspectosApoyosTipos"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTProspectosApoyosTipos") = value
End Set
End Property
Property GlobalDTProspectosEncuestas(CveEmpresa As Integer) As DataTable
Get
Dim Str As New StringBuilder
If CveEmpresa <> -1 Then Str.AppendFormat("CveEmpresa = {0}", CveEmpresa)
If Str.Length > 0 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProspectosEncuestas"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
GlobalDTProspectosEncuestas = Dv.ToTable
Dv.Dispose()
Else
GlobalDTProspectosEncuestas = DirectCast(HttpContext.Current.Application("GlobalDTProspectosEncuestas"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTProspectosEncuestas") = value
End Set
End Property
Property GlobalDTProspectosEncuestasPreguntas(CveEncuesta As Integer, CveEmpresa As Integer) As DataTable
Get
Dim Str As New StringBuilder
If CveEmpresa <> -1 Then Str.AppendFormat("CveEmpresa = {0}", CveEmpresa)
If CveEncuesta <> -1 Then Str.AppendFormat(" {0} CveEncuesta = {1}", If(Str.Length > 0, "AND", ""), CveEncuesta)
If Str.Length > 0 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProspectosEncuestasPreguntas"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
GlobalDTProspectosEncuestasPreguntas = Dv.ToTable
Dv.Dispose()
Else
GlobalDTProspectosEncuestasPreguntas = DirectCast(HttpContext.Current.Application("GlobalDTProspectosEncuestasPreguntas"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTProspectosEncuestasPreguntas") = value
End Set
End Property
Property GlobalDTProspectosEncuestasRespuestas(CvePregunta As Integer, CveEncuesta As Integer, CveEmpresa As Integer) As DataTable
Get
Dim Str As New StringBuilder
If CveEmpresa <> -1 Then Str.AppendFormat("CveEmpresa = {0}", CveEmpresa)
If CveEncuesta <> -1 Then Str.AppendFormat(" {0} CveEncuesta = {1}", If(Str.Length > 0, "AND", ""), CveEncuesta)
If CvePregunta <> -1 Then Str.AppendFormat(" {0} CvePregunta = {1}", If(Str.Length > 0, "AND", ""), CvePregunta)
If Str.Length > 0 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProspectosEncuestasRespuestas"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
GlobalDTProspectosEncuestasRespuestas = Dv.ToTable
Dv.Dispose()
Else
GlobalDTProspectosEncuestasRespuestas = DirectCast(HttpContext.Current.Application("GlobalDTProspectosEncuestasRespuestas"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTProspectosEncuestasRespuestas") = value
End Set
End Property
Property GlobalDTProspectosTipos(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProspectosTipos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTProspectosTipos = Dv.ToTable
Dv.Dispose()
Else
GlobalDTProspectosTipos = DirectCast(HttpContext.Current.Application("GlobalDTProspectosTipos"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTProspectosTipos") = value
End Set
End Property
#Region " DT PROSPECTOS SOLICITUDES"
Property GlobalDTProspectosSolicitudes(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProspectosSolicitudes"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTProspectosSolicitudes = Dv.ToTable
Dv.Dispose()
Else
GlobalDTProspectosSolicitudes = DirectCast(HttpContext.Current.Application("GlobalDTProspectosSolicitudes"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTProspectosSolicitudes") = value
End Set
End Property
Property GlobalDTProspectosSolicitudesEstatus(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProspectosSolicitudesEstatus"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTProspectosSolicitudesEstatus = Dv.ToTable
Dv.Dispose()
Else
GlobalDTProspectosSolicitudesEstatus = DirectCast(HttpContext.Current.Application("GlobalDTProspectosSolicitudesEstatus"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTProspectosSolicitudesEstatus") = value
End Set
End Property
Property GlobalDTProspectosSolicitudesTipos(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProspectosSolicitudesTipos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTProspectosSolicitudesTipos = Dv.ToTable
Dv.Dispose()
Else
GlobalDTProspectosSolicitudesTipos = DirectCast(HttpContext.Current.Application("GlobalDTProspectosSolicitudesTipos"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTProspectosSolicitudesTipos") = value
End Set
End Property
'Property GlobalDTProspectosSolicitudesTipos() As DataTable
' Get
' GlobalDTProspectosSolicitudesTipos = DirectCast(HttpContext.Current.Application("GlobalDTProspectosSolicitudesTipos"), DataTable)
' End Get
' Set(value As DataTable)
' HttpContext.Current.Application("GlobalDTProspectosSolicitudesTipos") = value
' End Set
'End Property
Property GlobalDTProspectosSolicitudesApoyos(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProspectosSolicitudesApoyos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTProspectosSolicitudesApoyos = Dv.ToTable
Dv.Dispose()
Else
GlobalDTProspectosSolicitudesApoyos = DirectCast(HttpContext.Current.Application("GlobalDTProspectosSolicitudesApoyos"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTProspectosSolicitudesApoyos") = value
End Set
End Property
#End Region
#End Region
#Region "**********************************************DT AMORTIZACIÓN CONTABLE PLAN DE DESARROLLO********************************************************************************"
#Region "***********************************************************************DT AMORTIZACIÓN CONTABLE*********************************************************************************************"
Property GlobalDTAC_RubrosIngreso() As DataTable
Get
GlobalDTAC_RubrosIngreso = DirectCast(HttpContext.Current.Application("GlobalDTAC_RubrosIngreso"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTAC_RubrosIngreso") = value
End Set
End Property
Property GlobalDTAC_FuentesRecaudacion(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim StrSQL As String = String.Format("CveEmpresa = {0}", CveEmpresa)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTAC_FuentesRecaudacion"), DataTable), StrSQL, "", DataViewRowState.CurrentRows)
GlobalDTAC_FuentesRecaudacion = Dv.ToTable
Dv.Dispose()
Else
GlobalDTAC_FuentesRecaudacion = DirectCast(HttpContext.Current.Application("GlobalDTAC_FuentesRecaudacion"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTAC_FuentesRecaudacion") = value
End Set
End Property
Property GlobalDTAC_FuentesFinanciamiento() As DataTable
Get
GlobalDTAC_FuentesFinanciamiento = DirectCast(HttpContext.Current.Application("GlobalDTAC_FuentesFinanciamiento"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTAC_FuentesFinanciamiento") = value
End Set
End Property
Property GlobalDTAC_OG() As DataTable
Get
GlobalDTAC_OG = DirectCast(HttpContext.Current.Application("GlobalDTAC_OG"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTAC_OG") = value
End Set
End Property
'Property GlobalDTAC_ClasificadorOG(CveEmpresa As Integer) As DataTable
' Get
' If CveEmpresa <> -1 Then
' Dim StrSQL As String = String.Format("CveEmpresa = {0}", CveEmpresa)
' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTAC_ClasificadorOG"), DataTable), StrSQL, "", DataViewRowState.CurrentRows)
' GlobalDTAC_ClasificadorOG = Dv.ToTable
' Dv.Dispose()
' Else
' GlobalDTAC_ClasificadorOG = DirectCast(HttpContext.Current.Application("GlobalDTAC_ClasificadorOG"), DataTable)
' End If
' End Get
' Set(value As DataTable)
' HttpContext.Current.Application("GlobalDTAC_ClasificadorOG") = value
' End Set
'End Property
Property GlobalDTAC_Ubicaciones() As DataTable
Get
GlobalDTAC_Ubicaciones = DirectCast(HttpContext.Current.Application("GlobalDTAC_Ubicaciones"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTAC_Ubicaciones") = value
End Set
End Property
Property GlobalDTAC_UnidadesAdministrativas(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim StrSQL As String = String.Format("CveEmpresa = {0}", CveEmpresa)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTAC_UnidadesAdministrativas"), DataTable), StrSQL, "", DataViewRowState.CurrentRows)
GlobalDTAC_UnidadesAdministrativas = Dv.ToTable
Dv.Dispose()
Else
GlobalDTAC_UnidadesAdministrativas = DirectCast(HttpContext.Current.Application("GlobalDTAC_UnidadesAdministrativas"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTAC_UnidadesAdministrativas") = value
End Set
End Property
Property GlobalDTAC_ClasificacionFuncional(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTAC_ClasificacionFuncional"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTAC_ClasificacionFuncional = Dv.ToTable
Dv.Dispose()
Else
GlobalDTAC_ClasificacionFuncional = DirectCast(HttpContext.Current.Application("GlobalDTAC_ClasificacionFuncional"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTAC_ClasificacionFuncional") = value
End Set
End Property
Property GlobalDTAC_ClasificacionGeografica(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTAC_ClasificacionGeografica"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTAC_ClasificacionGeografica = Dv.ToTable
Dv.Dispose()
Else
GlobalDTAC_ClasificacionGeografica = DirectCast(HttpContext.Current.Application("GlobalDTAC_ClasificacionGeografica"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTAC_ClasificacionGeografica") = value
End Set
End Property
Property GlobalDTAC_Cuentas() As DataTable
Get
GlobalDTAC_Cuentas = DirectCast(HttpContext.Current.Application("GlobalDTAC_Cuentas"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTAC_Cuentas") = value
End Set
End Property
Property GlobalDTAC_Finalidad() As DataTable
Get
GlobalDTAC_Finalidad = DirectCast(HttpContext.Current.Application("GlobalDTAC_Finalidad"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTAC_Finalidad") = value
End Set
End Property
'Property GlobalDTAC_FuenteFinanciamiento() As DataTable
' Get
' GlobalDTAC_FuenteFinanciamiento = DirectCast(HttpContext.Current.Application("GlobalDTAC_FuenteFinanciamiento"), DataTable)
' End Get
' Set(value As DataTable)
' HttpContext.Current.Application("GlobalDTAC_FuenteFinanciamiento") = value
' End Set
'End Property
Property GlobalDTAC_FuentesFinanciamiento(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim StrSQL As String = String.Format("CveEmpresa = {0}", CveEmpresa)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTAC_FuentesFinanciamiento"), DataTable), StrSQL, "", DataViewRowState.CurrentRows)
GlobalDTAC_FuentesFinanciamiento = Dv.ToTable
Dv.Dispose()
Else
GlobalDTAC_FuentesFinanciamiento = DirectCast(HttpContext.Current.Application("GlobalDTAC_FuentesFinanciamiento"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTAC_FuentesFinanciamiento") = value
End Set
End Property
Property GlobalDTAC_FuentesFinanciamientoCONAC() As DataTable
Get
GlobalDTAC_FuentesFinanciamientoCONAC = DirectCast(HttpContext.Current.Application("GlobalDTAC_FuentesFinanciamientoCONAC"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTAC_FuentesFinanciamientoCONAC") = value
End Set
End Property
Property GlobalDTAC_Funcion() As DataTable
Get
GlobalDTAC_Funcion = DirectCast(HttpContext.Current.Application("GlobalDTAC_Funcion"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTAC_Funcion") = value
End Set
End Property
Property GlobalDTAC_Programas() As DataTable
Get
GlobalDTAC_Programas = DirectCast(HttpContext.Current.Application("GlobalDTAC_Programas"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTAC_Programas") = value
End Set
End Property
Property GlobalDTAC_ProgramasCONAC() As DataTable
Get
GlobalDTAC_ProgramasCONAC = DirectCast(HttpContext.Current.Application("GlobalDTAC_ProgramasCONAC"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTAC_ProgramasCONAC") = value
End Set
End Property
Property GlobalDTAC_ProyectosProceso() As DataTable
Get
GlobalDTAC_ProyectosProceso = DirectCast(HttpContext.Current.Application("GlobalDTAC_ProyectosProceso"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTAC_ProyectosProceso") = value
End Set
End Property
Property GlobalDTAC_SubFuncion() As DataTable
Get
GlobalDTAC_SubFuncion = DirectCast(HttpContext.Current.Application("GlobalDTAC_SubFuncion"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTAC_SubFuncion") = value
End Set
End Property
Property GlobalDTAC_SubProgramas() As DataTable
Get
GlobalDTAC_SubProgramas = DirectCast(HttpContext.Current.Application("GlobalDTAC_SubProgramas"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTAC_SubProgramas") = value
End Set
End Property
Property GlobalDTAC_ClasificacionAdministrativa(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTAC_ClasificacionAdministrativa"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTAC_ClasificacionAdministrativa = Dv.ToTable
Dv.Dispose()
Else
GlobalDTAC_ClasificacionAdministrativa = DirectCast(HttpContext.Current.Application("GlobalDTAC_ClasificacionAdministrativa"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTAC_ClasificacionAdministrativa") = value
End Set
End Property
Property GlobalDTAC_TipoGasto() As DataTable
Get
GlobalDTAC_TipoGasto = DirectCast(HttpContext.Current.Application("GlobalDTAC_TipoGasto"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTAC_TipoGasto") = value
End Set
End Property
Property GlobalDTAC_ProgramaOperativo(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTAC_ProgramaOperativo"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTAC_ProgramaOperativo = Dv.ToTable
Dv.Dispose()
Else
GlobalDTAC_ProgramaOperativo = DirectCast(HttpContext.Current.Application("GlobalDTAC_ProgramaOperativo"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTAC_ProgramaOperativo") = value
End Set
End Property
Property GlobalDTAC_MatrizIngresos() As DataTable
Get
GlobalDTAC_MatrizIngresos = DirectCast(HttpContext.Current.Application("GlobalDTAC_MatrizIngresos"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTAC_MatrizIngresos") = value
End Set
End Property
Property GlobalDTAC_MatrizEgresos() As DataTable
Get
GlobalDTAC_MatrizEgresos = DirectCast(HttpContext.Current.Application("GlobalDTAC_MatrizEgresos"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTAC_MatrizEgresos") = value
End Set
End Property
#End Region
Property GlobalDTAC_PD_EjeRector(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTAC_PD_EjeRector"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTAC_PD_EjeRector = Dv.ToTable
Dv.Dispose()
Else
GlobalDTAC_PD_EjeRector = DirectCast(HttpContext.Current.Application("GlobalDTAC_PD_EjeRector"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTAC_PD_EjeRector") = value
End Set
End Property
Property GlobalDTAC_PD_Programas(CveEjeRector As Integer) As DataTable
Get
If CveEjeRector <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTAC_PD_Programas"), DataTable), String.Format("CveEjeRector = {0}", CveEjeRector), "", DataViewRowState.CurrentRows)
GlobalDTAC_PD_Programas = Dv.ToTable
Dv.Dispose()
Else
GlobalDTAC_PD_Programas = DirectCast(HttpContext.Current.Application("GlobalDTAC_PD_Programas"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTAC_PD_Programas") = value
End Set
End Property
Property GlobalDTAC_PD_Estrategias(CveProgramas As Integer) As DataTable
Get
If CveProgramas <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTAC_PD_Estrategias"), DataTable), String.Format("CvePrograma = {0}", CveProgramas), "", DataViewRowState.CurrentRows)
GlobalDTAC_PD_Estrategias = Dv.ToTable
Dv.Dispose()
Else
GlobalDTAC_PD_Estrategias = DirectCast(HttpContext.Current.Application("GlobalDTAC_PD_Estrategias"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTAC_PD_Estrategias") = value
End Set
End Property
Property GlobalDTAC_PD_LineasAccion(CveEstrategias As Integer) As DataTable
Get
If CveEstrategias <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTAC_PD_LineasAccion"), DataTable), String.Format("CveEstrategia = {0}", CveEstrategias), "", DataViewRowState.CurrentRows)
GlobalDTAC_PD_LineasAccion = Dv.ToTable
Dv.Dispose()
Else
GlobalDTAC_PD_LineasAccion = DirectCast(HttpContext.Current.Application("GlobalDTAC_PD_LineasAccion"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTAC_PD_LineasAccion") = value
End Set
End Property
Property GlobalDTAC_PD_Metas(CveLineasAccion As Integer) As DataTable
Get
If CveLineasAccion <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTAC_PD_Metas"), DataTable), String.Format("CveLineaAccion = {0}", CveLineasAccion), "", DataViewRowState.CurrentRows)
GlobalDTAC_PD_Metas = Dv.ToTable
Dv.Dispose()
Else
GlobalDTAC_PD_Metas = DirectCast(HttpContext.Current.Application("GlobalDTAC_PD_Metas"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTAC_PD_Metas") = value
End Set
End Property
#End Region
#Region "***********************************************************************GLOBAL DT ORDENES DE COMPRA***********************************************************************"
Property GlobalDTOCEstatus(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTOCEstatus"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTOCEstatus = Dv.ToTable
Dv.Dispose()
Else
GlobalDTOCEstatus = DirectCast(HttpContext.Current.Application("GlobalDTOCEstatus"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTOCEstatus") = value
End Set
End Property
Property GlobalDTOCEstatusUsuarios(CveEmpresa As Integer, Optional CveUsuario As Integer = -1, Optional Tipo As String = "") As DataTable
Get
If CveEmpresa <> -1 Then
Dim filtro As New StringBuilder
filtro.AppendFormat("CveEmpresa = {0} ", CveEmpresa)
If CveUsuario > 0 Then
filtro.AppendFormat(" AND CveUsuario={0} ", CveUsuario)
End If
If Tipo <> "" Then
filtro.AppendFormat(" AND Tipo='{0}'", Tipo)
End If
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTOCEstatusUsuarios"), DataTable), filtro.ToString, "", DataViewRowState.CurrentRows)
GlobalDTOCEstatusUsuarios = Dv.ToTable
Dv.Dispose()
Else
GlobalDTOCEstatusUsuarios = DirectCast(HttpContext.Current.Application("GlobalDTOCEstatusUsuarios"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTOCEstatusUsuarios") = value
End Set
End Property
#End Region
#Region "F I N A N Z A S "
Property GlobalDTFinan_RazonesFinancieras() As DataTable
Get
GlobalDTFinan_RazonesFinancieras = DirectCast(HttpContext.Current.Application("GlobalDTFinan_RazonesFinancieras"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTFinan_RazonesFinancieras") = value
End Set
End Property
#End Region
#Region "***********************************************************************GLOBAL DT CONTABILIDAD****************************************************************************"
Property GlobalDTContaPlantillasPolizas(CveEmpresa As Integer, Optional TipoPlantilla As Integer = -1) As DataTable
Get
If CveEmpresa <> -1 Or TipoPlantilla <> -1 Then
Dim Str As New StringBuilder
If CveEmpresa <> -1 Then Str.AppendFormat(" AND CveEmpresa = {0}", CveEmpresa)
If TipoPlantilla <> -1 Then Str.AppendFormat(" AND TipoPlantilla = {0}", TipoPlantilla)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTContaPlantillasPolizas"), DataTable), Str.ToString.Substring(5), "", DataViewRowState.CurrentRows)
GlobalDTContaPlantillasPolizas = Dv.ToTable
Dv.Dispose()
Else
GlobalDTContaPlantillasPolizas = DirectCast(HttpContext.Current.Application("GlobalDTContaPlantillasPolizas"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTContaPlantillasPolizas") = value
End Set
End Property
Property GlobalDTContaPlantillasPolizasDetalle(CvePlantillaPoliza As Integer) As DataTable
Get
If CvePlantillaPoliza <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTContaPlantillasPolizasDetalle"), DataTable), String.Format("CvePlantillaPoliza = {0}", CvePlantillaPoliza), "", DataViewRowState.CurrentRows)
GlobalDTContaPlantillasPolizasDetalle = Dv.ToTable
Dv.Dispose()
Else
GlobalDTContaPlantillasPolizasDetalle = DirectCast(HttpContext.Current.Application("GlobalDTContaPlantillasPolizasDetalle"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTContaPlantillasPolizasDetalle") = value
End Set
End Property
Property GlobalDTContaConceptosContables(CvePlantillaPoliza As Integer) As DataTable
Get
If CvePlantillaPoliza <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTContaConceptosContables"), DataTable), String.Format("CvePlantillaPoliza = {0}", CvePlantillaPoliza), "", DataViewRowState.CurrentRows)
GlobalDTContaConceptosContables = Dv.ToTable
Dv.Dispose()
Else
GlobalDTContaConceptosContables = DirectCast(HttpContext.Current.Application("GlobalDTContaConceptosContables"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTContaConceptosContables") = value
End Set
End Property
#End Region
#Region "**********************************************************************GLOBAL DT RH (RECURSOS HUMANOS)********************************************************************"
Property GlobalDTAsistenciaDetalle() As DataTable
Get
GlobalDTAsistenciaDetalle = DirectCast(HttpContext.Current.Application("GlobalDTAsistenciaDetalle"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTAsistenciaDetalle") = value
End Set
End Property
Property GlobalDTAsistenciasInasistencias() As DataTable
Get
GlobalDTAsistenciasInasistencias = DirectCast(HttpContext.Current.Application("GlobalDTAsistenciasInasistencias"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTAsistenciasInasistencias") = value
End Set
End Property
Property GlobalDTEstatusPersonal() As DataTable
Get
GlobalDTEstatusPersonal = DirectCast(HttpContext.Current.Application("GlobalDTEstatusPersonal"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTEstatusPersonal") = value
End Set
End Property
Property GlobalDTRHPersonal(CveEmpresa As Integer) As DataTable
Get
Dim ObjPersonal As New ClsRH
ObjPersonal.GetPersonal(-1, CveEmpresa)
GlobalDTRHPersonal = ObjPersonal.DtResultados
ObjPersonal.Dispose()
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTRHPersonal") = value
End Set
End Property
Property GlobalDTDepartamentos() As DataTable
Get
GlobalDTDepartamentos = DirectCast(HttpContext.Current.Application("GlobalDTDepartamentos"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTDepartamentos") = value
End Set
End Property
Property GlobalDTRHPuestos(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim StrSQL As String = String.Format("CveEmpresa = {0}", CveEmpresa)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTRHPuestos"), DataTable), StrSQL, "", DataViewRowState.CurrentRows)
GlobalDTRHPuestos = Dv.ToTable
Dv.Dispose()
Else
GlobalDTRHPuestos = DirectCast(HttpContext.Current.Application("GlobalDTRHPuestos"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTRHPuestos") = value
End Set
End Property
Property GlobalDTEscolaridad() As DataTable
Get
GlobalDTEscolaridad = DirectCast(HttpContext.Current.Application("GlobalDTEscolaridad"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTEscolaridad") = value
End Set
End Property
Property GlobalDTEstadoCivil() As DataTable
Get
GlobalDTEstadoCivil = DirectCast(HttpContext.Current.Application("GlobalDTEstadoCivil"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTEstadoCivil") = value
End Set
End Property
Property GlobalDTDocumentos() As DataTable
Get
GlobalDTDocumentos = DirectCast(HttpContext.Current.Application("GlobalDTDocumentos"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTDocumentos") = value
End Set
End Property
Property GlobalDTGenero() As DataTable
Get
GlobalDTGenero = DirectCast(HttpContext.Current.Application("GlobalDTGenero"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTGenero") = value
End Set
End Property
Property GlobalDTMotivoBaja() As DataTable
Get
GlobalDTMotivoBaja = DirectCast(HttpContext.Current.Application("GlobalDTMotivoBaja"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTMotivoBaja") = value
End Set
End Property
Property GlobalDTTiposContrato() As DataTable
Get
GlobalDTTiposContrato = DirectCast(HttpContext.Current.Application("GlobalDTTiposContrato"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTTiposContrato") = value
End Set
End Property
Property GlobalDTRutas() As DataTable
Get
GlobalDTRutas = DirectCast(HttpContext.Current.Application("GlobalDTRutas"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTRutas") = value
End Set
End Property
Property GlobalDTTurno() As DataTable
Get
GlobalDTTurno = DirectCast(HttpContext.Current.Application("GlobalDTTurno"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTTurno") = value
End Set
End Property
Property GlobalDTJornadas() As DataTable
Get
GlobalDTJornadas = DirectCast(HttpContext.Current.Application("GlobalDTJornadas"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTJornadas") = value
End Set
End Property
Property GlobalDTMotivosHorasExtras() As DataTable
Get
GlobalDTMotivosHorasExtras = DirectCast(HttpContext.Current.Application("GlobalDTMotivosHorasExtras"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTMotivosHorasExtras") = value
End Set
End Property
Property GlobalDTTipoBuzon() As DataTable
Get
GlobalDTTipoBuzon = DirectCast(HttpContext.Current.Application("GlobalDTTipoBuzon"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTTipoBuzon") = value
End Set
End Property
#End Region
#Region "*********** D T - C O M B U S T I B L E S ***********"
Property GlobalDTCombustibles(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim StrSQL As New StringBuilder
StrSQL.AppendFormat("CveEmpresa = {0}", CveEmpresa)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTCombustibles"), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows)
GlobalDTCombustibles = Dv.ToTable
Dv.Dispose()
Else
GlobalDTCombustibles = DirectCast(HttpContext.Current.Application("GlobalDTCombustibles"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTCombustibles") = value
End Set
End Property
Property GlobalDTCombustiblesTipos(Optional CveCombustibleTipo As Integer = -1) As DataTable
Get
If CveCombustibleTipo <> -1 Then
Dim StrSQL As New StringBuilder
If CveCombustibleTipo <> -1 Then StrSQL.AppendFormat("CveCombustibleTipo = {0}", CveCombustibleTipo)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTCombustiblesTipos"), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows)
GlobalDTCombustiblesTipos = Dv.ToTable
Dv.Dispose()
Else
GlobalDTCombustiblesTipos = DirectCast(HttpContext.Current.Application("GlobalDTCombustiblesTipos"), DataTable)
End If
End Get
Set(ByVal value As DataTable)
HttpContext.Current.Application("GlobalDTCombustiblesTipos") = value
End Set
End Property
#End Region
#Region "*********** D T - M A N T E N I M I E N T O S ***********"
Property GlobalDTMantenimientosTipos() As DataTable
Get
GlobalDTMantenimientosTipos = DirectCast(HttpContext.Current.Application("GlobalDTMantenimientosTipos"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTMantenimientosTipos") = value
End Set
End Property
Property GlobalDTMantenimientos() As DataTable
Get
GlobalDTMantenimientos = DirectCast(HttpContext.Current.Application("GlobalDTMantenimientos"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTMantenimientos") = value
End Set
End Property
Property GlobalDTMantenimientosTipos(Optional CveMantenimientoTipo As Integer = -1) As DataTable
Get
If CveMantenimientoTipo <> -1 Then
Dim StrSQL As New StringBuilder
If CveMantenimientoTipo <> -1 Then StrSQL.AppendFormat("CveMantenimientoTipo = {0}", CveMantenimientoTipo)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTMantenimientosTipos"), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows)
GlobalDTMantenimientosTipos = Dv.ToTable
Dv.Dispose()
Else
GlobalDTMantenimientosTipos = DirectCast(HttpContext.Current.Application("GlobalDTMantenimientosTipos"), DataTable)
End If
End Get
Set(ByVal value As DataTable)
HttpContext.Current.Application("GlobalDTMantenimientosTipos") = value
End Set
End Property
#End Region
#Region "*********** D T - T A L L E R E S ***********"
Property GlobalDTTalleresTipos() As DataTable
Get
GlobalDTTalleresTipos = DirectCast(HttpContext.Current.Application("GlobalDTTalleresTipos"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTTalleresTipos") = value
End Set
End Property
Property GlobalDTTalleres() As DataTable
Get
GlobalDTTalleres = DirectCast(HttpContext.Current.Application("GlobalDTTalleres"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTTalleres") = value
End Set
End Property
#End Region
#Region "*********** D T - D I S T R I B U I D O R E S ***********"
Property GlobalDTDistribuidoresTipos() As DataTable
Get
GlobalDTDistribuidoresTipos = DirectCast(HttpContext.Current.Application("GlobalDTDistribuidoresTipos"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTDistribuidoresTipos") = value
End Set
End Property
Property GlobalDTDistribuidores() As DataTable
Get
GlobalDTDistribuidores = DirectCast(HttpContext.Current.Application("GlobalDTDistribuidores"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTDistribuidores") = value
End Set
End Property
#End Region
Property GlobalDTOIRevision(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim StrSQL As String = String.Format("CveEmpresa = {0}", CveEmpresa)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTOIRevision"), DataTable), StrSQL, "", DataViewRowState.CurrentRows)
GlobalDTOIRevision = Dv.ToTable
Dv.Dispose()
Else
GlobalDTOIRevision = DirectCast(HttpContext.Current.Application("GlobalDTOIRevision"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTOIRevision") = value
End Set
End Property
Property GlobalDTOIAgendaTipo() As DataTable
Get
GlobalDTOIAgendaTipo = DirectCast(HttpContext.Current.Application("GlobalDTOIAgendaTipo"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTOIAgendaTipo") = value
End Set
End Property
Property GlobalDTOIAgenda() As DataTable
Get
GlobalDTOIAgenda = DirectCast(HttpContext.Current.Application("GlobalDTOIAgenda"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTOIAgenda") = value
End Set
End Property
Property GlobalDTVtaCondicionesEntrega(Optional CveEmpresa As Integer = -1) As DataTable
Get
If CveEmpresa <> -1 Then
Dim StrSQL As String = String.Format("CveEmpresa = {0}", CveEmpresa)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTVtaCondicionesEntrega"), DataTable), StrSQL, "", DataViewRowState.CurrentRows)
GlobalDTVtaCondicionesEntrega = Dv.ToTable
Dv.Dispose()
Else
GlobalDTVtaCondicionesEntrega = DirectCast(HttpContext.Current.Application("GlobalDTVtaCondicionesEntrega"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTVtaCondicionesEntrega") = value
End Set
End Property
Property GlobalDTPaqueteriaGuiaTipos(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim StrSQL As String = String.Format("CveEmpresa = {0}", CveEmpresa)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTPaqueteriaGuiaTipos"), DataTable), StrSQL, "", DataViewRowState.CurrentRows)
GlobalDTPaqueteriaGuiaTipos = Dv.ToTable
Dv.Dispose()
Else
GlobalDTPaqueteriaGuiaTipos = DirectCast(HttpContext.Current.Application("GlobalDTPaqueteriaGuiaTipos"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTPaqueteriaGuiaTipos") = value
End Set
End Property
Property GlobalDTClasificacionPorcentaje(CveEmpresa As Integer, Optional CveClasicacionPorcentaje As Integer = -1, Optional CveClasicacion As Integer = -1,
Optional PorcentajeIVA As Double = -1) As DataTable
Get
Dim Str As StringBuilder = New StringBuilder()
If CveEmpresa <> -1 Or CveClasicacionPorcentaje <> -1 Or CveClasicacion <> -1 Or PorcentajeIVA <> -1 Then
If CveEmpresa <> -1 Then Str.AppendFormat("CveEmpresa = {0}", CveEmpresa)
If CveClasicacionPorcentaje <> -1 Then Str.AppendFormat(" {0} CveClasicacionPorcentaje = {1}", If(Str.Length > 0, "AND", ""), CveClasicacionPorcentaje)
If CveClasicacion <> -1 Then Str.AppendFormat(" {0} CveClasicacion = {1}", If(Str.Length > 0, "AND", ""), CveClasicacion)
If PorcentajeIVA <> -1 Then Str.AppendFormat(" {0} PorcentajeIVA = {1}", If(Str.Length > 0, "AND", ""), PorcentajeIVA)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTClasificacionPorcentaje"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
GlobalDTClasificacionPorcentaje = Dv.ToTable
Dv.Dispose()
Else
GlobalDTClasificacionPorcentaje = DirectCast(HttpContext.Current.Application("GlobalDTClasificacionPorcentaje"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTClasificacionPorcentaje") = value
End Set
End Property
Property GlobalDTPaqueterias() As DataTable
Get
GlobalDTPaqueterias = DirectCast(HttpContext.Current.Application("GlobalDTPaqueterias"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTPaqueterias") = value
End Set
End Property
#End Region
End Class