From 784a90f6269e063088648ac6306fb790e4f241f9 Mon Sep 17 00:00:00 2001 From: MLopez Date: Thu, 23 Feb 2023 01:27:28 -0700 Subject: [PATCH 01/20] =?UTF-8?q?Que=20cree=20la=20carpeta=20Temp=20en=20g?= =?UTF-8?q?et=5FGlobalDTEmpresas=20Es=20necesaria=20para=20facturaci=C3=B3?= =?UTF-8?q?n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsPaginas.vb | 1 + 1 file changed, 1 insertion(+) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index e53221499..70773458b 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -781,6 +781,7 @@ Public Class ClsPaginas If Not IO.Directory.Exists(Ruta) Then IO.Directory.CreateDirectory(Ruta) If Not System.IO.Directory.Exists(String.Format("{0}\XML\", Ruta)) Then System.IO.Directory.CreateDirectory(String.Format("{0}\XML\", Ruta)) If Not System.IO.Directory.Exists(String.Format("{0}\PDF\", Ruta)) Then System.IO.Directory.CreateDirectory(String.Format("{0}\PDF\", Ruta)) + If Not System.IO.Directory.Exists(String.Format("{0}\Temp\", Ruta)) Then System.IO.Directory.CreateDirectory(String.Format("{0}\Temp\", Ruta)) Next End If End Using From 6ce3d4c87236d4a7c91aa714cf8056ce8ef8368e Mon Sep 17 00:00:00 2001 From: MLopez Date: Thu, 23 Feb 2023 01:32:38 -0700 Subject: [PATCH 02/20] =?UTF-8?q?Agregar=20selecci=C3=B3n=20de=20Folio=20G?= =?UTF-8?q?arant=C3=ADa=20para=20Funcionalidad=20531=20CAMBIOS=20EN=20BD?= =?UTF-8?q?=20VENTAS:=20+=20Nuevo=20PA:=20PA=5FAcum=5FGarantiasDetalleFoli?= =?UTF-8?q?oDisponibleGet=20(Thx=20Rene)=20PA=5FComp=5FCompra=20Add/Update?= =?UTF-8?q?:=20+=20@CveFolioGarantia=20INT=20=3D=20-1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Se valida la selección y manda Alert si no hay existencia de los productos en el Folio de Garantía, con el número de productos faltantes respectivamente --- App_Code/ClsAcumuladores.vb | 21 +++++++ App_Code/ClsCompras.vb | 12 ++-- Compras/Compras.aspx | 24 +++----- Compras/Compras.aspx.vb | 91 ++++++++++++++++++++++++++++- Inventarios/TraspasoAlmacen.aspx.vb | 6 +- 5 files changed, 127 insertions(+), 27 deletions(-) diff --git a/App_Code/ClsAcumuladores.vb b/App_Code/ClsAcumuladores.vb index 8c9eb613c..e9aa5a929 100644 --- a/App_Code/ClsAcumuladores.vb +++ b/App_Code/ClsAcumuladores.vb @@ -1246,6 +1246,27 @@ Public Class ClsAcumuladores Return Retorno End Function + Public Function GetFoliosGarantiasDetalleDisponibles(CveFolioGarantia As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + SqlDataAdapter("PA_Acum_GarantiasDetalleFolioDisponibleGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveFolioGarantia", SqlDbType.Int).Value = CveFolioGarantia + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As SqlException + OnError("Ocurrió un error al consultar los movimientos. ", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function UpdateGarantiaCancelacion(CveVenta As Integer) As Boolean Dim Retorno As Boolean = False diff --git a/App_Code/ClsCompras.vb b/App_Code/ClsCompras.vb index bf49cb75f..4073459b0 100644 --- a/App_Code/ClsCompras.vb +++ b/App_Code/ClsCompras.vb @@ -197,7 +197,7 @@ Public Class ClsCompras Optional CveOC As Integer = -1, Optional CveCajaChica As Integer = -1, Optional CvePersonal As Integer = -1, Optional NumeroReembolso As String = "-1", Optional CveProveedorSucursal As Integer = -1, Optional AplicoPromocion As Boolean = False, Optional PorcentajeIVA As Double = 0, Optional CveMetodoPago As Integer = -1, Optional CveRetIVAConcepto As Integer = -1, Optional CveConceptoContableAlmacen As Integer = -1, Optional CveRetISRConcepto As Integer = -1, Optional NoDeducible As Boolean = False, Optional CveTipoCompra As Integer = -1, Optional TotalOriginal As Double = 0, Optional CveTipoConcepto As Integer = 1, Optional CveFactura As Integer = -1, - Optional CveContrato As Integer = -1, Optional EsImportacion As Boolean = False, Optional CveSubProyecto As Integer = -1, Optional DoctosRelacionados As String = "-1") As Boolean + Optional CveContrato As Integer = -1, Optional EsImportacion As Boolean = False, Optional CveSubProyecto As Integer = -1, Optional DoctosRelacionados As String = "-1", Optional CveFolioGarantia As Integer = -1) As Boolean Dim Retorno As Boolean = False @@ -252,9 +252,7 @@ Public Class ClsCompras .Add("@EsImportacion", SqlDbType.Bit).Value = EsImportacion .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@DoctosRelacionados", SqlDbType.VarChar).Value = DoctosRelacionados - - - + .Add("@CveFolioGarantia", SqlDbType.Int).Value = CveFolioGarantia End With Try @@ -278,7 +276,8 @@ Public Class ClsCompras Public Function UpdateCompra(Descripcion As String, FolioSecundario As String, FechaVencimiento As Date, AplicaNotaCredito As Boolean, Observaciones As String, CveEstatusCompra As Integer, Descuento As Double, SubTotal As Double, IVA As Double, Total As Double, CveUsuario As Integer, CveCompra As Integer, Optional CveCajaChica As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveProveedorSucursal As Integer = -1, Optional PorcentajeIVA As Double = 0, Optional NumeroReembolso As String = "", Optional CveTipoCompra As Integer = -1, Optional NoDeducible As Boolean = False, - Optional CveFactura As Integer = -1, Optional CveContrato As Integer = -1, Optional CveRetIVAConcepto As Integer = -1, Optional CveRetISRConcepto As Integer = -1, Optional CveSubProyecto As Integer = -1) As Boolean + Optional CveFactura As Integer = -1, Optional CveContrato As Integer = -1, Optional CveRetIVAConcepto As Integer = -1, Optional CveRetISRConcepto As Integer = -1, Optional CveSubProyecto As Integer = -1, + Optional CveFolioGarantia As Integer = -1) As Boolean Dim Retorno As Boolean = False @@ -308,11 +307,10 @@ Public Class ClsCompras .Add("@NoDeducible", SqlDbType.Bit).Value = NoDeducible .Add("@CveFactura", SqlDbType.Int).Value = CveFactura .Add("@CveContrato", SqlDbType.Int).Value = CveContrato - .Add("@CveRetIVAConcepto", SqlDbType.Int).Value = CveRetIVAConcepto .Add("@CveRetISRConcepto", SqlDbType.Int).Value = CveRetISRConcepto - .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@CveFolioGarantia", SqlDbType.Int).Value = CveFolioGarantia End With Try diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index 02dc29703..d3d5c0112 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -534,6 +534,14 @@ +
+ Folio Garantía +
+ + + +
+
@@ -655,20 +663,8 @@ Unidad Clasificación - - - - - -     - - - - - -
@@ -680,8 +676,6 @@   - -
@@ -1238,7 +1232,7 @@ - + diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 32c2f3541..642b778e6 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -12,6 +12,7 @@ Imports Extensiones Imports System.Activities.Expressions Imports iText.Barcodes.Dmcode Imports Microsoft.Reporting.WebForms +Imports MoreLinq Partial Class Compras_Compras Inherits ClsPaginas @@ -1246,6 +1247,16 @@ Partial Class Compras_Compras If UsuarioActual.Empresa.Funcionalidad(303) <> "" Then btnProrateo2.Visible = True End If + + If UsuarioActual.Empresa.Funcionalidad(531).ToEntero = 1 Then 'cuando es emp acumuladora AndAlso DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") + divFolioGarantia.Visible = True + Using objAcum As New ClsAcumuladores + If objAcum.FoliosGarantiaGet(-1, UsuarioActual.Empresa.CveEmpresa, Estatus:=-1, TipoFolio:="-1", Area:=-1, CveSubProyecto:=-1) Then + DdlFolioGarantia.DataSource = objAcum.DtResultados.FiltraParametros("", "FechaIng DESC") + DdlFolioGarantia.DataBind() + End If + End Using + End If '**************************************************************** 'If UsuarioActual.CveEmpresa = 72 Then ' LiRecepcion.Visible = True @@ -4643,6 +4654,9 @@ Partial Class Compras_Compras Exit Sub End If + If DdlFolioGarantia.Visible AndAlso DdlFolioGarantia.SelectedValue <> "-1" Then + If Not ValidaFolioGarantia() Then Exit Sub + End If '------------------TERMINA VALIDACIONES------------------ @@ -4927,7 +4941,7 @@ Partial Class Compras_Compras CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, IdPoliza, CveCajaChica:=CveCajaChica, CvePersonal:=CvePersonal, NumeroReembolso:=NumeroReembolso, CveProveedorSucursal:=DdlProveedorSucursal.SelectedValue.ToEntero, AplicoPromocion:=ChkOCPromocion.Checked, PorcentajeIVA:=PorcentajeIVA, CveMetodoPago:=CveMetodoPago, CveRetIVAConcepto:=If(DdlRetIVAConcepto.Items.Count > 0, DdlRetIVAConcepto.SelectedValue.ToEntero, -1), CveConceptoContableAlmacen:=CveConceptoContableAlmacen, CveRetISRConcepto:=If(DdlRetISRConcepto.Items.Count > 0, DdlRetISRConcepto.SelectedValue.ToEntero, -1), NoDeducible:=EsNoDeducible, CveTipoCompra:=DdlTipoCompra.SelectedValue.ToEntero, TotalOriginal:=TotalOriginal, CveTipoConcepto:=CveTipoConcepto, - EsImportacion:=EsImportacion, CveFactura:=CveFactura, CveSubProyecto:=CveSubProyectoPrincipal, DoctosRelacionados:=DoctosRelacionados) Then + EsImportacion:=EsImportacion, CveFactura:=CveFactura, CveSubProyecto:=CveSubProyectoPrincipal, DoctosRelacionados:=DoctosRelacionados, CveFolioGarantia:=DdlFolioGarantia.SelectedValue.ToEntero) Then ViewState("CveCompra") = ObjCompras.CveCompra If ObjCompras.DtResultados.Rows.Count > 0 Then ViewState("CompraFolio") = ObjCompras.DtResultados.Rows(0)("vFolio").ToString @@ -8899,6 +8913,9 @@ Partial Class Compras_Compras Alert("Falta asignar Proyecto a la compra", TipoMensaje.MsgAdvertencia) End If + If DdlFolioGarantia.Visible AndAlso DdlFolioGarantia.SelectedValue <> "-1" Then + If Not ValidaFolioGarantia() Then Exit Sub + End If If CveFactura > 0 Then If Not AjustaCombustibles() Then @@ -8982,7 +8999,7 @@ Partial Class Compras_Compras If ObjCompra.UpdateCompra(TxtDescripcion.Text.Trim, TxtFolioSecundario.Text.Trim, TxtFechaPago.Text.ToDate, ChkAplicaNotaCredito.Checked, TxtObsFact.Text.Trim, CveEstatusFactura, TxtDescuento.Text.ToDouble, TxtSubTotal.Text.ToDouble, TxtIVA.Text.ToDouble, TxtTotal.Text.ToDouble, UsuarioActual.CveUsuario, CveCompra, CveCajaChica:=DdlRembolsoCajaChica.SelectedValue.ToEntero, CvePersonal:=DdlRembolsoPersonal.SelectedValue.ToEntero, CveProveedorSucursal:=If(DdlProveedorSucursal.SelectedValue.ToEntero > 0, DdlProveedorSucursal.SelectedValue.ToEntero, -1), PorcentajeIVA:=PorcentajeIVA, NumeroReembolso:=TxtRembolsoNumero.Text, - CveTipoCompra:=DdlTipoCompra.SelectedValue.ToEntero, NoDeducible:=EsNoDeducible, CveRetIVAConcepto:=TmpCveRetIVAConcepto, CveRetISRConcepto:=TmpCveRetISRConcepto, CveSubProyecto:=CveSubProyectoPrincipal) Then + CveTipoCompra:=DdlTipoCompra.SelectedValue.ToEntero, NoDeducible:=EsNoDeducible, CveRetIVAConcepto:=TmpCveRetIVAConcepto, CveRetISRConcepto:=TmpCveRetISRConcepto, CveSubProyecto:=CveSubProyectoPrincipal, CveFolioGarantia:=DdlFolioGarantia.SelectedValue.ToEntero) Then If Not ComparaDatatables() Then @@ -19981,7 +19998,77 @@ Partial Class Compras_Compras #End Region +#Region "GARANTÍAS" + Protected Sub DdlFolioGarantia_SelectedIndexChanged(sender As Object, e As EventArgs) + If DdlFolioGarantia.SelectedValue.ToEntero <> -1 Then + ValidaFolioGarantia(True) + End If + + End Sub + + Private Function ValidaFolioGarantia(Optional MsgExito As Boolean = False) As Boolean + If TmpDT?.Rows.Count > 0 Then + Dim ExistenciasPSFactura As New Dictionary(Of Integer, Decimal) + Dim ExistenciasPSGarantia As New Dictionary(Of Integer, Decimal) + Dim PSFaltantes As New Dictionary(Of Integer, Decimal) + Dim DtGarantia As New DataTable + + 'Agrupa los CvePS iguales y suma sus cantidades + For Each row In TmpDT.AsEnumerable() + Dim cvePS As Integer = row.Field(Of Integer)("CvePS") + Dim cantidad As Decimal = row.Field(Of Decimal)("Cantidad") + If ExistenciasPSFactura.ContainsKey(cvePS) Then + ExistenciasPSFactura(cvePS) += cantidad + Else + ExistenciasPSFactura.Add(cvePS, cantidad) + End If + Next + + Using ObjAcum As New ClsAcumuladores + If ObjAcum.GetFoliosGarantiasDetalleDisponibles(DdlFolioGarantia.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa) Then + DtGarantia = ObjAcum.DtResultados + ExistenciasPSGarantia = DtGarantia.AsEnumerable().ToDictionary(Function(row) row.Field(Of Integer)("CvePS"), Function(row) row.Field(Of Decimal)("CantidadDisponible")) + Else + Alert($"Ocurrió un error al obtener la información de la garantía.
CveUsuario={UsuarioActual.CveUsuario}
CveFolioGarantia={DdlFolioGarantia.SelectedValue}", TipoMensaje.MsgError) + Return False + End If + End Using + + For Each Producto In ExistenciasPSFactura + Dim cvePS As Integer = Producto.Key + Dim cantidadFactura As Decimal = Producto.Value + If ExistenciasPSGarantia.ContainsKey(cvePS) Then + Dim cantidadGarantia As Decimal = ExistenciasPSGarantia(cvePS) + If cantidadFactura > cantidadGarantia Then + PSFaltantes.Add(cvePS, cantidadFactura - cantidadGarantia) + End If + Else + PSFaltantes.Add(cvePS, cantidadFactura) + End If + Next + + Dim IEnumPSFaltantes = From row In TmpDT.AsEnumerable() + Join Producto In PSFaltantes On row.Field(Of Integer)("CvePS") Equals Producto.Key + Select New With {.CvePS = Producto.Key, .NombrePS = row.Field(Of String)("PS"), .CantidadFaltante = Producto.Value} + + If PSFaltantes.Count > 0 Then + Dim mensaje As String = "Los siguientes productos no tienen suficientes existencias en la garantía seleccionada:

" + For Each Producto In IEnumPSFaltantes + mensaje += $"Falta: × {Producto.CantidadFaltante:0.##} {Producto.NombrePS}
" + Next + If MsgExito Then Alert(mensaje, TipoMensaje.MsgAdvertencia) Else Alert(mensaje, TipoMensaje.MsgError) + Else + If MsgExito Then Alert("Todos los productos seleccionados están disponibles en el Folio de Garantía.") + Return True + End If + Else + Alert("Agregue todos los productos a la factura antes de fijar el Folio de Garantía.", TipoMensaje.MsgAdvertencia) + DdlFolioGarantia.SelectedValue = "-1" + End If + Return False + End Function +#End Region Protected Sub BtnFacturaNC_Click(sender As Object, e As EventArgs) If ChkNCInvNC.Checked Then CargaNCINV(ShowAllPendientes:=False) diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb index 39c126845..4c5cdf47e 100644 --- a/Inventarios/TraspasoAlmacen.aspx.vb +++ b/Inventarios/TraspasoAlmacen.aspx.vb @@ -1006,7 +1006,7 @@ Partial Class Inventarios_TraspasoAlmacen Dim CveConceptoEntrada As Integer = 27 If Not ChkTransitorio.Checked Then CveConceptoEntrada = 27 Else CveConceptoEntrada = 9 - Dim CveFolioGarantia As Integer = Request.QueryString("CveFolioGarantia").ToEntero + Dim CveFolioGarantia As Integer = IfNull(Request("CveFolioGarantia"), -1).ToString.ToEntero 'AGREGAMOS LA SALIDA DEL ALMACEN ORIGEN CveMovimientoSalida = ObjInventario.AddMovimiento(DdlAlmacenOrigen.SelectedValue.ToEntero, TipoMovimientoSalida, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, @@ -1014,7 +1014,7 @@ Partial Class Inventarios_TraspasoAlmacen CveAlmacenDestino:=DdlAlmacenDestino.SelectedValue.ToEntero, GastoIndirecto:=If(ChkTransitorio.Checked And TxtGastoIndirecto.Text.ToDouble > 0, TxtGastoIndirecto.Text, "-1").ToDouble, CveChofer:=If(ChkTransitorio.Checked, DdlChofer.SelectedValue.ToEntero, -1), Placa:="", FechaEntrega:=If(ChkTransitorio.Checked, TxtFechaEntrega.Text.Trim.ToDateTime.ToString("dd/MM/yyyy"), "-1"), EspecifUnidad:="", ResponsableCarga:="", ResponsableRecibio:="", Identificacion:="", Domicilio:="", - Telefono:="", Ciudad:="", Licencia:="", Modulo:="TA/G2", CveFolioGarantia:=If(CveFolioGarantia > 0, CveFolioGarantia, -1)) + Telefono:="", Ciudad:="", Licencia:="", Modulo:="TA/G2", CveFolioGarantia:=CveFolioGarantia) FolioSalida = ObjInventario.Folio Folio = ObjInventario.Folio If CveMovimientoSalida <= 0 Then @@ -1035,7 +1035,7 @@ Partial Class Inventarios_TraspasoAlmacen 'ENTRADA CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacenEntrada, CveConceptoEntrada, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Recibio:=If(ChkTransitorio.Checked, TxtResponsable.Text.Trim, "-1"), - CveAlmacenDestino:=If(ChkTransitorio.Checked, DdlAlmacenDestino.SelectedValue.ToEntero, -1), CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="TA/G3", CveFolioGarantia:=If(CveFolioGarantia > 0, CveFolioGarantia, -1)) + CveAlmacenDestino:=If(ChkTransitorio.Checked, DdlAlmacenDestino.SelectedValue.ToEntero, -1), CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="TA/G3", CveFolioGarantia:=CveFolioGarantia) FolioEntrada = ObjInventario.Folio If CveMovimientoEntrada <= 0 Then TextoError = "Ocurrió un error al generar el movimiento de entrada" From 6295258123a7f60a140f9d8aa039c404c75333da Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 23 Feb 2023 07:03:07 -0700 Subject: [PATCH 03/20] =?UTF-8?q?-correcci=C3=B3n=20de=20par=C3=A1metro?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ashx/SIGFacturacionCiclica.ashx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ashx/SIGFacturacionCiclica.ashx b/Ashx/SIGFacturacionCiclica.ashx index 05e98d2ff..26ea50579 100644 --- a/Ashx/SIGFacturacionCiclica.ashx +++ b/Ashx/SIGFacturacionCiclica.ashx @@ -343,7 +343,7 @@ Public Class SIGFacturacionCiclica : Implements IHttpHandler, IRequiresSessionSt Dim DtDetalle As DataTable = Nothing Dim objContratos As New ClsContratos - If objContratos.GetContratosDetalle(DR("CveContrato").ToString.ToEntero, UsuarioActual.CveUsuario) Then + If objContratos.GetContratosDetalle(DR("CveContrato").ToString.ToEntero, UsuarioActual.CveEmpresa) Then DtDetalle = objContratos.DtResultados.FiltraParametros("CveTipoPresupuesto=2") Else DtDetalle = Nothing From 3182dac4b4ef8828231a19c8b59d0aa2c5004cbe Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 23 Feb 2023 07:03:24 -0700 Subject: [PATCH 04/20] -carga de subproyectos --- Contabilidad2/RepBalanzaComprobacion.aspx.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Contabilidad2/RepBalanzaComprobacion.aspx.vb b/Contabilidad2/RepBalanzaComprobacion.aspx.vb index d21e100cb..cf275bff4 100644 --- a/Contabilidad2/RepBalanzaComprobacion.aspx.vb +++ b/Contabilidad2/RepBalanzaComprobacion.aspx.vb @@ -97,8 +97,8 @@ Partial Class Contabilidad2_RepBalanzaComprobacion End If 'End If End If - 'DdlSubproyecto.DataSource = GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa, -1) - 'DdlSubproyecto.DataBind() + DdlSubproyecto.DataSource = GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa, -1) + DdlSubproyecto.DataBind() If Not ErrorParametros Then CargaDatos() From a98229aa3b1f5625e26173dd3d0c9c524bea942a Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 23 Feb 2023 07:03:41 -0700 Subject: [PATCH 05/20] =?UTF-8?q?-correcci=C3=B3n=20de=20par=C3=A1metro?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Contabilidad/ContabilidadElectronica.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Contabilidad/ContabilidadElectronica.aspx.vb b/Contabilidad/ContabilidadElectronica.aspx.vb index a33545fc8..a7ea5854d 100644 --- a/Contabilidad/ContabilidadElectronica.aspx.vb +++ b/Contabilidad/ContabilidadElectronica.aspx.vb @@ -185,7 +185,7 @@ Partial Class Contabilidad_ContabilidadElectronica Dim DtCuentas As New DataTable If UsuarioActual.Empresa.TipoContabilidad = 1 Then Dim objconta As New ClsContabilidad - If objconta.GetBalanzaComprobacion(FechaI, FechaF, 1, -1, "-1", UsuarioActual.CveEmpresa, 0) Then + If objconta.GetBalanzaComprobacion(FechaI, FechaF, 1, -1, -1, -1, UsuarioActual.CveEmpresa, 0) Then DtCuentas = objconta.DtResultados End If objconta.Dispose() From d16152824f2130d15c64107c2514cdacc106b94b Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 23 Feb 2023 07:04:17 -0700 Subject: [PATCH 06/20] =?UTF-8?q?-=20visualizaci=C3=B3n=20de=20proyecto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RepEstadoResultadosHorizontal.aspx | 19 ++++++------------- .../RepEstadoResultadosHorizontal.aspx.vb | 2 +- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/Contabilidad2/RepEstadoResultadosHorizontal.aspx b/Contabilidad2/RepEstadoResultadosHorizontal.aspx index 2062aebd0..d93005148 100644 --- a/Contabilidad2/RepEstadoResultadosHorizontal.aspx +++ b/Contabilidad2/RepEstadoResultadosHorizontal.aspx @@ -101,24 +101,17 @@ - - -
- Proyecto: -
-
- - + + Proyecto: +
+
SubProyecto:
-
- -
- - + + diff --git a/Contabilidad2/RepEstadoResultadosHorizontal.aspx.vb b/Contabilidad2/RepEstadoResultadosHorizontal.aspx.vb index fc4e90480..1006ffb04 100644 --- a/Contabilidad2/RepEstadoResultadosHorizontal.aspx.vb +++ b/Contabilidad2/RepEstadoResultadosHorizontal.aspx.vb @@ -350,7 +350,7 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal CargaEjercicios() - CargarCentrosDeCosto(DdlProyecto, DdlSubproyecto, LblProyecto, LblSubProyecto) + CargarCentrosDeCosto(DdlProyecto, DdlSubproyecto, LblProyecto, LblSubProyecto, divProyecto:=DivProyecto) TabSubProyecto.HeaderText = LblProyecto.Text & " " & LblSubProyecto.Text & " " From 96d540b73f6ae0219f3d04a9e5c0e217b4f86487 Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 23 Feb 2023 07:06:46 -0700 Subject: [PATCH 07/20] =?UTF-8?q?-=20parmetro=20empresa=20en=20actualizaci?= =?UTF-8?q?=C3=B3n=20de=20cuenta?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsGenerales.vb | 2 +- RH/Personal.aspx.vb | 27 ++++++++++----------------- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index d24033dfe..4212d5715 100644 --- a/App_Code/ClsGenerales.vb +++ b/App_Code/ClsGenerales.vb @@ -1653,7 +1653,7 @@ Public Class ClsGenerales Return Retorno End Function - Public Function UpdateCuentasDepositosPersonal(CveCuentaDeposito As Integer, BancoNombre As String, Cuenta As String, CLABE As String, CveMoneda As Integer, CveUsuarioModifico As Integer, EstatusPagoElectronico As Boolean, Estatus As Boolean, CveSATBanco As Integer) As Boolean + Public Function UpdateCuentasDepositosPersonal(CveCuentaDeposito As Integer, BancoNombre As String, Cuenta As String, CLABE As String, CveMoneda As Integer, CveUsuarioModifico As Integer, EstatusPagoElectronico As Boolean, Estatus As Boolean, CveSATBanco As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Gral_CuentasDepositosPersonalUpdate") diff --git a/RH/Personal.aspx.vb b/RH/Personal.aspx.vb index 3825b4499..5e406b45c 100644 --- a/RH/Personal.aspx.vb +++ b/RH/Personal.aspx.vb @@ -2014,11 +2014,11 @@ Partial Class RH_Personal Next End If - If ObjPersonal.GetPersonal(-1, UsuarioActual.CveEmpresa) Then - GlobalDTGralColectivas(-1) = ObjPersonal.DtResultados - Else - TieneError = True - End If + 'If ObjPersonal.GetPersonal(-1, UsuarioActual.CveEmpresa) Then + ' GlobalDTGralColectivas(-1) = ObjPersonal.DtResultados + 'Else + ' TieneError = True + 'End If Mensaje = "El Personal se guardó correctamente." Accion = If(Request("CveFactura") Is Nothing, "document.location.href=""/RH/CatPersonal.aspx""", "window.opener.location.href = window.opener.location.href; window.close();") @@ -2055,7 +2055,7 @@ Partial Class RH_Personal CveTipodeSalario:=DDlTipoSalario.SelectedValue.ToEntero(), Sindicalizado:=If(ChkSindicalizado.Checked, 1, 0), Pensionado:=ChkPensionado.Checked, CvePais:=DdlPais.SelectedValue.ToEntero(), CveRegistroPatronal:=DdlRegistroPatronal.SelectedValue.ToEntero(), CveEmpresaAsignado:=DdlEmpresaAsignada.SelectedValue.ToEntero(), EsReserva:=If(chkEsReserva.Checked, 1, 0), Fiscalizable:=If(chkNoFiscalizar.Checked, 0, 1), CveTipoTrabajador:=DdlTipoTrabajador.SelectedValue.ToEntero()) Then - 'Funsion usa RH Familiares + 'Funcion usa RH Familiares If UsuarioActual.Empresa.Funcionalidad(568) = "1" Then ProcesaDTFamiliares(ObjPersonal) End If @@ -2093,12 +2093,6 @@ Partial Class RH_Personal End If - - - - - - If TieneError Then ObjPersonal.RollBack() Alert("Ocurrio un error guardar el Personal. Por favor vuelva a intentar.", TipoMensaje.ToastAdventencia) @@ -2106,14 +2100,12 @@ Partial Class RH_Personal ObjPersonal.Commit() Alert(Mensaje, TipoMensaje.MsgInformacion, Accion) - - - CargaEstatusPersonal(DdlEstatusPersonal.SelectedValue.ToEntero()) 'If File.Exists(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & ObjPersonal.URL) Then ' ImgPersonal.ImageUrl = "/Empresas/" & UsuarioActual.CveEmpresa & "/RH/Personal/" & ObjPersonal.URL 'End If GlobalDTRHPersonal(UsuarioActual.CveEmpresa) = Nothing + GlobalDTCuentasDepositosPersonales(UsuarioActual.CveEmpresa) = Nothing If CvePersonal > 0 Then Dim strquery As String = String.Format("UPDATE RH_Personal SET CveEstadoDomicilio = {2},CiudadOrigen ='{3}' WHERE CvePersonal ={1} AND CveEmpresa = {0} ", @@ -3269,7 +3261,8 @@ Partial Class RH_Personal Protected Sub LbActualizarCuentaBanco_Click(sender As Object, e As EventArgs) Using ObjCuentasBancos As New ClsGenerales Dim nombrebanco As String = DdlBancoSat.SelectedItem.Text - If ObjCuentasBancos.UpdateCuentasDepositosPersonal(CveCuentaDeposito, nombrebanco, TxtNumeroCuenta.Text, TxtCLABECB.Text, DdlMoneda.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, ChkEstatusPagoE.Checked, ChkEstatuscuenta.Checked, DdlBancoSat.SelectedValue.ToEntero()) Then + + If ObjCuentasBancos.UpdateCuentasDepositosPersonal(CveCuentaDeposito, nombrebanco, TxtNumeroCuenta.Text, TxtCLABECB.Text, DdlMoneda.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, ChkEstatusPagoE.Checked, ChkEstatuscuenta.Checked, DdlBancoSat.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa) Then 'UpdateCuentasDepositosPersonal(CveCuentaDeposito As Integer, BancoNombre As String, Cuenta As String, CLABE As String, CveMoneda As Integer, CveUsuarioModifico As Integer, EstatusPagoElectronico As Boolean, Estatus As Boolean, CveSATBanco As Integer) As Boolean Alert("Cuenta actualizada") End If @@ -3397,7 +3390,7 @@ Partial Class RH_Personal DTCuentasBancos = New DataTable TempDTCuentasBancos = New DataTable - If ObjCuentasBancos.GetCuentasDepositos(CvePersonal:=CvePersonal) Then + If ObjCuentasBancos.GetCuentasDepositos(CvePersonal:=CvePersonal, CveEmpresa:=UsuarioActual.CveEmpresa) Then DTCuentasBancos.Merge(ObjCuentasBancos.DtResultados) Else Alert("No se pudieron cargar las cuentas bancarias. Por favor intente nuevamente.", TipoMensaje.MsgError) From b540722f2f02dbec6ab13170f70ed5715b02a528 Mon Sep 17 00:00:00 2001 From: MLopez Date: Thu, 23 Feb 2023 20:59:06 -0700 Subject: [PATCH 08/20] =?UTF-8?q?Mega=20limpieza=20masiva=20GlobalDTs=20+?= =?UTF-8?q?=20de=2030=20globalDTs=20se=20movi=C3=B3=20la=20carga=20a=20Cls?= =?UTF-8?q?Paginas=20+=20se=20segmentaron=20todos=20los=20GlobalDTs=20que?= =?UTF-8?q?=20siempre=20hac=C3=ADan=20un=20DataView,=20a=20segmentar=20las?= =?UTF-8?q?=20tablas=20por=20empresa=20individual?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CAMBIOS EN BD (YA EN VENTAS) + @CveEmpresa INT ... a la mayoría de PAs que fueron comentados en Global.asax (aprox 17) PA_Pros_ProspectosApoyosGet PA_Pros_ProspectosClasificacionGet PA_Pros_ProspectosApoyosTiposGet PA_Pros_ProspectosTiposGet PA_Pros_ProspectosSolicitudesGet PA_Pros_ProspectosSolicitudesEstatusGet PA_Pros_ProspectosSolicitudesTiposGet PA_Pros_EncuestasRespuestasGet PA_AC_FuentesRecaudacionGet PA_AC_UnidadesAdministrativasGet PA_AC_ClasificacionFuncionalGet PA_AC_ClasificacionGeograficaGet PA_AC_FuentesFinanciamientoGet PA_AC_ClasificacionAdministrativaGet PA_AC_ProgramaOperativoGet PA_AC_PD_EjeRectorGet PA_Flo_CombustiblesGet --- AC/CatClasificacionAdministrativa.aspx.vb | 10 +- AC/CatClasificacionFuncional.aspx.vb | 10 +- AC/CatClasificacionGeografica.aspx.vb | 10 +- AC/CatFuentesFinanciamiento.aspx.vb | 10 +- AC/CatFuentesRecaudacion.aspx.vb | 10 +- AC/CatUnidadesAdministrativas.aspx.vb | 10 +- App_Code/ClsAC.vb | 41 +- App_Code/ClsFlotillas.vb | 7 +- App_Code/ClsPaginas.vb | 779 ++++++++++-------- App_Code/ClsProspectos.vb | 35 +- Global.asax | 99 ++- .../CatClasificacionesCaracteristicas.aspx.vb | 21 +- 12 files changed, 563 insertions(+), 479 deletions(-) diff --git a/AC/CatClasificacionAdministrativa.aspx.vb b/AC/CatClasificacionAdministrativa.aspx.vb index d59b43943..2e7ad3f49 100644 --- a/AC/CatClasificacionAdministrativa.aspx.vb +++ b/AC/CatClasificacionAdministrativa.aspx.vb @@ -17,15 +17,7 @@ Partial Class AC_CatClasificacionAdministrativa End Sub Public Sub CargaDatos() - Dim ObjClasificacionAdministrativa As New ClsAC - If ObjClasificacionAdministrativa.GetClasificacionAdministrativa() Then - ViewState("DTClasificacionAdministrativas") = ObjClasificacionAdministrativa.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTAC_ClasificacionAdministrativa(UsuarioActual.CveEmpresa) = ObjClasificacionAdministrativa.DtResultados - Else - Me.GvDatos.DataSource = Nothing - End If - - ObjClasificacionAdministrativa.Dispose() + ViewState("DTClasificacionAdministrativas") = GlobalDTAC_ClasificacionAdministrativa(UsuarioActual.CveEmpresa) If ViewState("Orden").ToString() <> String.Empty Then CargaGrid(ViewState("Orden").ToString()) diff --git a/AC/CatClasificacionFuncional.aspx.vb b/AC/CatClasificacionFuncional.aspx.vb index 109a265fb..4261995b2 100644 --- a/AC/CatClasificacionFuncional.aspx.vb +++ b/AC/CatClasificacionFuncional.aspx.vb @@ -52,15 +52,7 @@ Partial Class AC_CatClasificacionFuncional End Sub Public Sub CargaDatos() - Dim ObjClasificacionFuncional As New ClsAC - If ObjClasificacionFuncional.GetClasificacionFuncional() Then - ViewState("DTClasificacionFuncional") = ObjClasificacionFuncional.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTAC_ClasificacionFuncional(UsuarioActual.CveEmpresa) = ObjClasificacionFuncional.DtResultados - Else - Me.GvDatos.DataSource = Nothing - End If - - ObjClasificacionFuncional.Dispose() + ViewState("DTClasificacionFuncional") = GlobalDTAC_ClasificacionFuncional(UsuarioActual.CveEmpresa) If ViewState("Orden").ToString() <> String.Empty Then CargaGrid(ViewState("Orden").ToString()) diff --git a/AC/CatClasificacionGeografica.aspx.vb b/AC/CatClasificacionGeografica.aspx.vb index 2b871ee67..f9a5434c9 100644 --- a/AC/CatClasificacionGeografica.aspx.vb +++ b/AC/CatClasificacionGeografica.aspx.vb @@ -56,15 +56,7 @@ Partial Class AC_CatClasificacionGeografica End Sub Public Sub CargaDatos() - Dim ObjClasificacionGeografica As New ClsAC - If ObjClasificacionGeografica.GetClasificacionGeografica() Then - ViewState("DTClasificacionGeografica") = ObjClasificacionGeografica.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTAC_ClasificacionGeografica(UsuarioActual.CveEmpresa) = ObjClasificacionGeografica.DtResultados - Else - Me.GvDatos.DataSource = Nothing - End If - - ObjClasificacionGeografica.Dispose() + ViewState("DTClasificacionGeografica") = GlobalDTAC_ClasificacionGeografica(UsuarioActual.CveEmpresa) If ViewState("Orden").ToString() <> String.Empty Then CargaGrid(ViewState("Orden").ToString()) diff --git a/AC/CatFuentesFinanciamiento.aspx.vb b/AC/CatFuentesFinanciamiento.aspx.vb index 89ad47690..c28547b0b 100644 --- a/AC/CatFuentesFinanciamiento.aspx.vb +++ b/AC/CatFuentesFinanciamiento.aspx.vb @@ -47,15 +47,7 @@ Partial Class AC_CatFuentesFinanciamiento End Sub Public Sub CargaDatos() - Dim ObjFuentesFinanciamiento As New ClsAC - If ObjFuentesFinanciamiento.GetFuentesFinanciamiento() Then - ViewState("DTFuentesFinanciamiento") = ObjFuentesFinanciamiento.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTAC_FuentesFinanciamiento(-1) = ObjFuentesFinanciamiento.DtResultados - Else - Me.GvDatos.DataSource = Nothing - End If - - ObjFuentesFinanciamiento.Dispose() + ViewState("DTFuentesFinanciamiento") = GlobalDTAC_FuentesFinanciamiento(UsuarioActual.CveEmpresa) If ViewState("Orden").ToString() <> String.Empty Then CargaGrid(ViewState("Orden").ToString()) diff --git a/AC/CatFuentesRecaudacion.aspx.vb b/AC/CatFuentesRecaudacion.aspx.vb index 349f696f1..41d7a1105 100644 --- a/AC/CatFuentesRecaudacion.aspx.vb +++ b/AC/CatFuentesRecaudacion.aspx.vb @@ -48,15 +48,7 @@ Partial Class AC_CatFuentesRecaudacion End Sub Public Sub CargaDatos() - Dim ObjFuenteRecaudacion As New ClsAC - If ObjFuenteRecaudacion.GetFuentesRecaudacion() Then - ViewState("DTFuenteRecaudacion") = ObjFuenteRecaudacion.DtResultados.FiltraParametros(String.Format("CveEmpresa={0}", UsuarioActual.CveEmpresa)) - GlobalDTAC_FuentesRecaudacion(-1) = ObjFuenteRecaudacion.DtResultados - Else - Me.GvDatos.DataSource = Nothing - End If - - ObjFuenteRecaudacion.Dispose() + ViewState("DTFuenteRecaudacion") = GlobalDTAC_FuentesRecaudacion(UsuarioActual.CveEmpresa) If ViewState("Orden").ToString() <> String.Empty Then CargaGrid(ViewState("Orden").ToString()) diff --git a/AC/CatUnidadesAdministrativas.aspx.vb b/AC/CatUnidadesAdministrativas.aspx.vb index 1ac5a94dc..ce7080619 100644 --- a/AC/CatUnidadesAdministrativas.aspx.vb +++ b/AC/CatUnidadesAdministrativas.aspx.vb @@ -26,15 +26,7 @@ Partial Class AC_CatUnidadesAdministrativas End Sub Public Sub CargaDatos() - Dim ObjUnidadAdministrativas As New ClsAC - If ObjUnidadAdministrativas.GetUnidadesAdministrativas() Then - ViewState("DTUnidadAdministrativas") = ObjUnidadAdministrativas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTAC_UnidadesAdministrativas(-1) = ObjUnidadAdministrativas.DtResultados - Else - Me.GvDatos.DataSource = Nothing - End If - - ObjUnidadAdministrativas.Dispose() + ViewState("DTUnidadAdministrativas") = GlobalDTAC_UnidadesAdministrativas(UsuarioActual.CveEmpresa) If ViewState("Orden").ToString() <> String.Empty Then CargaGrid(ViewState("Orden").ToString()) diff --git a/App_Code/ClsAC.vb b/App_Code/ClsAC.vb index 070c21364..7cfe17261 100644 --- a/App_Code/ClsAC.vb +++ b/App_Code/ClsAC.vb @@ -160,10 +160,12 @@ Public Class ClsAC Return Retorno End Function - Public Function GetProgramaOperativo() As Boolean + Public Function GetProgramaOperativo(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_AC_ProgramaOperativoGet") - + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True @@ -1033,9 +1035,12 @@ Public Class ClsAC #End Region #Region "AC_UnidadesAdministrativas" - Public Function GetUnidadesAdministrativas() As Boolean + Public Function GetUnidadesAdministrativas(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_AC_UnidadesAdministrativasGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True @@ -1127,9 +1132,12 @@ Public Class ClsAC #End Region #Region "AC_ClasificacionGeografica" - Public Function GetClasificacionGeografica() As Boolean + Public Function GetClasificacionGeografica(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_AC_ClasificacionGeograficaGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True @@ -1761,9 +1769,12 @@ Public Class ClsAC #End Region #Region "AC_ClasificacionFuncional" - Public Function GetClasificacionFuncional() As Boolean + Public Function GetClasificacionFuncional(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_AC_ClasificacionFuncionalGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True @@ -1852,9 +1863,12 @@ Public Class ClsAC #End Region #Region "AC_FuentesFinanciamiento" - Public Function GetFuentesFinanciamiento() As Boolean + Public Function GetFuentesFinanciamiento(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_AC_FuentesFinanciamientoGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True @@ -2223,9 +2237,12 @@ Public Class ClsAC #End Region #Region "AC_ClasificacionAdministrativa" - Public Function GetClasificacionAdministrativa() As Boolean + Public Function GetClasificacionAdministrativa(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_AC_ClasificacionAdministrativaGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True @@ -2315,9 +2332,12 @@ Public Class ClsAC #End Region #Region "AC_PD_EjeRector" - Public Function GetPD_EjeRector() As Boolean + Public Function GetPD_EjeRector(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_AC_PD_EjeRectorGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True @@ -2787,9 +2807,12 @@ Public Class ClsAC #End Region #Region "AC_FuentesRecaudacion" - Public Function GetFuentesRecaudacion() As Boolean + Public Function GetFuentesRecaudacion(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_AC_FuentesRecaudacionGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True diff --git a/App_Code/ClsFlotillas.vb b/App_Code/ClsFlotillas.vb index 10ea41055..569737e73 100644 --- a/App_Code/ClsFlotillas.vb +++ b/App_Code/ClsFlotillas.vb @@ -142,11 +142,12 @@ Public Class ClsFlotillas #Region " C O M B U S T I B L E S " - Public Function GetCombustibles() As Boolean + Public Function GetCombustibles(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Flo_CombustiblesGet") - - + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 70773458b..e3e2a1b5b 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -767,7 +767,7 @@ Public Class ClsPaginas Application("GlobalDTNomSatTipoIncapacidad") = value End Set End Property - 'Este GlobalDT no estoy seguro si se deba segmentar por empresa, se usa mucho en todos lados + 'Este GlobalDT no debe segmentarse por empresas, puesto que es para todas las empresas Public Shared Property GlobalDTEmpresas(Optional CveEmpresa As Integer = -1) As DataTable Get Dim AppNombre As String = "GlobalDTEmpresas" @@ -852,7 +852,7 @@ Public Class ClsPaginas Dim AppNombre As String = $"GlobalDTClasificaciones-{CveEmpresa}" If HttpContext.Current.Application(AppNombre) Is Nothing Then Dim ObjClasificaciones As New ClsClasificaciones - If ObjClasificaciones.GetClasificaciones(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjClasificaciones.DtResultados + If ObjClasificaciones.GetClasificaciones(CveEmpresa:=CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjClasificaciones.DtResultados ObjClasificaciones.Dispose() End If Dim filtros As New List(Of String) @@ -888,26 +888,26 @@ Public Class ClsPaginas Application(AppNombre) = value End Set End Property - Property GlobalDTClasificaciones2(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1) As DataTable + Public Shared Property GlobalDTClasificaciones2(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1) As DataTable Get Dim AppNombre As String = $"GlobalDTClasificaciones2-{CveEmpresa}" 'sino existe, recarga los datos - If Application(AppNombre) Is Nothing Then + If HttpContext.Current.Application(AppNombre) Is Nothing Then Dim ObjClasificaciones As New ClsClasificaciones - If ObjClasificaciones.GetClasificaciones(CveEmpresa, Tipo:=4) Then Application(AppNombre) = ObjClasificaciones.DtResultados + If ObjClasificaciones.GetClasificaciones(CveEmpresa:=CveEmpresa, Tipo:=4) Then HttpContext.Current.Application(AppNombre) = ObjClasificaciones.DtResultados ObjClasificaciones.Dispose() End If If CveCategoria <> -1 Then - Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), $"CveCategoria = {CveCategoria}", "", DataViewRowState.CurrentRows) + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), $"CveCategoria = {CveCategoria}", "", DataViewRowState.CurrentRows) GlobalDTClasificaciones2 = Dv.ToTable Dv.Dispose() Else - GlobalDTClasificaciones2 = DirectCast(Application(AppNombre), DataTable) + GlobalDTClasificaciones2 = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End If End Get Set(value As DataTable) Dim AppNombre As String = $"GlobalDTClasificaciones2-{CveEmpresa}" - Application(AppNombre) = value + HttpContext.Current.Application(AppNombre) = value End Set End Property Property GlobalDTClasificacionesSubProyectos(Optional CveClasificacion As Integer = -1, Optional CveEmpresa As Integer = -1) As DataTable @@ -938,7 +938,7 @@ Public Class ClsPaginas Dim AppNombre As String = $"GlobalDTACClasificadorObjetoGasto-{CveEmpresa}" If HttpContext.Current.Application(AppNombre) Is Nothing Then Dim ObjClasificaciones As New ClsClasificaciones - If ObjClasificaciones.GetClasificaciones(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjClasificaciones.DtResultados.FiltraParametros("Codigo <> '' ") + If ObjClasificaciones.GetClasificaciones(CveEmpresa:=CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjClasificaciones.DtResultados.FiltraParametros("Codigo <> '' ") ObjClasificaciones.Dispose() End If Dim filtros As New List(Of String) @@ -977,21 +977,25 @@ Public Class ClsPaginas Application(AppNombre) = value End Set End Property - Property GlobalDTSubFamilias(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1) As DataTable + Public Shared Property GlobalDTSubFamilias(CveEmpresa As Integer, 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(Application("GlobalDTSubFamilias"), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows) + Dim AppNombre As String = $"GlobalDTSubFamilias-{CveEmpresa}" + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjClasificaciones As New ClsClasificaciones + If ObjClasificaciones.GetClasificaciones(CveEmpresa:=CveEmpresa, Tipo:=2) Then HttpContext.Current.Application(AppNombre) = ObjClasificaciones.DtResultados + End Using + End If + If CveCategoria <> -1 Then + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), $"CveCategoria = {CveCategoria}", "", DataViewRowState.CurrentRows) GlobalDTSubFamilias = Dv.ToTable Dv.Dispose() Else - GlobalDTSubFamilias = DirectCast(Application("GlobalDTSubFamilias"), DataTable) + GlobalDTSubFamilias = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End If End Get Set(value As DataTable) - Application("GlobalDTSubFamilias") = value + Dim AppNombre As String = $"GlobalDTSubFamilias-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property Property GlobalDTFamilias(Optional CveEmpresa As Integer = -1) As DataTable @@ -1046,18 +1050,19 @@ Public Class ClsPaginas Application(AppNombre) = value End Set End Property - Property GlobalDTClasificacionesPresupuestos(Optional CveEmpresa As Integer = -1) As DataTable + Public Shared Property GlobalDTClasificacionesPresupuestos(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTClasificacionesPresupuestos"), DataTable), String.Format("CveEmpresa = {0} ", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTClasificacionesPresupuestos = Dv.ToTable - Dv.Dispose() - Else - GlobalDTClasificacionesPresupuestos = DirectCast(Application("GlobalDTClasificacionesPresupuestos"), DataTable) + Dim AppNombre As String = $"GlobalDTClasificacionesPresupuestos-{CveEmpresa}" + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjClasificaciones As New ClsClasificaciones + If ObjClasificaciones.GetClasificaciones(CveEmpresa:=CveEmpresa, Tipo:=3) Then HttpContext.Current.Application(AppNombre) = ObjClasificaciones.DtResultados + End Using End If + GlobalDTClasificacionesPresupuestos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTClasificacionesPresupuestos") = value + Dim AppNombre As String = $"GlobalDTClasificacionesPresupuestos-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property Public Shared Property GlobalDTMetodosPago() As DataTable @@ -1475,48 +1480,48 @@ Public Class ClsPaginas 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(Application("GlobalDTTipoCuentasEquipos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTTipoCuentasEquipos = Dv.ToTable - Dv.Dispose() - Else - GlobalDTTipoCuentasEquipos = DirectCast(Application("GlobalDTTipoCuentasEquipos"), DataTable) - End If - End Get - Set(value As DataTable) - 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(Application("GlobalDTTipoCuentasEquiposCaracteristicas"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTTipoCuentasEquiposCaracteristicas = Dv.ToTable - Dv.Dispose() - Else - GlobalDTTipoCuentasEquiposCaracteristicas = DirectCast(Application("GlobalDTTipoCuentasEquiposCaracteristicas"), DataTable) - End If - End Get - Set(value As DataTable) - 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(Application("GlobalDTTipoCuentasEquiposOpciones"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTTipoCuentasEquiposOpciones = Dv.ToTable - Dv.Dispose() - Else - GlobalDTTipoCuentasEquiposOpciones = DirectCast(Application("GlobalDTTipoCuentasEquiposOpciones"), DataTable) - End If - End Get - Set(value As DataTable) - Application("GlobalDTTipoCuentasEquiposOpciones") = value - End Set - End Property + 'Property GlobalDTTipoCuentasEquipos(CveEmpresa As Integer) As DataTable + ' Get + ' If CveEmpresa <> -1 Then + ' Dim Dv As New DataView(DirectCast(Application("GlobalDTTipoCuentasEquipos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) + ' GlobalDTTipoCuentasEquipos = Dv.ToTable + ' Dv.Dispose() + ' Else + ' GlobalDTTipoCuentasEquipos = DirectCast(Application("GlobalDTTipoCuentasEquipos"), DataTable) + ' End If + ' End Get + ' Set(value As DataTable) + ' 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(Application("GlobalDTTipoCuentasEquiposCaracteristicas"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) + ' GlobalDTTipoCuentasEquiposCaracteristicas = Dv.ToTable + ' Dv.Dispose() + ' Else + ' GlobalDTTipoCuentasEquiposCaracteristicas = DirectCast(Application("GlobalDTTipoCuentasEquiposCaracteristicas"), DataTable) + ' End If + ' End Get + ' Set(value As DataTable) + ' 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(Application("GlobalDTTipoCuentasEquiposOpciones"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) + ' GlobalDTTipoCuentasEquiposOpciones = Dv.ToTable + ' Dv.Dispose() + ' Else + ' GlobalDTTipoCuentasEquiposOpciones = DirectCast(Application("GlobalDTTipoCuentasEquiposOpciones"), DataTable) + ' End If + ' End Get + ' Set(value As DataTable) + ' Application("GlobalDTTipoCuentasEquiposOpciones") = value + ' End Set + 'End Property ''Property GlobalDTProductosServicios(CveEmpresa As Integer, Optional CveClasificacion As Integer = -1, Optional CveClasificacionCosto As Integer = -1, Optional Estatus As Integer = 1, ' Optional CvePS As Integer = -1, Optional AplicaParaVenta As Integer = -1, Optional CveTipoPS As Integer = -1, Optional SATClavePS As String = "-1") As DataTable ' Get @@ -1656,20 +1661,20 @@ Public Class ClsPaginas HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProductosServiciosCaracteristicas(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProductosServiciosCaracteristicas"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProductosServiciosCaracteristicas = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProductosServiciosCaracteristicas = DirectCast(Application("GlobalDTProductosServiciosCaracteristicas"), DataTable) - End If - End Get - Set(value As DataTable) - Application("GlobalDTProductosServiciosCaracteristicas") = value - End Set - End Property + 'Property GlobalDTProductosServiciosCaracteristicas(CveEmpresa As Integer) As DataTable + ' Get + ' If CveEmpresa <> -1 Then + ' Dim Dv As New DataView(DirectCast(Application("GlobalDTProductosServiciosCaracteristicas"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) + ' GlobalDTProductosServiciosCaracteristicas = Dv.ToTable + ' Dv.Dispose() + ' Else + ' GlobalDTProductosServiciosCaracteristicas = DirectCast(Application("GlobalDTProductosServiciosCaracteristicas"), DataTable) + ' End If + ' End Get + ' Set(value As DataTable) + ' Application("GlobalDTProductosServiciosCaracteristicas") = value + ' End Set + 'End Property Property GlobalDTPSAdicionales(CvePS As Integer, CveEmpresa As Integer) As DataTable Get Dim AppNombre As String = $"GlobalDTPSAdicionales-{CveEmpresa}" @@ -1692,20 +1697,20 @@ Public Class ClsPaginas Application(AppNombre) = value End Set End Property - Property GlobalDTProductosServiciosCaracteristicasOpciones(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProductosServiciosCaracteristicasOpciones"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProductosServiciosCaracteristicasOpciones = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProductosServiciosCaracteristicasOpciones = DirectCast(Application("GlobalDTProductosServiciosCaracteristicasOpciones"), DataTable) - End If - End Get - Set(value As DataTable) - Application("GlobalDTProductosServiciosCaracteristicasOpciones") = value - End Set - End Property + 'Property GlobalDTProductosServiciosCaracteristicasOpciones(CveEmpresa As Integer) As DataTable + ' Get + ' If CveEmpresa <> -1 Then + ' Dim Dv As New DataView(DirectCast(Application("GlobalDTProductosServiciosCaracteristicasOpciones"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) + ' GlobalDTProductosServiciosCaracteristicasOpciones = Dv.ToTable + ' Dv.Dispose() + ' Else + ' GlobalDTProductosServiciosCaracteristicasOpciones = DirectCast(Application("GlobalDTProductosServiciosCaracteristicasOpciones"), DataTable) + ' End If + ' End Get + ' Set(value As DataTable) + ' Application("GlobalDTProductosServiciosCaracteristicasOpciones") = value + ' End Set + 'End Property Property GlobalDTInvMetodosInventario() As DataTable Get Dim AppNombre As String = $"GlobalDTInvMetodosInventario" @@ -2426,42 +2431,58 @@ Public Class ClsPaginas End Property #End Region #Region " **********************************************************************DT PROSPECTOS*************************************************************************************" - Property GlobalDTProspectosCaracteristicasClasificaciones() As DataTable + Public Shared Property GlobalDTProspectosCaracteristicasClasificaciones(CveEmpresa As Integer) As DataTable Get - GlobalDTProspectosCaracteristicasClasificaciones = DirectCast(Application("GlobalDTProspectosCaracteristicasClasificaciones"), DataTable) + Dim AppNombre As String = $"GlobalDTProspectosCaracteristicasClasificaciones-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetCaracteristicasClasificaciones(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using + End If + GlobalDTProspectosCaracteristicasClasificaciones = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTProspectosCaracteristicasClasificaciones") = value + Dim AppNombre As String = $"GlobalDTProspectosCaracteristicasClasificaciones-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProspectosTiposCaracteristicas() As DataTable + Public Shared Property GlobalDTProspectosCaracteristicas(CveEmpresa As Integer) As DataTable Get - GlobalDTProspectosTiposCaracteristicas = DirectCast(Application("GlobalDTProspectosTiposCaracteristicas"), DataTable) + Dim AppNombre As String = $"GlobalDTProspectosCaracteristicas-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetCaracteristicas(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using + End If + GlobalDTProspectosCaracteristicas = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTProspectosTiposCaracteristicas") = value + Dim AppNombre As String = $"GlobalDTProspectosCaracteristicas-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProspectosCaracteristicas(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProspectosCaracteristicasOpciones(CveEmpresa As Integer, CveCaracteristica As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosCaracteristicas"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProspectosCaracteristicas = Dv.ToTable + Dim AppNombre As String = $"GlobalDTProspectosCaracteristicasOpciones-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetCaracteristicasOpciones(CveCaracteristica:=CveCaracteristica, CveEmpresa:=CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using + End If + If CveCaracteristica <> -1 Then + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), $"CveCaracteristica = {CveCaracteristica}", "", DataViewRowState.CurrentRows) + GlobalDTProspectosCaracteristicasOpciones = Dv.ToTable Dv.Dispose() Else - GlobalDTProspectosCaracteristicas = DirectCast(Application("GlobalDTProspectosCaracteristicas"), DataTable) + GlobalDTProspectosCaracteristicasOpciones = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End If End Get Set(value As DataTable) - Application("GlobalDTProspectosCaracteristicas") = value - End Set - End Property - Property GlobalDTProspectosCaracteristicasOpciones() As DataTable - Get - GlobalDTProspectosCaracteristicasOpciones = DirectCast(Application("GlobalDTProspectosCaracteristicasOpciones"), DataTable) - End Get - Set(value As DataTable) - Application("GlobalDTProspectosCaracteristicasOpciones") = value + Dim AppNombre As String = $"GlobalDTProspectosCaracteristicasOpciones-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property #End Region @@ -2674,124 +2695,145 @@ Public Class ClsPaginas End Property #End Region #Region "***********************************************************************DT PROSPECTOS*************************************************************************************" - Property GlobalDTProspectosSupervisores(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProspectosSupervisores(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosSupervisores"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProspectosSupervisores = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProspectosSupervisores = DirectCast(Application("GlobalDTProspectosSupervisores"), DataTable) + Dim AppNombre As String = $"GlobalDTProspectosSupervisores-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetSupervisores(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using End If + GlobalDTProspectosSupervisores = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTProspectosSupervisores") = value + Dim AppNombre As String = $"GlobalDTProspectosSupervisores-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProspectosCoordinadores(CveSupervisor As Integer, CveEmpresa As Integer) As DataTable + Public Shared 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(Application("GlobalDTProspectosCoordinadores"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) + Dim AppNombre As String = $"GlobalDTProspectosCoordinadores-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetCoordinadores(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using + End If + Dim filtros As New List(Of String) + If CveSupervisor <> -1 Then + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), $"CveSupervisor = {CveSupervisor}", "", DataViewRowState.CurrentRows) GlobalDTProspectosCoordinadores = Dv.ToTable Dv.Dispose() Else - GlobalDTProspectosCoordinadores = DirectCast(Application("GlobalDTProspectosCoordinadores"), DataTable) + GlobalDTProspectosCoordinadores = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End If End Get Set(value As DataTable) - Application("GlobalDTProspectosCoordinadores") = value + Dim AppNombre As String = $"GlobalDTProspectosCoordinadores-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProspectosApoyos(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProspectosApoyos(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosApoyos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProspectosApoyos = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProspectosApoyos = DirectCast(Application("GlobalDTProspectosApoyos"), DataTable) + Dim AppNombre As String = $"GlobalDTProspectosApoyos-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetProspectoApoyo(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using End If + GlobalDTProspectosApoyos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTProspectosApoyos") = value + Dim AppNombre As String = $"GlobalDTProspectosApoyos-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProspectosClasificaciones(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProspectosClasificaciones(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosClasificaciones"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProspectosClasificaciones = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProspectosClasificaciones = DirectCast(Application("GlobalDTProspectosClasificaciones"), DataTable) + Dim AppNombre As String = $"GlobalDTProspectosClasificaciones-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetClasificacion(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using End If + GlobalDTProspectosClasificaciones = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTProspectosClasificaciones") = value + Dim AppNombre As String = $"GlobalDTProspectosClasificaciones-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProspectosEventosTipo(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProspectosEventosTipo(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosEventosTipo"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProspectosEventosTipo = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProspectosEventosTipo = DirectCast(Application("GlobalDTProspectosEventosTipo"), DataTable) + Dim AppNombre As String = $"GlobalDTProspectosEventosTipo-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetEventosTipo(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using End If + GlobalDTProspectosEventosTipo = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTProspectosEventosTipo") = value + Dim AppNombre As String = $"GlobalDTProspectosEventosTipo-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProspectosEvento(CveEventoTipo As Integer, CveEmpresa As Integer) As DataTable + Public Shared 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(Application("GlobalDTProspectosEvento"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) + Dim AppNombre As String = $"GlobalDTProspectosEvento-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetProspectosEventos(CveEvento:=-1, CveEmpresa:=CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using + End If + If CveEventoTipo <> -1 Then + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), $"CveEventoTipo = {CveEventoTipo}", "", DataViewRowState.CurrentRows) GlobalDTProspectosEvento = Dv.ToTable Dv.Dispose() Else - GlobalDTProspectosEvento = DirectCast(Application("GlobalDTProspectosEvento"), DataTable) + GlobalDTProspectosEvento = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End If End Get Set(value As DataTable) - Application("GlobalDTProspectosEvento") = value + Dim AppNombre As String = $"GlobalDTProspectosEvento-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProspectosEstatus(CveEmpresa As Integer) As DataTable + Public Shared 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(Application("GlobalDTProspectosEstatus"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) - GlobalDTProspectosEstatus = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProspectosEstatus = DirectCast(Application("GlobalDTProspectosEstatus"), DataTable) + Dim AppNombre As String = $"GlobalDTProspectosEstatus-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetProspectosEventos(CveEvento:=-1, CveEmpresa:=CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using End If + GlobalDTProspectosEstatus = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTProspectosEstatus") = value + Dim AppNombre As String = $"GlobalDTProspectosEstatus-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProspectosApoyosTipos(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProspectosApoyosTipos(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosApoyosTipos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProspectosApoyosTipos = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProspectosApoyosTipos = DirectCast(Application("GlobalDTProspectosApoyosTipos"), DataTable) + Dim AppNombre As String = $"GlobalDTProspectosApoyosTipos-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetApoyoTipo(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using End If + GlobalDTProspectosApoyosTipos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTProspectosApoyosTipos") = value + Dim AppNombre As String = $"GlobalDTProspectosApoyosTipos-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property Property GlobalDTProspectosApoyosTipos() As DataTable @@ -2802,138 +2844,175 @@ Public Class ClsPaginas Application("GlobalDTProspectosApoyosTipos") = value End Set End Property - Property GlobalDTProspectosEncuestas(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProspectosTiposCaracteristicas(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(Application("GlobalDTProspectosEncuestas"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) - GlobalDTProspectosEncuestas = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProspectosEncuestas = DirectCast(Application("GlobalDTProspectosEncuestas"), DataTable) + Dim AppNombre As String = $"GlobalDTProspectosTiposCaracteristicas-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetTiposCaracteristicas(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using End If + GlobalDTProspectosTiposCaracteristicas = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTProspectosEncuestas") = value + Dim AppNombre As String = $"GlobalDTProspectosTiposCaracteristicas-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProspectosEncuestasPreguntas(CveEncuesta As Integer, CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProspectosEncuestas(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(Application("GlobalDTProspectosEncuestasPreguntas"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) + Dim AppNombre As String = $"GlobalDTProspectosEncuestas-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetEncuestas(CveEmpresa:=CveEmpresa, CveEncuesta:=-1) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using + End If + GlobalDTProspectosEncuestas = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) + End Get + Set(value As DataTable) + Dim AppNombre As String = $"GlobalDTProspectosEncuestas-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value + End Set + End Property + Public Shared Property GlobalDTProspectosEncuestasPreguntas(CveEncuesta As Integer, CveEmpresa As Integer) As DataTable + Get + Dim AppNombre As String = $"GlobalDTProspectosEncuestasPreguntas-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetPreguntas(CveEmpresa:=CveEmpresa, CveEncuesta:=-1, CveUsuario:=-1) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using + End If + If CveEncuesta <> -1 Then + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), $"CveEncuesta = {CveEncuesta}", "", DataViewRowState.CurrentRows) GlobalDTProspectosEncuestasPreguntas = Dv.ToTable Dv.Dispose() Else - GlobalDTProspectosEncuestasPreguntas = DirectCast(Application("GlobalDTProspectosEncuestasPreguntas"), DataTable) + GlobalDTProspectosEncuestasPreguntas = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End If End Get Set(value As DataTable) - Application("GlobalDTProspectosEncuestasPreguntas") = value + Dim AppNombre As String = $"GlobalDTProspectosEncuestasPreguntas-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProspectosEncuestasRespuestas(CvePregunta As Integer, CveEncuesta As Integer, CveEmpresa As Integer) As DataTable + Public Shared 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(Application("GlobalDTProspectosEncuestasRespuestas"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) + Dim AppNombre As String = $"GlobalDTProspectosEncuestasRespuestas-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetRespuestas(CveEmpresa:=CveEmpresa, CvePregunta:=-1, CveEncuesta:=-1) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using + End If + Dim filtros As New List(Of String) + If CvePregunta <> -1 Then filtros.Add($"CvePregunta = {CvePregunta}") + If CveEncuesta <> -1 Then filtros.Add($"CveEncuesta = {CveEncuesta}") + If filtros.Count > 0 Then + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows) GlobalDTProspectosEncuestasRespuestas = Dv.ToTable Dv.Dispose() Else - GlobalDTProspectosEncuestasRespuestas = DirectCast(Application("GlobalDTProspectosEncuestasRespuestas"), DataTable) + GlobalDTProspectosEncuestasRespuestas = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End If End Get Set(value As DataTable) - Application("GlobalDTProspectosEncuestasRespuestas") = value + Dim AppNombre As String = $"GlobalDTProspectosEncuestasRespuestas-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProspectosTipos(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProspectosTipos(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosTipos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProspectosTipos = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProspectosTipos = DirectCast(Application("GlobalDTProspectosTipos"), DataTable) + Dim AppNombre As String = $"GlobalDTProspectosTipos-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetProspectosTipos(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using End If + GlobalDTProspectosTipos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTProspectosTipos") = value + Dim AppNombre As String = $"GlobalDTProspectosTipos-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property #Region " DT PROSPECTOS SOLICITUDES" - Property GlobalDTProspectosSolicitudes(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProspectosSolicitudes(CveEmpresa As Integer, Optional CveProspecto As Integer = -1, Optional CveApoyoTipo As Integer = -1, Optional CveClasificacion As Integer = -1, Optional CveProspectoSolicitud As Integer = -1) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosSolicitudes"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) + Dim AppNombre As String = $"GlobalDTProspectosSolicitudes-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetProspectosSolicitudes(CveEmpresa:=CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using + End If + Dim filtros As New List(Of String) + If CveProspecto <> -1 Then filtros.Add($"CveProspecto = {CveProspecto}") + If CveApoyoTipo <> -1 Then filtros.Add($"CveApoyoTipo = {CveApoyoTipo}") + If CveClasificacion <> -1 Then filtros.Add($"CveClasificacion = {CveClasificacion}") + If CveProspectoSolicitud <> -1 Then filtros.Add($"CveProspectoSolicitud = {CveProspectoSolicitud}") + If filtros.Count > 0 Then + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows) GlobalDTProspectosSolicitudes = Dv.ToTable Dv.Dispose() Else - GlobalDTProspectosSolicitudes = DirectCast(Application("GlobalDTProspectosSolicitudes"), DataTable) + GlobalDTProspectosSolicitudes = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End If End Get Set(value As DataTable) - Application("GlobalDTProspectosSolicitudes") = value + Dim AppNombre As String = $"GlobalDTProspectosSolicitudes-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProspectosSolicitudesEstatus(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProspectosSolicitudesEstatus(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosSolicitudesEstatus"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProspectosSolicitudesEstatus = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProspectosSolicitudesEstatus = DirectCast(Application("GlobalDTProspectosSolicitudesEstatus"), DataTable) + Dim AppNombre As String = $"GlobalDTProspectosSolicitudesEstatus-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetSolicitudEstatus(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using End If + GlobalDTProspectosSolicitudesEstatus = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTProspectosSolicitudesEstatus") = value + Dim AppNombre As String = $"GlobalDTProspectosSolicitudesEstatus-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProspectosSolicitudesTipos(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProspectosSolicitudesTipos(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosSolicitudesTipos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProspectosSolicitudesTipos = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProspectosSolicitudesTipos = DirectCast(Application("GlobalDTProspectosSolicitudesTipos"), DataTable) + Dim AppNombre As String = $"GlobalDTProspectosSolicitudesTipos-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetSolicitudTipo(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using End If + GlobalDTProspectosSolicitudesTipos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTProspectosSolicitudesTipos") = value + Dim AppNombre As String = $"GlobalDTProspectosSolicitudesTipos-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - 'Property GlobalDTProspectosSolicitudesTipos() As DataTable + 'Property GlobalDTProspectosSolicitudesApoyos(CveEmpresa As Integer) As DataTable ' Get - ' GlobalDTProspectosSolicitudesTipos = DirectCast(Application("GlobalDTProspectosSolicitudesTipos"), DataTable) + ' If CveEmpresa <> -1 Then + ' Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosSolicitudesApoyos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) + ' GlobalDTProspectosSolicitudesApoyos = Dv.ToTable + ' Dv.Dispose() + ' Else + ' GlobalDTProspectosSolicitudesApoyos = DirectCast(Application("GlobalDTProspectosSolicitudesApoyos"), DataTable) + ' End If ' End Get ' Set(value As DataTable) - ' Application("GlobalDTProspectosSolicitudesTipos") = value + ' Application("GlobalDTProspectosSolicitudesApoyos") = value ' End Set 'End Property - Property GlobalDTProspectosSolicitudesApoyos(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosSolicitudesApoyos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProspectosSolicitudesApoyos = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProspectosSolicitudesApoyos = DirectCast(Application("GlobalDTProspectosSolicitudesApoyos"), DataTable) - End If - End Get - Set(value As DataTable) - Application("GlobalDTProspectosSolicitudesApoyos") = value - End Set - End Property #End Region #End Region #Region "**********************************************DT AMORTIZACIÓN CONTABLE PLAN DE DESARROLLO********************************************************************************" @@ -2946,19 +3025,20 @@ Public Class ClsPaginas Application("GlobalDTAC_RubrosIngreso") = value End Set End Property - Property GlobalDTAC_FuentesRecaudacion(CveEmpresa As Integer) As DataTable + Public Shared 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(Application("GlobalDTAC_FuentesRecaudacion"), DataTable), StrSQL, "", DataViewRowState.CurrentRows) - GlobalDTAC_FuentesRecaudacion = Dv.ToTable - Dv.Dispose() - Else - GlobalDTAC_FuentesRecaudacion = DirectCast(Application("GlobalDTAC_FuentesRecaudacion"), DataTable) + Dim AppNombre As String = $"GlobalDTAC_FuentesRecaudacion-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjAC As New ClsAC + If ObjAC.GetFuentesRecaudacion(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjAC.DtResultados + End Using End If + GlobalDTAC_FuentesRecaudacion = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTAC_FuentesRecaudacion") = value + Dim AppNombre As String = $"GlobalDTAC_FuentesRecaudacion-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property Property GlobalDTAC_FuentesFinanciamiento() As DataTable @@ -3000,47 +3080,52 @@ Public Class ClsPaginas Application("GlobalDTAC_Ubicaciones") = value End Set End Property - Property GlobalDTAC_UnidadesAdministrativas(CveEmpresa As Integer) As DataTable + Public Shared 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(Application("GlobalDTAC_UnidadesAdministrativas"), DataTable), StrSQL, "", DataViewRowState.CurrentRows) - GlobalDTAC_UnidadesAdministrativas = Dv.ToTable - Dv.Dispose() - Else - GlobalDTAC_UnidadesAdministrativas = DirectCast(Application("GlobalDTAC_UnidadesAdministrativas"), DataTable) + Dim AppNombre As String = $"GlobalDTAC_UnidadesAdministrativas-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjAC As New ClsAC + If ObjAC.GetUnidadesAdministrativas(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjAC.DtResultados + End Using End If + GlobalDTAC_UnidadesAdministrativas = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTAC_UnidadesAdministrativas") = value + Dim AppNombre As String = $"GlobalDTAC_UnidadesAdministrativas-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTAC_ClasificacionFuncional(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTAC_ClasificacionFuncional(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTAC_ClasificacionFuncional"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTAC_ClasificacionFuncional = Dv.ToTable - Dv.Dispose() - Else - GlobalDTAC_ClasificacionFuncional = DirectCast(Application("GlobalDTAC_ClasificacionFuncional"), DataTable) + Dim AppNombre As String = $"GlobalDTAC_ClasificacionFuncional-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjAC As New ClsAC + If ObjAC.GetClasificacionFuncional(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjAC.DtResultados + End Using End If + GlobalDTAC_ClasificacionFuncional = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTAC_ClasificacionFuncional") = value + Dim AppNombre As String = $"GlobalDTAC_ClasificacionFuncional-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTAC_ClasificacionGeografica(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTAC_ClasificacionGeografica(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTAC_ClasificacionGeografica"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTAC_ClasificacionGeografica = Dv.ToTable - Dv.Dispose() - Else - GlobalDTAC_ClasificacionGeografica = DirectCast(Application("GlobalDTAC_ClasificacionGeografica"), DataTable) + Dim AppNombre As String = $"GlobalDTAC_ClasificacionGeografica-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjAC As New ClsAC + If ObjAC.GetClasificacionGeografica(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjAC.DtResultados + End Using End If + GlobalDTAC_ClasificacionGeografica = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTAC_ClasificacionGeografica") = value + Dim AppNombre As String = $"GlobalDTAC_ClasificacionGeografica-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property Property GlobalDTAC_Cuentas() As DataTable @@ -3067,19 +3152,20 @@ Public Class ClsPaginas ' Application("GlobalDTAC_FuenteFinanciamiento") = value ' End Set 'End Property - Property GlobalDTAC_FuentesFinanciamiento(CveEmpresa As Integer) As DataTable + Public Shared 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(Application("GlobalDTAC_FuentesFinanciamiento"), DataTable), StrSQL, "", DataViewRowState.CurrentRows) - GlobalDTAC_FuentesFinanciamiento = Dv.ToTable - Dv.Dispose() - Else - GlobalDTAC_FuentesFinanciamiento = DirectCast(Application("GlobalDTAC_FuentesFinanciamiento"), DataTable) + Dim AppNombre As String = $"GlobalDTAC_FuentesFinanciamiento-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjAC As New ClsAC + If ObjAC.GetFuentesFinanciamiento(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjAC.DtResultados + End Using End If + GlobalDTAC_FuentesFinanciamiento = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTAC_FuentesFinanciamiento") = value + Dim AppNombre As String = $"GlobalDTAC_FuentesFinanciamiento-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property Property GlobalDTAC_FuentesFinanciamientoCONAC() As DataTable @@ -3138,18 +3224,20 @@ Public Class ClsPaginas Application("GlobalDTAC_SubProgramas") = value End Set End Property - Property GlobalDTAC_ClasificacionAdministrativa(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTAC_ClasificacionAdministrativa(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTAC_ClasificacionAdministrativa"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTAC_ClasificacionAdministrativa = Dv.ToTable - Dv.Dispose() - Else - GlobalDTAC_ClasificacionAdministrativa = DirectCast(Application("GlobalDTAC_ClasificacionAdministrativa"), DataTable) + Dim AppNombre As String = $"GlobalDTAC_ClasificacionAdministrativa-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjAC As New ClsAC + If ObjAC.GetClasificacionAdministrativa(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjAC.DtResultados + End Using End If + GlobalDTAC_ClasificacionAdministrativa = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTAC_ClasificacionAdministrativa") = value + Dim AppNombre As String = $"GlobalDTAC_ClasificacionAdministrativa-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property Property GlobalDTAC_TipoGasto() As DataTable @@ -3160,18 +3248,20 @@ Public Class ClsPaginas Application("GlobalDTAC_TipoGasto") = value End Set End Property - Property GlobalDTAC_ProgramaOperativo(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTAC_ProgramaOperativo(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTAC_ProgramaOperativo"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTAC_ProgramaOperativo = Dv.ToTable - Dv.Dispose() - Else - GlobalDTAC_ProgramaOperativo = DirectCast(Application("GlobalDTAC_ProgramaOperativo"), DataTable) + Dim AppNombre As String = $"GlobalDTAC_ProgramaOperativo-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjAC As New ClsAC + If ObjAC.GetProgramaOperativo(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjAC.DtResultados + End Using End If + GlobalDTAC_ProgramaOperativo = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTAC_ProgramaOperativo") = value + Dim AppNombre As String = $"GlobalDTAC_ProgramaOperativo-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property Property GlobalDTAC_MatrizIngresos() As DataTable @@ -3192,18 +3282,20 @@ Public Class ClsPaginas End Property #End Region - Property GlobalDTAC_PD_EjeRector(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTAC_PD_EjeRector(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTAC_PD_EjeRector"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTAC_PD_EjeRector = Dv.ToTable - Dv.Dispose() - Else - GlobalDTAC_PD_EjeRector = DirectCast(Application("GlobalDTAC_PD_EjeRector"), DataTable) + Dim AppNombre As String = $"GlobalDTAC_PD_EjeRector-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjAC As New ClsAC + If ObjAC.GetPD_EjeRector(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjAC.DtResultados + End Using End If + GlobalDTAC_PD_EjeRector = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTAC_PD_EjeRector") = value + Dim AppNombre As String = $"GlobalDTAC_PD_EjeRector-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property Property GlobalDTAC_PD_Programas(CveEjeRector As Integer) As DataTable @@ -3650,36 +3742,43 @@ Public Class ClsPaginas 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 + Public Shared 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(Application("GlobalDTCombustibles"), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows) - GlobalDTCombustibles = Dv.ToTable - Dv.Dispose() - Else - GlobalDTCombustibles = DirectCast(Application("GlobalDTCombustibles"), DataTable) + Dim AppNombre As String = $"GlobalDTCombustibles-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjFlotillas As New ClsFlotillas + If ObjFlotillas.GetCombustibles(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjFlotillas.DtResultados + End Using End If + GlobalDTCombustibles = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTCombustibles") = value + Dim AppNombre As String = $"GlobalDTCombustibles-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTCombustiblesTipos(Optional CveCombustibleTipo As Integer = -1) As DataTable + Public Shared Property GlobalDTCombustiblesTipos(CveEmpresa As Integer, Optional CveCombustibleTipo As Integer = -1) As DataTable Get + Dim AppNombre As String = $"GlobalDTCombustiblesTipos-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjFlotillas As New ClsFlotillas + If ObjFlotillas.GetCombustiblesTipos(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjFlotillas.DtResultados + End Using + End If + Dim filtros As New List(Of String) If CveCombustibleTipo <> -1 Then - Dim StrSQL As New StringBuilder - If CveCombustibleTipo <> -1 Then StrSQL.AppendFormat("CveCombustibleTipo = {0}", CveCombustibleTipo) - Dim Dv As New DataView(DirectCast(Application("GlobalDTCombustiblesTipos"), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows) + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), $"CveCombustibleTipo = {CveCombustibleTipo}", "", DataViewRowState.CurrentRows) GlobalDTCombustiblesTipos = Dv.ToTable Dv.Dispose() Else - GlobalDTCombustiblesTipos = DirectCast(Application("GlobalDTCombustiblesTipos"), DataTable) + GlobalDTCombustiblesTipos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End If End Get - Set(ByVal value As DataTable) - Application("GlobalDTCombustiblesTipos") = value + Set(value As DataTable) + Dim AppNombre As String = $"GlobalDTCombustiblesTipos-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property #End Region diff --git a/App_Code/ClsProspectos.vb b/App_Code/ClsProspectos.vb index 2866b3324..47fe6ac76 100644 --- a/App_Code/ClsProspectos.vb +++ b/App_Code/ClsProspectos.vb @@ -1409,9 +1409,12 @@ Public Class ClsProspectos #End Region #Region "P R O S P E C T O S - C L A S I F I C A C I O N" - Public Function GetClasificacion() As Boolean + Public Function GetClasificacion(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Pros_ProspectosClasificacionGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True @@ -1674,9 +1677,12 @@ Public Class ClsProspectos #Region "P R O S P E C T O S - T I P O S" - Public Function GetProspectosTipos() As Boolean + Public Function GetProspectosTipos(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Pros_ProspectosTiposGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True @@ -1957,9 +1963,12 @@ Public Class ClsProspectos #End Region #Region "P R O S P E C T O S - A P O Y O S " - Public Function GetProspectoApoyo() As Boolean + Public Function GetProspectoApoyo(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Pros_ProspectosApoyosGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True @@ -2265,7 +2274,7 @@ Public Class ClsProspectos #End Region #Region "P R O S P E C T O S - S O L I C I T U D E S " - Public Function GetProspectosSolicitudes(CveProspecto As Integer, CveApoyoTipo As Integer, CveClasificacion As Integer, CveProspectoSolicitud As Integer, CveEmpresa As Integer) As Boolean + Public Function GetProspectosSolicitudes(CveEmpresa As Integer, Optional CveProspecto As Integer = -1, Optional CveApoyoTipo As Integer = -1, Optional CveClasificacion As Integer = -1, Optional CveProspectoSolicitud As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Pros_ProspectosSolicitudesGet") With SqlAdapter.SelectCommand.Parameters @@ -2586,9 +2595,12 @@ Public Class ClsProspectos #End Region #Region "P R O S P E C T O S - S O L I C I T U D E S - A P O Y O S - T I P O S " - Public Function GetApoyoTipo() As Boolean + Public Function GetApoyoTipo(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Pros_ProspectosApoyosTiposGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True @@ -2679,9 +2691,12 @@ Public Class ClsProspectos #End Region #Region "P R O S P E C T O S - S O L I C I T U D E S - E S T A T U S " - Public Function GetSolicitudEstatus() As Boolean + Public Function GetSolicitudEstatus(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Pros_ProspectosSolicitudesEstatusGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True @@ -2772,9 +2787,12 @@ Public Class ClsProspectos #End Region #Region "P R O S P E C T O S - S O L I C I T U D E S - T I P O S " - Public Function GetSolicitudTipo() As Boolean + Public Function GetSolicitudTipo(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Pros_ProspectosSolicitudesTiposGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True @@ -4235,12 +4253,13 @@ Public Class ClsProspectos #End Region #Region "E N C U E S T A S - R E S P U E S T A S" - Public Function GetRespuestas(CvePregunta As Integer, CveEncuesta As Integer) As Boolean + Public Function GetRespuestas(CvePregunta As Integer, CveEncuesta As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Pros_EncuestasRespuestasGet") With SqlAdapter.SelectCommand.Parameters .Add("@CveEncuesta", SqlDbType.Int).Value = CveEncuesta .Add("@CvePregunta", SqlDbType.Int).Value = CvePregunta + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa End With Try diff --git a/Global.asax b/Global.asax index c9642f892..3362f8931 100644 --- a/Global.asax +++ b/Global.asax @@ -42,23 +42,22 @@ GuardaLogAsax(String.Format("Globalasax 5:{0}", DateTime.Now)) Using ObjAC As New ClsAC - If ObjAC.GetClasificacionFuncional() Then Application("GlobalDTAC_ClasificacionFuncional") = ObjAC.DtResultados Else Application("GlobalDTAC_ClasificacionFuncional") = Nothing - If ObjAC.GetClasificacionGeografica() Then Application("GlobalDTAC_ClasificacionGeografica") = ObjAC.DtResultados Else Application("GlobalDTAC_ClasificacionGeografica") = Nothing - If ObjAC.GetFuentesFinanciamiento() Then Application("GlobalDTAC_FuentesFinanciamiento") = ObjAC.DtResultados Else Application("GlobalDTAC_FuentesFinanciamiento") = Nothing + 'If ObjAC.GetClasificacionFuncional() Then Application("GlobalDTAC_ClasificacionFuncional") = ObjAC.DtResultados Else Application("GlobalDTAC_ClasificacionFuncional") = Nothing + 'If ObjAC.GetClasificacionGeografica() Then Application("GlobalDTAC_ClasificacionGeografica") = ObjAC.DtResultados Else Application("GlobalDTAC_ClasificacionGeografica") = Nothing + 'If ObjAC.GetFuentesFinanciamiento() Then Application("GlobalDTAC_FuentesFinanciamiento") = ObjAC.DtResultados Else Application("GlobalDTAC_FuentesFinanciamiento") = Nothing If ObjAC.GetFuenteFinanciamientoCONAC() Then Application("GlobalDTAC_FuentesFinanciamientoCONAC") = ObjAC.DtResultados Else Application("GlobalDTAC_FuentesFinanciamientoCONAC") = Nothing If ObjAC.GetProgramaCONAC() Then Application("GlobalDTAC_ProgramasCONAC") = ObjAC.DtResultados Else Application("GlobalDTAC_ProgramasCONAC") = Nothing - If ObjAC.GetUnidadesAdministrativas() Then Application("GlobalDTAC_UnidadesAdministrativas") = ObjAC.DtResultados Else Application("GlobalDTAC_UnidadesAdministrativas") = Nothing - If ObjAC.GetClasificacionAdministrativa() Then Application("GlobalDTAC_ClasificacionAdministrativa") = ObjAC.DtResultados Else Application("GlobalDTAC_ClasificacionAdministrativa") = Nothing - If ObjAC.GetPD_EjeRector() Then Application("GlobalDTAC_PD_EjeRector") = ObjAC.DtResultados Else Application("GlobalDTAC_PD_EjeRector") = Nothing + 'If ObjAC.GetUnidadesAdministrativas() Then Application("GlobalDTAC_UnidadesAdministrativas") = ObjAC.DtResultados Else Application("GlobalDTAC_UnidadesAdministrativas") = Nothing + 'If ObjAC.GetClasificacionAdministrativa() Then Application("GlobalDTAC_ClasificacionAdministrativa") = ObjAC.DtResultados Else Application("GlobalDTAC_ClasificacionAdministrativa") = Nothing + 'If ObjAC.GetPD_EjeRector() Then Application("GlobalDTAC_PD_EjeRector") = ObjAC.DtResultados Else Application("GlobalDTAC_PD_EjeRector") = Nothing If ObjAC.GetPD_Programas() Then Application("GlobalDTAC_PD_Programas") = ObjAC.DtResultados Else Application("GlobalDTAC_PD_Programas") = Nothing If ObjAC.GetPD_Estrategias() Then Application("GlobalDTAC_PD_Estrategias") = ObjAC.DtResultados Else Application("GlobalDTAC_PD_Estrategias") = Nothing If ObjAC.GetPD_LineasAccion() Then Application("GlobalDTAC_PD_LineasAccion") = ObjAC.DtResultados Else Application("GlobalDTAC_PD_LineasAccion") = Nothing If ObjAC.GetPD_Metas() Then Application("GlobalDTAC_PD_Metas") = ObjAC.DtResultados Else Application("GlobalDTAC_PD_Metas") = Nothing If ObjAC.GetTipoGasto() Then Application("GlobalDTAC_TipoGasto") = ObjAC.DtResultados Else Application("GlobalDTAC_TipoGasto") = Nothing - If ObjAC.GetProgramaOperativo() Then Application("GlobalDTAC_ProgramaOperativo") = ObjAC.DtResultados Else Application("GlobalDTAC_ProgramaOperativo") = Nothing - If ObjAC.GetFuentesFinanciamiento() Then Application("GlobalDTAC_FuentesFinanciamiento") = ObjAC.DtResultados Else Application("GlobalDTAC_FuentesFinanciamiento") = Nothing + 'If ObjAC.GetProgramaOperativo() Then Application("GlobalDTAC_ProgramaOperativo") = ObjAC.DtResultados Else Application("GlobalDTAC_ProgramaOperativo") = Nothing If ObjAC.GetRubrosIngreso() Then Application("GlobalDTAC_RubrosIngreso") = ObjAC.DtResultados Else Application("GlobalDTAC_RubrosIngreso") = Nothing - If ObjAC.GetFuentesRecaudacion() Then Application("GlobalDTAC_FuentesRecaudacion") = ObjAC.DtResultados Else Application("GlobalDTAC_FuentesRecaudacion") = Nothing + 'If ObjAC.GetFuentesRecaudacion() Then Application("GlobalDTAC_FuentesRecaudacion") = ObjAC.DtResultados Else Application("GlobalDTAC_FuentesRecaudacion") = Nothing If ObjAC.GetMatrizID Then Application("GlobalDTAC_MatrizIngresos") = ObjAC.DtResultados Else Application("GlobalDTAC_MatrizIngresos") = Nothing If ObjAC.GetMatrizGD Then Application("GlobalDTAC_MatrizEgresos") = ObjAC.DtResultados Else Application("GlobalDTAC_MatrizEgresos") = Nothing ' If ObjAC.GetAreas() Then Application("GlobalDTAC_Areas") = ObjAC.DtResultados Else Application("GlobalDTAC_Areas") = Nothing @@ -103,50 +102,50 @@ '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 'P R O S P E C T O S - GuardaLogAsax(String.Format("Globalasax 10:{0}", DateTime.Now)) - Using ObjProspectos As New ClsProspectos - If ObjProspectos.GetClasificacion Then Application("GlobalDTProspectosClasificaciones") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosClasificaciones") = Nothing - If ObjProspectos.GetClasificacion Then Application("GlobalDTProspectosClasificacionesCaracteristicas") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosClasificacionesCaracteristicas") = Nothing - If ObjProspectos.GetCoordinadores(-1) Then Application("GlobalDTProspectosCoordinadores") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosCoordinadores") = Nothing - If ObjProspectos.GetSupervisores(-1) Then Application("GlobalDTProspectosSupervisores") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosSupervisores") = Nothing - If ObjProspectos.GetProspectosSolicitudes(-1, -1, -1, -1, -1) Then Application("GlobalDTProspectosSolicitudes") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosSolicitudes") = Nothing - If ObjProspectos.GetSolicitudTipo Then Application("GlobalDTProspectosSolicitudesTipos") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosSolicitudesTipos") = Nothing - If ObjProspectos.GetApoyoTipo Then Application("GlobalDTProspectosApoyosTipos") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosApoyosTipos") = Nothing - If ObjProspectos.GetProspectoApoyo Then Application("GlobalDTProspectosApoyos") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosApoyos") = Nothing - If ObjProspectos.GetSolicitudEstatus Then Application("GlobalDTProspectosSolicitudesEstatus") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosSolicitudesEstatus") = Nothing - If ObjProspectos.GetEventosTipo(-1) Then Application("GlobalDTProspectosEventosTipo") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosEventosTipo") = Nothing - If ObjProspectos.GetProspectosEventos(-1, -1) Then Application("GlobalDTProspectosEvento") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosEvento") = Nothing - If ObjProspectos.GetProspectosTipos() Then Application("GlobalDTProspectosTipos") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosTipos") = Nothing - If ObjProspectos.GetProspectosEstatus() Then Application("GlobalDTProspectosEstatus") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosEstatus") = Nothing - If ObjProspectos.GetCaracteristicasClasificaciones(-1) Then Application("GlobalDTProspectosCaracteristicasClasificaciones") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosCaracteristicasClasificaciones") = Nothing - If ObjProspectos.GetTiposCaracteristicas(-1) Then Application("GlobalDTProspectosTiposCaracteristicas") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosTiposCaracteristicas") = Nothing - If ObjProspectos.GetCaracteristicas(-1) Then Application("GlobalDTProspectosCaracteristicas") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosCaracteristicas") = Nothing - If ObjProspectos.GetCaracteristicasOpciones(-1, -1) Then Application("GlobalDTProspectosCaracteristicasOpciones") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosCaracteristicasOpciones") = Nothing - If ObjProspectos.GetEncuestas(-1, -1) Then Application("GlobalDTProspectosEncuestas") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosEncuestas") = Nothing - If ObjProspectos.GetPreguntas(-1, -1, -1) Then Application("GlobalDTProspectosEncuestasPreguntas") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosEncuestasPreguntas") = Nothing - If ObjProspectos.GetRespuestas(-1, -1) Then Application("GlobalDTProspectosEncuestasRespuestas") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosEncuestasRespuestas") = Nothing - End Using + 'GuardaLogAsax(String.Format("Globalasax 10:{0}", DateTime.Now)) + 'Using ObjProspectos As New ClsProspectos + 'If ObjProspectos.GetClasificacion Then Application("GlobalDTProspectosClasificaciones") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosClasificaciones") = Nothing + 'If ObjProspectos.GetClasificacion Then Application("GlobalDTProspectosClasificacionesCaracteristicas") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosClasificacionesCaracteristicas") = Nothing + 'If ObjProspectos.GetCoordinadores(-1) Then Application("GlobalDTProspectosCoordinadores") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosCoordinadores") = Nothing + 'If ObjProspectos.GetSupervisores(-1) Then Application("GlobalDTProspectosSupervisores") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosSupervisores") = Nothing + 'If ObjProspectos.GetProspectosSolicitudes(-1, -1, -1, -1, -1) Then Application("GlobalDTProspectosSolicitudes") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosSolicitudes") = Nothing + 'If ObjProspectos.GetSolicitudTipo Then Application("GlobalDTProspectosSolicitudesTipos") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosSolicitudesTipos") = Nothing + 'If ObjProspectos.GetApoyoTipo Then Application("GlobalDTProspectosApoyosTipos") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosApoyosTipos") = Nothing + 'If ObjProspectos.GetProspectoApoyo Then Application("GlobalDTProspectosApoyos") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosApoyos") = Nothing + 'If ObjProspectos.GetSolicitudEstatus Then Application("GlobalDTProspectosSolicitudesEstatus") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosSolicitudesEstatus") = Nothing + 'If ObjProspectos.GetEventosTipo(-1) Then Application("GlobalDTProspectosEventosTipo") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosEventosTipo") = Nothing + 'If ObjProspectos.GetProspectosEventos(-1, -1) Then Application("GlobalDTProspectosEvento") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosEvento") = Nothing + 'If ObjProspectos.GetProspectosTipos() Then Application("GlobalDTProspectosTipos") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosTipos") = Nothing + 'If ObjProspectos.GetProspectosEstatus() Then Application("GlobalDTProspectosEstatus") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosEstatus") = Nothing + 'If ObjProspectos.GetCaracteristicasClasificaciones(-1) Then Application("GlobalDTProspectosCaracteristicasClasificaciones") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosCaracteristicasClasificaciones") = Nothing + 'If ObjProspectos.GetTiposCaracteristicas(-1) Then Application("GlobalDTProspectosTiposCaracteristicas") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosTiposCaracteristicas") = Nothing + 'If ObjProspectos.GetCaracteristicas(-1) Then Application("GlobalDTProspectosCaracteristicas") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosCaracteristicas") = Nothing + 'If ObjProspectos.GetCaracteristicasOpciones(-1, -1) Then Application("GlobalDTProspectosCaracteristicasOpciones") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosCaracteristicasOpciones") = Nothing + 'If ObjProspectos.GetEncuestas(-1, -1) Then Application("GlobalDTProspectosEncuestas") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosEncuestas") = Nothing + 'If ObjProspectos.GetPreguntas(-1, -1, -1) Then Application("GlobalDTProspectosEncuestasPreguntas") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosEncuestasPreguntas") = Nothing + 'If ObjProspectos.GetRespuestas(-1, -1) Then Application("GlobalDTProspectosEncuestasRespuestas") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosEncuestasRespuestas") = Nothing + 'End Using - GuardaLogAsax(String.Format("Globalasax 11:{0}", DateTime.Now)) + 'GuardaLogAsax(String.Format("Globalasax 11:{0}", DateTime.Now)) '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 'C L A S I F I C A C I O N E S - Using ObjClasificaciones As New ClsClasificaciones() + 'Using ObjClasificaciones As New ClsClasificaciones() - '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - 'F A M I L I A S - If ObjClasificaciones.GetClasificaciones(Tipo:=2) Then Application("GlobalDTSubFamilias") = ObjClasificaciones.DtResultados Else Application("GlobalDTSubFamilias") = Nothing + '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + 'F A M I L I A S + 'If ObjClasificaciones.GetClasificaciones(Tipo:=2) Then Application("GlobalDTSubFamilias") = ObjClasificaciones.DtResultados Else Application("GlobalDTSubFamilias") = Nothing - '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - 'P R E S U P U E S T O - If ObjClasificaciones.GetClasificaciones(Tipo:=3) Then Application("GlobalDTClasificacionesPresupuestos") = ObjClasificaciones.DtResultados Else Application("GlobalDTClasificacionesPresupuestos") = Nothing + '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + 'P R E S U P U E S T O + 'If ObjClasificaciones.GetClasificaciones(Tipo:=3) Then Application("GlobalDTClasificacionesPresupuestos") = ObjClasificaciones.DtResultados Else Application("GlobalDTClasificacionesPresupuestos") = Nothing - '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - 'C L A S I F I C A C I O N E S 2 - If ObjClasificaciones.GetClasificaciones(Tipo:=4) Then Application("GlobalDTClasificaciones2") = ObjClasificaciones.DtResultados Else Application("GlobalDTClasificaciones2") = Nothing - End Using - GuardaLogAsax(String.Format("Globalasax 20:{0}", DateTime.Now)) + '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + 'C L A S I F I C A C I O N E S 2 + 'If ObjClasificaciones.GetClasificaciones(Tipo:=4) Then Application("GlobalDTClasificaciones2") = ObjClasificaciones.DtResultados Else Application("GlobalDTClasificaciones2") = Nothing + 'End Using + 'GuardaLogAsax(String.Format("Globalasax 20:{0}", DateTime.Now)) '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ '------------------------------------------------------------------------------S I S T E M A ---------------------------------------------------------------------------------- @@ -162,11 +161,11 @@ '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 'C O M B U S T I B L E S - Using ObjFlotillas As New ClsFlotillas - If ObjFlotillas.GetCombustibles() Then Application("GlobalDTCombustibles") = ObjFlotillas.DtResultados Else Application("GlobalDTCombustibles") = Nothing - If ObjFlotillas.GetCombustiblesTipos(-1) Then Application("GlobalDTCombustiblesTipos") = ObjFlotillas.DtResultados Else Application("GlobalDTCombustiblesTipos") = Nothing - End Using - GuardaLogAsax(String.Format("Globalasax 39:{0}", DateTime.Now)) + 'Using ObjFlotillas As New ClsFlotillas + 'If ObjFlotillas.GetCombustibles() Then Application("GlobalDTCombustibles") = ObjFlotillas.DtResultados Else Application("GlobalDTCombustibles") = Nothing + 'If ObjFlotillas.GetCombustiblesTipos(-1) Then Application("GlobalDTCombustiblesTipos") = ObjFlotillas.DtResultados Else Application("GlobalDTCombustiblesTipos") = Nothing + 'End Using + 'GuardaLogAsax(String.Format("Globalasax 39:{0}", DateTime.Now)) '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ diff --git a/Prospectos/CatClasificacionesCaracteristicas.aspx.vb b/Prospectos/CatClasificacionesCaracteristicas.aspx.vb index 926596cdd..a6d181150 100644 --- a/Prospectos/CatClasificacionesCaracteristicas.aspx.vb +++ b/Prospectos/CatClasificacionesCaracteristicas.aspx.vb @@ -396,20 +396,11 @@ Partial Class Prospectos_CatClasificacionesCaracteristicas End If End Sub Public Sub CargaDatosO() - Dim ObjCaracteristicasOpciones As New ClsProspectos - If ObjCaracteristicasOpciones.GetCaracteristicasOpciones(-1, UsuarioActual.CveEmpresa) Then - ViewState("DTCaracteristicasOpciones") = ObjCaracteristicasOpciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - If CType(ViewState("DTCaracteristicasOpciones"), DataTable).Columns.Count = 0 Then - ViewState("DTCaracteristicasOpciones") = ObjCaracteristicasOpciones.DtResultados - End If - - GlobalDTProspectosCaracteristicasOpciones() = ObjCaracteristicasOpciones.DtResultados - Else - GvDatosOpciones.DataSource = Nothing + ViewState("DTCaracteristicasOpciones") = GlobalDTProspectosCaracteristicasOpciones(UsuarioActual.CveEmpresa, -1) + If CType(ViewState("DTCaracteristicasOpciones"), DataTable).Columns.Count = 0 Then + ViewState("DTCaracteristicasOpciones") = GlobalDTProspectosCaracteristicasOpciones(-1, -1) End If - ObjCaracteristicasOpciones.Dispose() - If ViewState("OrdenO").ToString() <> String.Empty Then CargaGridO(ViewState("OrdenO").ToString()) Else @@ -439,7 +430,7 @@ Partial Class Prospectos_CatClasificacionesCaracteristicas TxtOpcion.Text = "" Alert("La nueva Opción para Característica se guardó correctamente.", TipoMensaje.MsgInformacion) ViewState("DTCaracteristicasOpciones") = ObjCaracteristicasOpciones.DtResultados - GlobalDTProspectosCaracteristicasOpciones() = ObjCaracteristicasOpciones.DtResultados + GlobalDTProspectosCaracteristicasOpciones(UsuarioActual.CveEmpresa, -1) = ObjCaracteristicasOpciones.DtResultados CambioCaracteristicasOpciones() End If @@ -615,7 +606,7 @@ Partial Class Prospectos_CatClasificacionesCaracteristicas If ObjCaracteristicasOpciones.RemoveCaracteristicasOpciones(GvDatosOpciones.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then GvDatosOpciones.EditIndex = -1 ViewState("DTCaracteristicasOpciones") = ObjCaracteristicasOpciones.DtResultados - GlobalDTProspectosCaracteristicasOpciones() = ObjCaracteristicasOpciones.DtResultados + GlobalDTProspectosCaracteristicasOpciones(UsuarioActual.CveEmpresa, -1) = ObjCaracteristicasOpciones.DtResultados Alert("La Opción para Característica se eliminó correctamente.", TipoMensaje.MsgInformacion) CambioCaracteristicasOpciones() @@ -732,7 +723,7 @@ Partial Class Prospectos_CatClasificacionesCaracteristicas If ObjCaracteristicasOpciones.UpdateCaracteristicasOpciones(CaracteristicaOpcion, CveCaracteristica, Estatus, CveCaracteristicaOpcion) Then GvDatosOpciones.EditIndex = -1 ViewState("DTCaracteristicasOpciones") = ObjCaracteristicasOpciones.DtResultados - GlobalDTProspectosCaracteristicasOpciones() = ObjCaracteristicasOpciones.DtResultados + GlobalDTProspectosCaracteristicasOpciones(UsuarioActual.CveEmpresa, -1) = ObjCaracteristicasOpciones.DtResultados Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) CambioCaracteristicasOpciones() From 0510cc5c67e4d345fdf8d0f04cab44f907ace8ad Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 23 Feb 2023 23:40:52 -0700 Subject: [PATCH 09/20] -- cambios --- App_Code/ClsPaginas.vb | 4 ++-- Global.asax | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 70773458b..806e4381f 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -2466,7 +2466,7 @@ Public Class ClsPaginas 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 + Public Shared Property GlobalDTActivoFijos(CveEmpresa As Integer, Optional CveSubTipoActivoFijo As Integer = -1, Optional CveActivoFijo As Integer = -1) As DataTable Get Dim AppNombre As String = $"GlobalDTActivoFijo-{CveEmpresa}" If HttpContext.Current.Application(AppNombre) Is Nothing Then @@ -2483,7 +2483,7 @@ Public Class ClsPaginas End Get Set(ByVal value As DataTable) Dim AppNombre As String = $"GlobalDTActivoFijo-{CveEmpresa}" - Application(AppNombre) = value + HttpContext.Current.Application(AppNombre) = value End Set End Property Public Shared Property GlobalDTEstadoActivoFijo() As DataTable diff --git a/Global.asax b/Global.asax index c9642f892..9e47534f9 100644 --- a/Global.asax +++ b/Global.asax @@ -185,7 +185,7 @@ BundleConfig.RegistrarBundles(BundleTable.Bundles) BundleTable.EnableOptimizations = True - System.Web.UI.ValidationSettings.UnobtrusiveValidationMode = UnobtrusiveValidationMode.None + ' System.Web.UI.ValidationSettings.UnobtrusiveValidationMode = UnobtrusiveValidationMode.None Dim EmpresaNotificaciones As New Empresa With {.SendMail = "signotificaciones@adssistemas.mx", .SendMailPassword = "sig123987", .SendMailServer = "mail.adssistemas.mx", .SendMailPuerto = 587} ClsPaginas.EmpresaNotificaciones = EmpresaNotificaciones @@ -228,9 +228,9 @@ End Sub Sub Application_End(sender As Object, e As EventArgs) - If EsProduccion = "1" Then - SqlDependency.Stop(ConfigurationManager.ConnectionStrings("Conexion").ConnectionString) - End If + 'If EsProduccion = "1" Then + ' SqlDependency.Stop(ConfigurationManager.ConnectionStrings("Conexion").ConnectionString) + 'End If ' Code that runs on application shutdown End Sub From ac9a43a9b34321cd5ecf727a1c3be5d76aaae159 Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 23 Feb 2023 23:41:13 -0700 Subject: [PATCH 10/20] parametros enviados a prepolizasdetalle --- Bancos/FluctuacionCambiaria.aspx | 6 +++--- Bancos/FluctuacionCambiaria.aspx.vb | 17 ++++++++++------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Bancos/FluctuacionCambiaria.aspx b/Bancos/FluctuacionCambiaria.aspx index 8c8b8769a..8d2b2f78b 100644 --- a/Bancos/FluctuacionCambiaria.aspx +++ b/Bancos/FluctuacionCambiaria.aspx @@ -368,7 +368,7 @@ CssClass="table table-hover table-striped ScrollAD mysmallbtn" GridLines="None"> - + @@ -475,7 +475,7 @@
@@ -696,7 +696,7 @@ CssClass="table table-hover table-striped ScrollAD mysmallbtn" GridLines="None"> - + diff --git a/Bancos/FluctuacionCambiaria.aspx.vb b/Bancos/FluctuacionCambiaria.aspx.vb index 0257fb67f..f8e7000b9 100644 --- a/Bancos/FluctuacionCambiaria.aspx.vb +++ b/Bancos/FluctuacionCambiaria.aspx.vb @@ -435,7 +435,7 @@ Partial Class Bancos_FluctuacionCambiaria IdCtaComplementaria = gvr.DataKey("IdCtaContComplementaria").ToString.ToEntero() 'movimiento de complementaria - If Not Conta.AddPrePolizasDetalle(CvePrePoliza, True, Total, gvr.DataKey("SerieFolio"), gvr.DataKey("CveConceptoContable").ToEntero, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, TipoCambioPago:=gvr.DataKey("TipoCambio").ToDecimal, ImporteMX:=Total, ImporteME:=Total, CveIE:=gvr.DataKey("CveIE").ToEntero) Then + If Not Conta.AddPrePolizasDetalle(CvePrePoliza, True, Total, gvr.DataKey("SerieFolio"), gvr.DataKey("CveConceptoContable").ToEntero, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, TipoCambioPago:=gvr.DataKey("TipoCambio").ToDecimal, ImporteMX:=Total, ImporteME:=Total, CveIE:=gvr.DataKey("CveIE").ToEntero, CveProveedor:=gvr.DataKey("CveProveedor").ToEntero) Then ErrorRegistrar = True Exit For End If @@ -515,7 +515,7 @@ Partial Class Bancos_FluctuacionCambiaria IdCtaComplementaria = gvr.DataKey("IdCtaContComplementaria").ToString.ToEntero() 'movimiento de complementaria - If Not Conta.AddPrePolizasDetalle(CvePrePoliza, False, Total, gvr.DataKey("SerieFolio"), gvr.DataKey("CveConceptoContable").ToEntero, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, TipoCambioPago:=gvr.DataKey("TipoCambio").ToDecimal, ImporteMX:=Total, ImporteME:=Total, CveIE:=gvr.DataKey("CveIE").ToEntero) Then + If Not Conta.AddPrePolizasDetalle(CvePrePoliza, False, Total, gvr.DataKey("SerieFolio"), gvr.DataKey("CveConceptoContable").ToEntero, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, TipoCambioPago:=gvr.DataKey("TipoCambio").ToDecimal, ImporteMX:=Total, ImporteME:=Total, CveIE:=gvr.DataKey("CveIE").ToEntero, CveProveedor:=gvr.DataKey("CveProveedor").ToEntero) Then ErrorRegistrar = True Exit For End If @@ -526,7 +526,11 @@ Partial Class Bancos_FluctuacionCambiaria End If Next - Banco.UpdateFluctuacionesBitacoraPrePoliza(CvePrePoliza, 2, CveBitacora, UsuarioActual.CveEmpresa) + If Not ErrorRegistrar Then + If Not Banco.UpdateFluctuacionesBitacoraPrePoliza(CvePrePoliza, 2, CveBitacora, UsuarioActual.CveEmpresa) Then + ErrorRegistrar = True + End If + End If End If @@ -538,6 +542,7 @@ Partial Class Bancos_FluctuacionCambiaria Conta.RollBack() Alert("Error al generar la fluctuación", TipoMensaje.MsgError) End If + Banco.Dispose() Conta.Dispose() End Sub @@ -613,7 +618,7 @@ Partial Class Bancos_FluctuacionCambiaria End If 'movimiento de complementaria - If Not Conta.AddPrePolizasDetalle(CvePrePoliza, False, Total, gvr.DataKey("SerieFolio"), CveConconceptoCliente, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveVenta:=gvr.DataKey("CveVenta").ToEntero, TipoCambio:=TC, TipoCambioPago:=gvr.DataKey("TipoCambio").ToDecimal, ImporteMX:=Total, ImporteME:=Total, CveIE:=gvr.DataKey("CveIE").ToEntero) Then + If Not Conta.AddPrePolizasDetalle(CvePrePoliza, False, Total, gvr.DataKey("SerieFolio"), CveConconceptoCliente, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveVenta:=gvr.DataKey("CveVenta").ToEntero, TipoCambio:=TC, TipoCambioPago:=gvr.DataKey("TipoCambio").ToDecimal, ImporteMX:=Total, ImporteME:=Total, CveIE:=gvr.DataKey("CveIE").ToEntero, CveCliente:=gvr.DataKey("CveCliente").ToEntero) Then ErrorRegistrar = True Exit For End If @@ -796,7 +801,7 @@ Partial Class Bancos_FluctuacionCambiaria IdCtaComplementaria = gvr.DataKey("IdCtaContComplementaria").ToString().ToEntero() 'movimiento de complementaria - If Not Conta.AddPrePolizasDetalle(CvePrePoliza, True, Total, gvr.DataKey("SerieFolio"), 202, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, TipoCambioPago:=gvr.DataKey("TipoCambio").ToDecimal, ImporteMX:=Total, ImporteME:=Total, CveIE:=gvr.DataKey("CveIE").ToEntero) Then + If Not Conta.AddPrePolizasDetalle(CvePrePoliza, True, Total, gvr.DataKey("SerieFolio"), 202, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, TipoCambioPago:=gvr.DataKey("TipoCambio").ToDecimal, ImporteMX:=Total, ImporteME:=Total, CveIE:=gvr.DataKey("CveIE").ToEntero, CveProveedor:=gvr.DataKey("CveProveedor").ToEntero) Then ErrorRegistrar = True Exit For End If @@ -936,7 +941,6 @@ Partial Class Bancos_FluctuacionCambiaria Dim IdCtaComplementaria As Integer = gvr.DataKey("IdCtaAfectable").ToEntero Dim ConceptoReferencia As String = String.Format("{0} - {1} {2}", gvr.DataKey("Banco"), gvr.DataKey("NumCuenta"), MesTCtexto) - 'MOVIMIENTO DE FLUCTUACION If Total > 0 Then CveConceptoContable = 64 @@ -1268,7 +1272,6 @@ Partial Class Bancos_FluctuacionCambiaria Banco.Dispose() End Sub - Protected Sub BtnAcreedoresAntRemove_Click(sender As Object, e As EventArgs) Dim Banco As New ClsBancos Banco.IniciaTransacSQL() From 8e1b8fb258f93bf13071cf5c7d061639d090e301 Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 23 Feb 2023 23:41:38 -0700 Subject: [PATCH 11/20] globaldtAC --- Sistemas/CatSesiones.aspx | 1 + Sistemas/CatSesiones.aspx.vb | 31 ++++++++++++++++++++++++++----- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/Sistemas/CatSesiones.aspx b/Sistemas/CatSesiones.aspx index d4ca5c726..1fa95012e 100644 --- a/Sistemas/CatSesiones.aspx +++ b/Sistemas/CatSesiones.aspx @@ -63,6 +63,7 @@ +    diff --git a/Sistemas/CatSesiones.aspx.vb b/Sistemas/CatSesiones.aspx.vb index e7ff562d9..58cea5074 100644 --- a/Sistemas/CatSesiones.aspx.vb +++ b/Sistemas/CatSesiones.aspx.vb @@ -104,7 +104,9 @@ Partial Class Sistemas_CatSesiones ElseIf DdlVariable.SelectedItem.Value = "GlobalDTActivoFijos" Then CargaActivoFijos() ElseIf DdlVariable.SelectedItem.Value = "GlobalDTVendedoresOld" Then - CargaActivoFijos() + CargaActivoFijos() + ElseIf DdlVariable.SelectedItem.Value = "GlobalDTAC" Then + cargaAC() End If @@ -362,10 +364,29 @@ Partial Class Sistemas_CatSesiones ObjEmp.Dispose() 'Fin Carga Empresas End Sub - Private Sub carga1() - Dim ObjAC As New ClsAC - If ObjAC.GetClasificacionFuncional() Then Application("GlobalDTAC_ClasificacionFuncional") = ObjAC.DtResultados - ObjAC.Dispose() + Private Sub cargaAC() + Using ObjAC As New ClsAC + If ObjAC.GetClasificacionFuncional() Then Application("GlobalDTAC_ClasificacionFuncional") = ObjAC.DtResultados Else Application("GlobalDTAC_ClasificacionFuncional") = Nothing + If ObjAC.GetClasificacionGeografica() Then Application("GlobalDTAC_ClasificacionGeografica") = ObjAC.DtResultados Else Application("GlobalDTAC_ClasificacionGeografica") = Nothing + If ObjAC.GetFuentesFinanciamiento() Then Application("GlobalDTAC_FuentesFinanciamiento") = ObjAC.DtResultados Else Application("GlobalDTAC_FuentesFinanciamiento") = Nothing + If ObjAC.GetFuenteFinanciamientoCONAC() Then Application("GlobalDTAC_FuentesFinanciamientoCONAC") = ObjAC.DtResultados Else Application("GlobalDTAC_FuentesFinanciamientoCONAC") = Nothing + If ObjAC.GetProgramaCONAC() Then Application("GlobalDTAC_ProgramasCONAC") = ObjAC.DtResultados Else Application("GlobalDTAC_ProgramasCONAC") = Nothing + If ObjAC.GetUnidadesAdministrativas() Then Application("GlobalDTAC_UnidadesAdministrativas") = ObjAC.DtResultados Else Application("GlobalDTAC_UnidadesAdministrativas") = Nothing + If ObjAC.GetClasificacionAdministrativa() Then Application("GlobalDTAC_ClasificacionAdministrativa") = ObjAC.DtResultados Else Application("GlobalDTAC_ClasificacionAdministrativa") = Nothing + If ObjAC.GetPD_EjeRector() Then Application("GlobalDTAC_PD_EjeRector") = ObjAC.DtResultados Else Application("GlobalDTAC_PD_EjeRector") = Nothing + If ObjAC.GetPD_Programas() Then Application("GlobalDTAC_PD_Programas") = ObjAC.DtResultados Else Application("GlobalDTAC_PD_Programas") = Nothing + If ObjAC.GetPD_Estrategias() Then Application("GlobalDTAC_PD_Estrategias") = ObjAC.DtResultados Else Application("GlobalDTAC_PD_Estrategias") = Nothing + If ObjAC.GetPD_LineasAccion() Then Application("GlobalDTAC_PD_LineasAccion") = ObjAC.DtResultados Else Application("GlobalDTAC_PD_LineasAccion") = Nothing + If ObjAC.GetPD_Metas() Then Application("GlobalDTAC_PD_Metas") = ObjAC.DtResultados Else Application("GlobalDTAC_PD_Metas") = Nothing + If ObjAC.GetTipoGasto() Then Application("GlobalDTAC_TipoGasto") = ObjAC.DtResultados Else Application("GlobalDTAC_TipoGasto") = Nothing + If ObjAC.GetProgramaOperativo() Then Application("GlobalDTAC_ProgramaOperativo") = ObjAC.DtResultados Else Application("GlobalDTAC_ProgramaOperativo") = Nothing + If ObjAC.GetFuentesFinanciamiento() Then Application("GlobalDTAC_FuentesFinanciamiento") = ObjAC.DtResultados Else Application("GlobalDTAC_FuentesFinanciamiento") = Nothing + If ObjAC.GetRubrosIngreso() Then Application("GlobalDTAC_RubrosIngreso") = ObjAC.DtResultados Else Application("GlobalDTAC_RubrosIngreso") = Nothing + If ObjAC.GetFuentesRecaudacion() Then Application("GlobalDTAC_FuentesRecaudacion") = ObjAC.DtResultados Else Application("GlobalDTAC_FuentesRecaudacion") = Nothing + If ObjAC.GetMatrizID Then Application("GlobalDTAC_MatrizIngresos") = ObjAC.DtResultados Else Application("GlobalDTAC_MatrizIngresos") = Nothing + If ObjAC.GetMatrizGD Then Application("GlobalDTAC_MatrizEgresos") = ObjAC.DtResultados Else Application("GlobalDTAC_MatrizEgresos") = Nothing + + End Using End Sub Private Sub CargaMonedas() 'Carga Monedas From ea4601b3d157b93dfe4c9a0d983e6fe25f906129 Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 23 Feb 2023 23:42:50 -0700 Subject: [PATCH 12/20] -- subproyeccto de Af --- AF/RepDepreciacion.aspx | 2 +- AF/RepDepreciacion.aspx.vb | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/AF/RepDepreciacion.aspx b/AF/RepDepreciacion.aspx index 81b4c087e..1c991098c 100644 --- a/AF/RepDepreciacion.aspx +++ b/AF/RepDepreciacion.aspx @@ -97,7 +97,7 @@
- + diff --git a/AF/RepDepreciacion.aspx.vb b/AF/RepDepreciacion.aspx.vb index ca2c7f659..63e255224 100644 --- a/AF/RepDepreciacion.aspx.vb +++ b/AF/RepDepreciacion.aspx.vb @@ -30,11 +30,12 @@ Partial Class AF_RepDepreciacion Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL()) Dim ErrorMovInv As Boolean = False Dim ConceptoPoliza As String = String.Format("Depreciación - {0}", txtFechaI.Text) - Dim CveSubProyecto As Integer = DdlSubProyecto.SelectedValue.ToEntero + Dim CveSubProyecto As Integer ' = DdlSubProyecto.SelectedValue.ToEntero Dim CvePrePoliza = ObjConta.AddPrePolizas("Depreciacion", 74, 0, 0, 1, txtFechaI.Text.ToDate, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) For Each RowsDt As GridViewRow In GvDatos.Rows CveActivoFijo = RowsDt.DataKey("CveActivoFijo").ToEntero + CveSubProyecto = RowsDt.DataKey("CveSubProyecto").ToEntero Dim MontoDepreciacion As Decimal = RowsDt.FCLiteral("LtlDepreciacionMensual").Text.ToDecimal If MontoDepreciacion > 0 And CveActivoFijo <> 0 Then Dim ConceptoPolizaDetalle As String = String.Format("Depreciación - {0} - {1}", txtFechaI.Text, RowsDt.FCLiteral("LtlDescripcion").Text) From 6bef46a90de85fbd1dd6b9b1a8e91b4487771cd4 Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 23 Feb 2023 23:43:51 -0700 Subject: [PATCH 13/20] --addprepolizasdetalle, identifiicar AF,proveedor,cliente --- App_Code/ClsContabilidad.vb | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index 952337c9a..92b5aa4d1 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -1019,21 +1019,25 @@ Public Class ClsContabilidad Dim dtt As DataTable = ClsPaginas.GlobalDTContaConceptosContables(CveConceptoContable) Dim StrMsg As String = "" If dtt IsNot Nothing Then + Dim tCveEmp As Integer = CType(HttpContext.Current.Session("UsuarioSIG"), Usuario).CveEmpresa Dim dr As Data.DataRow = dtt.FiltroPrimero("") If dr IsNot Nothing Then StrMsg = dr("ConceptoContable").ToString If dr("AplicaClasificacion").ToString = "True" Then - StrMsg = StrMsg + " - Clasificación: " + ClsPaginas.GlobalDTClasificaciones(CType(HttpContext.Current.Session("UsuarioSIG"), Usuario).CveEmpresa, CveClasificacion:=CveClasificacion).FiltroPrimeroValor("Clasificacion", "") + StrMsg = StrMsg + " - Clasificación: " + ClsPaginas.GlobalDTClasificaciones(tCveEmp, CveClasificacion:=CveClasificacion).FiltroPrimeroValor("Clasificacion", "") + End If + If dr("AplicaActivoFijo").ToString = "True" Then + StrMsg = StrMsg + " - Activo Fijo: " + ClsPaginas.GlobalDTActivoFijos(tCveEmp, CveActivoFijo:=CveActivoFijo).FiltroPrimeroValor("CodigoDescripcion", "") + End If + If dr("AplicaProveedor").ToString = "True" Then + StrMsg = StrMsg + " - Proveedor: " + ClsPaginas.GlobalDTCompProveedores(tCveEmp, CveProveedor:=CveProveedor).FiltroPrimeroValor("NombreComercial", "") End If End If End If OnError(String.Format("El concepto '{0}' no tiene especificada la cuenta. Favor de especificarla en la asignación de cuentas.", StrMsg), ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - ElseIf ex1.Message.Contains("Vw_Val_Conta_CuentasResultados_SubProyectos") Then - Dim Concepto2 As String = ClsPaginas.GlobalDTContaConceptosContables(CveConceptoContable).FiltroPrimeroValor("ConceptoContable") - OnError(String.Format("El concepto '{0}' requiere centro de costo", Concepto2), ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - ElseIf ex1.Message.Contains("UK_Vw_Val_Conta_CuentasResultados_SubProyectos") Then - Dim Concepto3 As String = ClsPaginas.GlobalDTContaConceptosContables(CveConceptoContable).FiltroPrimeroValor("ConceptoContable") - OnError(String.Format("El concepto '{0}' requiere centro de costo", Concepto3), ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + ElseIf ex1.Message.Contains("Vw_Val_Conta_CuentasResultados_SubProyectos") OrElse ex1.Message.Contains("UK_Vw_Val_Conta_CuentasResultados_SubProyectos") Then + Dim Concepto2 As String = ClsPaginas.GlobalDTContaConceptosContables(CveConceptoContable).FiltroPrimeroValor("ConceptoContable") + OnError(String.Format("El concepto '{0}' requiere centro de costo", Concepto2), ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) ElseIf ex1.Message.Contains("50025;") Then OnError("La empresa no tiene un formato de cuenta asignado.", ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) ElseIf ex1.Message.Contains("50026;") Then From a9b2d60b0fada5e308d383514c60050e70887a82 Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 23 Feb 2023 23:44:52 -0700 Subject: [PATCH 14/20] --duplicados --- Finanzas/RepBalanceGeneralHorizontal2.aspx | 1592 ------------ Finanzas/RepBalanceGeneralHorizontal2.aspx.vb | 2295 ----------------- 2 files changed, 3887 deletions(-) delete mode 100644 Finanzas/RepBalanceGeneralHorizontal2.aspx delete mode 100644 Finanzas/RepBalanceGeneralHorizontal2.aspx.vb diff --git a/Finanzas/RepBalanceGeneralHorizontal2.aspx b/Finanzas/RepBalanceGeneralHorizontal2.aspx deleted file mode 100644 index cb5a8067e..000000000 --- a/Finanzas/RepBalanceGeneralHorizontal2.aspx +++ /dev/null @@ -1,1592 +0,0 @@ -<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepBalanceGeneralHorizontal2.aspx.vb" Inherits="Contabilidad_RepBalanceGeneralHorizontal2" %> - - - - - - - - - - - - - -
  • - Generar Excel -
  • -
  • - Graficar -
  • -
    - - - - -
    -
    -
    - -
    -
    -
    -
      - - -
      - - -
      - - -
      - - -
      - - -
      - - - - - - - - - - - - - - -
      - - - -
      - - -
      - - -
      - - - - - -
      - - -
      - - NO - Trimestre - Cuatrimestre - -
      - -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - <%-- --%> - - - - - - - - <%-- --%> - - - - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    - - - - - - - - - - -
    -

    Resultados del Ejercicio:

    -
    - - - -
    -
    -
    - -
    -
    - - - - - - - - - - -
    - - - - - - - - - - <%----%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <%-- - - - - - --%> - - <%----%> - - - - - - - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <%-- - - - - - --%> - - <%-- --%> - - - - - - - - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - - - - - -
    - - - - - - - - - - <%----%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - - - - - <%----%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <%-- - - - - - --%> - - <%-- --%> - - - - - - - - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <%-- - - - - - --%> - <%-- --%> - - - - - - - - - - - -
    -
    -
    - - - - - - - - - - - - - - - -
    -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <%-- - - - - - --%> - - <%----%> - - - - - - - <%----%> - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <%-- - - - - - --%> - - <%-- --%> - - - - - - - - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    - - - - - - - -
    -
    -
    - - - - - - - -
    - - - - - - - - - - - diff --git a/Finanzas/RepBalanceGeneralHorizontal2.aspx.vb b/Finanzas/RepBalanceGeneralHorizontal2.aspx.vb deleted file mode 100644 index 3a01281cf..000000000 --- a/Finanzas/RepBalanceGeneralHorizontal2.aspx.vb +++ /dev/null @@ -1,2295 +0,0 @@ -Option Explicit On -Option Strict On - -Imports System.Data -Imports System.Drawing -Imports System.IO -Imports Extensiones -Imports GemBox.Spreadsheet -Imports Microsoft.Reporting.WebForms - -Partial Class Contabilidad_RepBalanceGeneralHorizontal2 - Inherits ClsPaginas - -#Region "PROPIEDADES" - - - Private Property DtDatosMes As DataTable - Get - DtDatosMes = DirectCast(ViewState("DtDatosMes"), DataTable) - End Get - - Set(ByVal value As DataTable) - ViewState("DtDatosMes") = value - End Set - End Property - - Private Property DtIngresosMes As DataTable - Get - DtIngresosMes = DirectCast(ViewState("DtIngresosMes"), DataTable) - End Get - - Set(ByVal value As DataTable) - ViewState("DtIngresosMes") = value - End Set - End Property - Private Property DtGastosMes As DataTable - Get - DtGastosMes = DirectCast(ViewState("DtGastosMes"), DataTable) - End Get - - Set(ByVal value As DataTable) - ViewState("DtGastosMes") = value - End Set - End Property - Private Property TotalActualMes As Double - Get - TotalActualMes = ViewState("TotalActualMes").ToString.ToDouble - End Get - Set(value As Double) - ViewState("TotalActualMes") = value - End Set - End Property - Private Property TotalAnteriorMes As Double - Get - TotalAnteriorMes = ViewState("TotalAnteriorMes").ToString.ToDouble - End Get - Set(value As Double) - ViewState("TotalAnteriorMes") = value - End Set - End Property - Private Property FechaIMes As String - Get - Return ViewState("FechaIMes").ToString - End Get - Set(value As String) - ViewState("FechaIMes") = value - End Set - End Property - Private Property FechaFMes As String - Get - Return ViewState("FechaFMes").ToString - End Get - Set(value As String) - ViewState("FechaFMes") = value - End Set - End Property - - Private Property listacolores As List(Of String) - Get - Return DirectCast(ViewState("listacolores"), List(Of String)) - End Get - Set(value As List(Of String)) - ViewState("listacolores") = value - End Set - End Property - - Private Property listaCampos As List(Of String()) - Get - Return DirectCast(ViewState("listaCampos"), List(Of String())) - End Get - Set(value As List(Of String())) - ViewState("listaCampos") = value - End Set - End Property - Private Property listaCamposanios As List(Of String()) - Get - Return DirectCast(ViewState("listaCamposanios"), List(Of String())) - End Get - Set(value As List(Of String())) - ViewState("listaCamposanios") = value - End Set - End Property - Private Property listaCamposaniosGastos As List(Of String()) - Get - Return DirectCast(ViewState("listaCamposaniosGastos"), List(Of String())) - End Get - Set(value As List(Of String())) - ViewState("listaCamposaniosGastos") = value - End Set - End Property - Private Property listaCamposaniosTotal As List(Of String()) - Get - Return DirectCast(ViewState("listaCamposaniosTotal"), List(Of String())) - End Get - Set(value As List(Of String())) - ViewState("listaCamposaniosTotal") = value - End Set - End Property - - 'Private Property ReporteComplementario As Boolean - ' Get - ' ReporteComplementario = CBool(ViewState("ReporteComplementario").ToString) - ' End Get - ' Set(value As Boolean) - ' ViewState("ReporteComplementario") = value - ' End Set - 'End Property - -#End Region - - -#Region " M E S H O R I Z O N T A L " - - Private Property DtDatosMesH As DataTable - Get - DtDatosMesH = DirectCast(ViewState("DtDatosMesH"), DataTable) - End Get - - Set(ByVal value As DataTable) - ViewState("DtDatosMesH") = value - End Set - End Property - - Private Property DtIngresosMesH As DataTable - Get - DtIngresosMesH = DirectCast(ViewState("DtIngresosMesH"), DataTable) - End Get - - Set(ByVal value As DataTable) - ViewState("DtIngresosMesH") = value - End Set - End Property - - Private Property DtGastosMesH As DataTable - Get - DtGastosMesH = DirectCast(ViewState("DtGastosMesH"), DataTable) - End Get - - Set(ByVal value As DataTable) - ViewState("DtGastosMesH") = value - End Set - End Property - - Private Property DTTotalesMesH As DataTable - Get - DTTotalesMesH = DirectCast(ViewState("DTTotalesMesH"), DataTable) - End Get - - Set(ByVal value As DataTable) - ViewState("DTTotalesMesH") = value - End Set - End Property - -#End Region - - -#Region " A N U A L H O R I Z O N T A L " - - Private Property DtDatosAnualH As DataTable - Get - DtDatosAnualH = DirectCast(ViewState("DtDatosAnualH"), DataTable) - End Get - - Set(ByVal value As DataTable) - ViewState("DtDatosAnualH") = value - End Set - End Property - - Private Property DtIngresosAnualH As DataTable - Get - DtIngresosAnualH = DirectCast(ViewState("DtIngresosAnualH"), DataTable) - End Get - - Set(ByVal value As DataTable) - ViewState("DtIngresosAnualH") = value - End Set - End Property - - Private Property DtGastosAnualH As DataTable - Get - DtGastosAnualH = DirectCast(ViewState("DtGastosAnualH"), DataTable) - End Get - - Set(ByVal value As DataTable) - ViewState("DtGastosAnualH") = value - End Set - End Property - - Private Property DTTotalesAnualH As DataTable - Get - DTTotalesAnualH = DirectCast(ViewState("DTTotalesAnualH"), DataTable) - End Get - - Set(ByVal value As DataTable) - ViewState("DTTotalesAnualH") = value - End Set - End Property - - - Private Property CountDinamicoAnual As Integer - - Get - If ViewState("CountDinamicoAnual") Is Nothing Then - Return 0 - Else - Return ViewState("CountDinamicoAnual").ToString.ToEntero - End If - - End Get - Set(value As Integer) - ViewState("CountDinamicoAnual") = value - End Set - End Property - -#End Region - -#Region " S U B P R O Y E C T O H O R I Z O N T A L " - - Private Property DtDatosSubProyectoH As DataTable - Get - DtDatosSubProyectoH = DirectCast(ViewState("DtDatosSubProyectoH"), DataTable) - End Get - - Set(ByVal value As DataTable) - ViewState("DtDatosSubProyectoH") = value - End Set - End Property - - Private Property DtIngresosSubProyectoH As DataTable - Get - DtIngresosSubProyectoH = DirectCast(ViewState("DtIngresosSubProyectoH"), DataTable) - End Get - - Set(ByVal value As DataTable) - ViewState("DtIngresosSubProyectoH") = value - End Set - End Property - - Private Property DtGastosSubProyectoH As DataTable - Get - DtGastosSubProyectoH = DirectCast(ViewState("DtGastosSubProyectoH"), DataTable) - End Get - - Set(ByVal value As DataTable) - ViewState("DtGastosSubProyectoH") = value - End Set - End Property - - Private Property DTTotalesSubProyectoH As DataTable - Get - DTTotalesSubProyectoH = DirectCast(ViewState("DTTotalesSubProyectoH"), DataTable) - End Get - - Set(ByVal value As DataTable) - ViewState("DTTotalesSubProyectoH") = value - End Set - End Property - - Private Property DTSubProyectosCabecerasH As DataTable - - Get - DTSubProyectosCabecerasH = DirectCast(ViewState("DTSubProyectosCabecerasH"), DataTable) - End Get - - Set(ByVal value As DataTable) - ViewState("DTSubProyectosCabecerasH") = value - End Set - - End Property - - - Private Property CountDinamicoSubProyecto As Integer - - Get - If ViewState("CountDinamicoSubProyecto") Is Nothing Then - Return 0 - Else - Return ViewState("CountDinamicoSubProyecto").ToString.ToEntero - End If - - End Get - Set(value As Integer) - ViewState("CountDinamicoSubProyecto") = value - End Set - End Property - - -#End Region - - - Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load - If Not Page.IsPostBack Then - listacolores = New List(Of String) - listaCampos = New List(Of String()) - listaCamposanios = New List(Of String()) - listaCamposaniosGastos = New List(Of String()) - listaCamposaniosTotal = New List(Of String()) - listacolores.Add("#FF0F00") - listacolores.Add("#FF6600") - listacolores.Add("#F8FF01") - listacolores.Add("#04D215") - listacolores.Add("#2A0CD0") - listacolores.Add("#8A0CCF") - listacolores.Add("#CD0D74") - listacolores.Add("#754DEB") - listacolores.Add("#DDDDDD") - listacolores.Add("#999999") - listacolores.Add("#000000") - listacolores.Add("#FF0F00") - - TotalActualMes = 0 - TotalAnteriorMes = 0 - - CargaEjercicios() - - CargarCentrosDeCosto(Nothing, DdlSubproyecto, Nothing, LblSubProyecto) - TabSubProyecto.HeaderText = LblSubProyecto.Text & " " - - - - DdlEjercicio.SelectedValueExist(UsuarioActual.Empresa.EjercicioActual) - ValidaEjercicios() - - End If - End Sub - - Protected Sub Tab_ActiveTabChanged(sender As Object, e As EventArgs) - - If TAB.ActiveTabIndex = 0 Then - LiSubProyectoDdl.Visible = True - LiSubProyectoLbl.Visible = True - - LiEjercicioDdl.Visible = True - LiEjercicioLbl.Visible = True - - LiEjercicioDdl2.Visible = False - LiEjercicioLbl2.Visible = False - - LiPeriodoDdl.Visible = True - LiPeriodoLbl.Visible = True - - LiDivisorDdl.Visible = True - LiDivisorLbl.Visible = True - - LblTri.Visible = False - DVTri.Visible = False - End If - - If TAB.ActiveTabIndex = 1 Then - - LiSubProyectoDdl.Visible = True - LiSubProyectoLbl.Visible = True - - LiEjercicioDdl.Visible = True - LiEjercicioLbl.Visible = True - - LiEjercicioDdl2.Visible = False - LiEjercicioLbl2.Visible = False - - LiPeriodoDdl.Visible = True - LiPeriodoLbl.Visible = True - - LiDivisorDdl.Visible = True - LiDivisorLbl.Visible = True - - DdlPeriodo.SelectedValueExist(12) - - LblTri.Visible = True - DVTri.Visible = True - - - End If - - If TAB.ActiveTabIndex = 2 Then - - ValidaEjercicios() - - LiSubProyectoDdl.Visible = True - LiSubProyectoLbl.Visible = True - - LiEjercicioDdl.Visible = True - LiEjercicioLbl.Visible = True - - LiEjercicioDdl2.Visible = True - LiEjercicioLbl2.Visible = True - - LiPeriodoDdl.Visible = True - LiPeriodoLbl.Visible = True - - LiDivisorDdl.Visible = True - LiDivisorLbl.Visible = True - - LblTri.Visible = False - DVTri.Visible = False - - End If - - If TAB.ActiveTabIndex = 3 Then - LiSubProyectoDdl.Visible = True - LiSubProyectoLbl.Visible = True - - LiEjercicioDdl.Visible = True - LiEjercicioLbl.Visible = True - - LiEjercicioDdl2.Visible = False - LiEjercicioLbl2.Visible = False - - LiPeriodoDdl.Visible = True - LiPeriodoLbl.Visible = True - - LiDivisorDdl.Visible = True - LiDivisorLbl.Visible = True - - LblTri.Visible = False - DVTri.Visible = False - - End If - - UpFiltros.Update() - End Sub - - - Protected Sub DdlEjercicio_SelectedIndexChanged(sender As Object, e As EventArgs) - ValidaEjercicios() - End Sub - - Protected Sub DdlEjercicio2_SelectedIndexChanged(sender As Object, e As EventArgs) - ValidaEjercicios() - End Sub - - Private Sub ValidaEjercicios() - - - Dim EInicio As Integer = DdlEjercicio.SelectedValue.ToEntero - - - If EInicio > DdlEjercicio2.SelectedValue.ToEntero Then - - If DdlEjercicio2.Items.Count > 0 Then - DdlEjercicio2.SelectedIndex = DdlEjercicio2.Items.Count - 1 - End If - - Dim Fejerciosio As Integer = DdlEjercicio2.SelectedValue.ToEntero - - If Not EInicio + 1 > Fejerciosio Then - DdlEjercicio2.SelectedValueExist(EInicio + 1) - End If - - End If - - - UpFiltros.Update() - End Sub - - Private Sub CargaEjercicios() - 'Dim ClsConta As New ClsContPAQi(UsuarioActual.Empresa) - Dim ClsConta As New ClsContabilidad - If ClsConta.GetEjercicios(UsuarioActual.CveEmpresa) Then - DdlEjercicio.DataSource = ClsConta.DtResultados - DdlEjercicio2.DataSource = ClsConta.DtResultados - Else - DdlEjercicio.DataSource = Nothing - DdlEjercicio2.DataSource = Nothing - End If - ClsConta.Dispose() - DdlEjercicio.DataBind() - DdlEjercicio2.DataBind() - - DdlEjercicio.SelectedValueExist(UsuarioActual.Empresa.EjercicioActual.ToString) - If DdlEjercicio.Items.Count = 0 Then - DdlEjercicio.Items.Add(New ListItem(Now.Year.ToString, Now.Year.ToString)) - End If - DdlPeriodo.SelectedValue = Now.Month.ToString - End Sub - - Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) - TotalActualMes = 0 - TotalAnteriorMes = 0 - - 'Mes - If TAB.ActiveTabIndex = 0 Then - CargaDatosMes() - End If - - 'MES HORIZONTAL - If TAB.ActiveTabIndex = 1 Then - CargaDatosMesH() - End If - - 'AÑO HORIZONTAL - If TAB.ActiveTabIndex = 2 Then - - If DdlEjercicio.SelectedValue.ToEntero > DdlEjercicio2.SelectedValue.ToEntero Then - Alert("El ejercicio inicio no debe ser mayor al ejercicio fin.", TipoMensaje.MsgAdvertencia) - Exit Sub - End If - CargaDatosAnualH() - End If - - 'SUBPROYECTO - If TAB.ActiveTabIndex = 3 Then - CargaDatosSubProyectoH() - End If - - - - - End Sub - - -#Region "MES" - - - - - - Private Sub CargaDatosMes() - - - FechaIMes = String.Format("01/{0}/{1}", DdlPeriodo.SelectedValue.PadLeft(2, CChar("0")), DdlEjercicio.SelectedValue) - FechaFMes = DateAdd(DateInterval.Day, -1, DateAdd(DateInterval.Month, 1, CDate(FechaIMes))).ToString("dd/MM/yyyy") - 'Dim TipoReporte = DdlTipoReporte.SelectedValue.ToEntero 'If(ReporteComplementario, DdlTipoReporte.SelectedValue.ToEntero, 1) - Dim CveSubProyecto As Integer = DdlSubproyecto.SelectedValue.ToEntero - - 'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa) - Dim ObjConta As New ClsContabilidad - If ObjConta.GetEstadosMensual(FechaIMes.ToDate, FechaFMes.ToDate, CveSubProyecto, DdlDivisor.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) Then - DtDatosMes = ObjConta.DtResultados.FiltraParametros("(ImporteActual <> 0 OR ImporteAcumulado <> 0)") - Else - DtDatosMes = Nothing - Alert("Ocurrio un error al cargar los datos del Estado de Actividades", TipoMensaje.MsgError) - End If - ObjConta.Dispose() - - If DtDatosMes IsNot Nothing Then - CargaGridsMes() - SumaTotales() - End If - - End Sub - Private Sub CargaGridsMes() - DtIngresosMes = DtDatosMes.FiltraParametros("Tipo ='H' ") - DtGastosMes = DtDatosMes.FiltraParametros("Tipo ='G' ") - Dim Row As DataRow = DtIngresosMes.NewRow - - - Dim TotalActual = 0.0, TotalAnterior = 0.0 - If DtIngresosMes.Rows.Count > 0 Then - - For Each dr As DataRow In DtIngresosMes.FiltraParametros("NOT CtaMayor in (3,4)").Rows - TotalActual += dr("ImporteActual").ToString.ToDouble - TotalAnterior += dr("ImporteAcumulado").ToString.ToDouble - Next - - Row.Item("Nombre") = "TOTAL INGRESOS " - Row.Item("ImporteActual") = TotalActual.ToString - Row.Item("PorcentajeActual") = "100.00" - Row.Item("ImporteAcumulado") = TotalAnterior.ToString - Row.Item("PorcentajeAcumulado") = "100.00" - Row.Item("CtaMayor") = -1 - DtIngresosMes.Rows.Add(Row) - Else - Row.Item("Nombre") = "TOTAL INGRESOS " - Row.Item("ImporteActual") = "0.00" - Row.Item("ImporteAcumulado") = "0.00" - Row.Item("CtaMayor") = -1 - DtIngresosMes.Rows.Add(Row) - End If - - Dim T1 = TotalActual, T2 = TotalAnterior - - TotalActual = 0 - TotalAnterior = 0 - - Row = DtGastosMes.NewRow - If DtGastosMes.Rows.Count > 0 Then - - For Each dr As DataRow In DtGastosMes.FiltraParametros("NOT CtaMayor in (3,4)").Rows - TotalActual += dr("ImporteActual").ToString.ToDouble - TotalAnterior += dr("ImporteAcumulado").ToString.ToDouble - Next - - Row.Item("Nombre") = "TOTAL GASTOS" - Row.Item("ImporteActual") = TotalActual - Row.Item("PorcentajeActual") = If(T1 > 0, (TotalActual * 100 / T1).ToString, "0").FormatoNumero - Row.Item("ImporteAcumulado") = TotalAnterior.ToString - Row.Item("PorcentajeAcumulado") = If(T2 > 0, (TotalAnterior * 100 / T2).ToString, "0").FormatoNumero - Row.Item("CtaMayor") = -1 - DtGastosMes.Rows.Add(Row) - Else - Row.Item("Nombre") = "TOTAL GASTOS" - Row.Item("ImporteActual") = "0.00" - Row.Item("ImporteAcumulado") = "0.00" - Row.Item("CtaMayor") = -1 - DtGastosMes.Rows.Add(Row) - End If - - - GvIngresosMes.DataSource = DtIngresosMes - GvIngresosMes.DataBind() - - GvGastosMes.DataSource = DtGastosMes - GvGastosMes.DataBind() - - UpDatos.Update() - - End Sub - - - - Private Sub SumaTotales() - 'Llena Lb´s Totales - - - If DdlDivisor.SelectedValue.ToEntero > 1 Then - LbTotalActual.Text = TotalActualMes.ToString("###,###,##0") - LbTotalAnterior.Text = TotalAnteriorMes.ToString("###,###,##0") - Else - LbTotalActual.Text = TotalActualMes.ToString("###,###,##0.00") - LbTotalAnterior.Text = TotalAnteriorMes.ToString("###,###,##0.00") - End If - - - - LbTotalActual.ForeColor = If(TotalActualMes < 0, Drawing.Color.Red, Color.Black) - - LbTotalAnterior.ForeColor = If(TotalAnteriorMes < 0, Drawing.Color.Red, Color.Black) - - - End Sub - -#Region "GV´S ROW DATA BOUND" - - Protected Sub GvIngresos_RowDataBound(sender As Object, e As GridViewRowEventArgs) - - If e.Row.RowType = DataControlRowType.DataRow Then - - If e.Row.DBCampo("CtaMayor").ToString.ToEntero < 0 Then - TotalActualMes += e.Row.DBCampo("ImporteActual").ToString.ToDouble - TotalAnteriorMes += e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble - 'e.Row.ControlStyle.BackColor = Drawing.Color.LightGray - 'e.Row.ControlStyle.ForeColor = Drawing.Color.White - e.Row.ControlStyle.Font.Bold = True - ElseIf e.Row.DBCampo("CtaMayor").ToString.ToEntero = 3 Then - 'e.Row.CssClass = "SubTotales3" - e.Row.ControlStyle.Font.Bold = True - End If - - If e.Row.DBCampo("CtaMayor").ToString.ToEntero > 0 Then - - e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, e.Row.DBCampo("FechaInicial").ToDate.ToShortDateString) - e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, e.Row.DBCampo("FechaInicial").ToDate.ToShortDateString) - - - If DdlDivisor.SelectedValue.ToEntero > 1 Then - e.Row.FCHyperLink("HLActual").Text = e.Row.DataKey("ImporteActual").ToEntero.ToString("###,###,##0") - e.Row.FCHyperLink("HLAnterior").Text = e.Row.DataKey("ImporteAcumulado").ToEntero.ToString("###,###,##0").ToString - Else - e.Row.FCHyperLink("HLActual").Text = e.Row.DataKey("ImporteActual").ToDecimal.ToString("###,###,##0.00") - e.Row.FCHyperLink("HLAnterior").Text = e.Row.DataKey("ImporteAcumulado").ToDecimal.ToString("###,###,##0.00").ToString - End If - - End If - - - If e.Row.DBCampo("ImporteActual").ToString.ToDouble < 0 Then - e.Row.FCHyperLink("HLActual").ForeColor = Drawing.Color.Red - End If - If e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble < 0 Then - e.Row.FCHyperLink("HLAnterior").ForeColor = Drawing.Color.Red - End If - End If - End Sub - - Protected Sub GvGastos_RowDataBound(sender As Object, e As GridViewRowEventArgs) - If e.Row.RowType = DataControlRowType.DataRow Then - If e.Row.DBCampo("CtaMayor").ToString.ToEntero < 0 Then - TotalActualMes -= e.Row.DBCampo("ImporteActual").ToString.ToDouble - TotalAnteriorMes -= e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble - 'e.Row.ControlStyle.BackColor = Drawing.Color.LightGray - 'e.Row.ControlStyle.ForeColor = Drawing.Color.White - e.Row.ControlStyle.Font.Bold = True - ElseIf e.Row.DBCampo("CtaMayor").ToString.ToEntero = 3 Then - 'e.Row.CssClass = "SubTotales" - e.Row.ControlStyle.Font.Bold = True - End If - - If e.Row.DBCampo("CtaMayor").ToString.ToEntero > 0 Then - e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, e.Row.DBCampo("FechaInicial").ToDate.ToShortDateString) - e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, e.Row.DBCampo("FechaInicial").ToDate.ToShortDateString) - End If - - If DdlDivisor.SelectedValue.ToEntero > 1 Then - e.Row.FCHyperLink("HLActual").Text = e.Row.DataKey("ImporteActual").ToEntero.ToString("###,###,##0") - e.Row.FCHyperLink("HLAnterior").Text = e.Row.DataKey("ImporteAcumulado").ToEntero.ToString("###,###,##0").ToString - Else - e.Row.FCHyperLink("HLActual").Text = e.Row.DataKey("ImporteActual").ToDecimal.ToString("###,###,##0.00") - e.Row.FCHyperLink("HLAnterior").Text = e.Row.DataKey("ImporteAcumulado").ToDecimal.ToString("###,###,##0.00").ToString - End If - - If e.Row.DBCampo("ImporteActual").ToString.ToDouble < 0 Then - e.Row.FCHyperLink("HLActual").ForeColor = Drawing.Color.Red - End If - If e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble < 0 Then - e.Row.FCHyperLink("HLAnterior").ForeColor = Drawing.Color.Red - End If - End If - End Sub - -#End Region - - - - -#End Region - - - -#Region "M E S H O R I Z O N T A L" - - Private Sub CargaDatosMesH() - - - FechaIMes = $"01/01/{DdlEjercicio.SelectedValue}" - Dim FechaFin As Date = $"01/{DdlPeriodo.SelectedValue.ToEntero.ToString("00")}/{DdlEjercicio.SelectedValue}".ToDate - FechaFMes = $"{FechaFin.LastDayOfMonth.Day.ToString("00")}/{DdlPeriodo.SelectedValue.ToEntero.ToString("00")}/{DdlEjercicio.SelectedValue}" - - Dim CveSubProyecto As Integer = DdlSubproyecto.SelectedValue.ToEntero - - 'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa) - Dim ObjConta As New ClsContabilidad - If ObjConta.GetEstadosMensualHorizontal(FechaIMes.ToDate, FechaFMes.ToDate, CveSubProyecto, DdlDivisor.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) Then - DtDatosMesH = ObjConta.DtResultados.FiltraParametros("(ImporteActual <> 0 OR ImporteAcumulado <> 0)") - Else - DtDatosMesH = Nothing - Alert("Ocurrio un error al cargar los datos del Estado de Actividades", TipoMensaje.MsgError) - End If - ObjConta.Dispose() - - If DtDatosMesH IsNot Nothing Then - CargaGridsMesH() - Else - - End If - - End Sub - - Private Sub CargaGridsMesH() - - DtIngresosMesH = DtDatosMesH.FiltraParametros("Tipo ='H' ") - DtGastosMesH = DtDatosMesH.FiltraParametros("Tipo ='G' ") - DTTotalesMesH = DtDatosMesH.Clone() - - Dim Row As DataRow = DtIngresosMesH.NewRow - - Dim TotalActual = 0.0, TotalAnterior = 0.0 - - If DtIngresosMesH.Rows.Count > 0 Then - - For Each dr As DataRow In DtIngresosMesH.FiltraParametros("NOT CtaMayor in (3,4)").Rows - TotalActual += dr("ImporteActual").ToString.ToDouble - TotalAnterior += dr("ImporteAcumulado").ToString.ToDouble - Next - - Row.Item("Enero") = DtIngresosMesH.SUM("Enero", "NOT CtaMayor in (3,4)") - Row.Item("Febrero") = DtIngresosMesH.SUM("Febrero", "NOT CtaMayor in (3,4)") - Row.Item("Marzo") = DtIngresosMesH.SUM("Marzo", "NOT CtaMayor in (3,4)") - Row.Item("Abril") = DtIngresosMesH.SUM("Abril", "NOT CtaMayor in (3,4)") - Row.Item("Mayo") = DtIngresosMesH.SUM("Mayo", "NOT CtaMayor in (3,4)") - Row.Item("Junio") = DtIngresosMesH.SUM("Junio", "NOT CtaMayor in (3,4)") - Row.Item("Julio") = DtIngresosMesH.SUM("Julio", "NOT CtaMayor in (3,4)") - Row.Item("Agosto") = DtIngresosMesH.SUM("Agosto", "NOT CtaMayor in (3,4)") - Row.Item("Septiembre") = DtIngresosMesH.SUM("Septiembre", "NOT CtaMayor in (3,4)") - Row.Item("Octubre") = DtIngresosMesH.SUM("Octubre", "NOT CtaMayor in (3,4)") - Row.Item("Noviembre") = DtIngresosMesH.SUM("Noviembre", "NOT CtaMayor in (3,4)") - Row.Item("Diciembre") = DtIngresosMesH.SUM("Diciembre", "NOT CtaMayor in (3,4)") - - Row.Item("Tri1") = DtIngresosMesH.SUM("Tri1", "NOT CtaMayor in (3,4)") - Row.Item("Tri2") = DtIngresosMesH.SUM("Tri2", "NOT CtaMayor in (3,4)") - Row.Item("Tri3") = DtIngresosMesH.SUM("Tri3", "NOT CtaMayor in (3,4)") - Row.Item("Tri4") = DtIngresosMesH.SUM("Tri4", "NOT CtaMayor in (3,4)") - - Row.Item("Cua1") = DtIngresosMesH.SUM("Cua1", "NOT CtaMayor in (3,4)") - Row.Item("Cua2") = DtIngresosMesH.SUM("Cua2", "NOT CtaMayor in (3,4)") - Row.Item("Cua3") = DtIngresosMesH.SUM("Cua3", "NOT CtaMayor in (3,4)") - - - Row.Item("Nombre") = "TOTAL INGRESOS" - Row.Item("ImporteActual") = TotalActual.ToString - Row.Item("PorcentajeActual") = "100.00" - Row.Item("ImporteAcumulado") = TotalAnterior.ToString - Row.Item("PorcentajeAcumulado") = "100.00" - Row.Item("CtaMayor") = -1 - - DtIngresosMesH.Rows.Add(Row) - Else - Row.Item("Nombre") = "TOTAL INGRESOS " - Row.Item("ImporteActual") = "0.00" - Row.Item("ImporteAcumulado") = "0.00" - Row.Item("CtaMayor") = -1 - DtIngresosMesH.Rows.Add(Row) - End If - - Dim T1 = TotalActual, T2 = TotalAnterior - - TotalActual = 0 - TotalAnterior = 0 - - Row = DtGastosMesH.NewRow - If DtGastosMesH.Rows.Count > 0 Then - - For Each dr As DataRow In DtGastosMesH.FiltraParametros("NOT CtaMayor in (3,4)").Rows - TotalActual += dr("ImporteActual").ToString.ToDouble - TotalAnterior += dr("ImporteAcumulado").ToString.ToDouble - Next - - - Row.Item("Enero") = DtGastosMesH.SUM("Enero", "NOT CtaMayor in (3,4)") - Row.Item("Febrero") = DtGastosMesH.SUM("Febrero", "NOT CtaMayor in (3,4)") - Row.Item("Marzo") = DtGastosMesH.SUM("Marzo", "NOT CtaMayor in (3,4)") - Row.Item("Abril") = DtGastosMesH.SUM("Abril", "NOT CtaMayor in (3,4)") - Row.Item("Mayo") = DtGastosMesH.SUM("Mayo", "NOT CtaMayor in (3,4)") - Row.Item("Junio") = DtGastosMesH.SUM("Junio", "NOT CtaMayor in (3,4)") - Row.Item("Julio") = DtGastosMesH.SUM("Julio", "NOT CtaMayor in (3,4)") - Row.Item("Agosto") = DtGastosMesH.SUM("Agosto", "NOT CtaMayor in (3,4)") - Row.Item("Septiembre") = DtGastosMesH.SUM("Septiembre", "NOT CtaMayor in (3,4)") - Row.Item("Octubre") = DtGastosMesH.SUM("Octubre", "NOT CtaMayor in (3,4)") - Row.Item("Noviembre") = DtGastosMesH.SUM("Noviembre", "NOT CtaMayor in (3,4)") - Row.Item("Diciembre") = DtGastosMesH.SUM("Diciembre", "NOT CtaMayor in (3,4)") - - Row.Item("Tri1") = DtGastosMesH.SUM("Tri1", "NOT CtaMayor in (3,4)") - Row.Item("Tri2") = DtGastosMesH.SUM("Tri2", "NOT CtaMayor in (3,4)") - Row.Item("Tri3") = DtGastosMesH.SUM("Tri3", "NOT CtaMayor in (3,4)") - Row.Item("Tri4") = DtGastosMesH.SUM("Tri4", "NOT CtaMayor in (3,4)") - - Row.Item("Cua1") = DtGastosMesH.SUM("Cua1", "NOT CtaMayor in (3,4)") - Row.Item("Cua2") = DtGastosMesH.SUM("Cua2", "NOT CtaMayor in (3,4)") - Row.Item("Cua3") = DtGastosMesH.SUM("Cua3", "NOT CtaMayor in (3,4)") - - Row.Item("Nombre") = "TOTAL GASTOS" - Row.Item("ImporteActual") = TotalActual - Row.Item("PorcentajeActual") = If(T1 > 0, (TotalActual * 100 / T1).ToString, "0").FormatoNumero - Row.Item("ImporteAcumulado") = TotalAnterior.ToString - Row.Item("PorcentajeAcumulado") = If(T2 > 0, (TotalAnterior * 100 / T2).ToString, "0").FormatoNumero - Row.Item("CtaMayor") = -1 - DtGastosMesH.Rows.Add(Row) - Else - Row.Item("Nombre") = "TOTAL GASTOS" - Row.Item("ImporteActual") = "0.00" - Row.Item("ImporteAcumulado") = "0.00" - Row.Item("CtaMayor") = -1 - DtGastosMesH.Rows.Add(Row) - End If - - If DtIngresosMesH.Rows.Count > 0 Then - - Row = DTTotalesMesH.NewRow - - Row.Item("Enero") = DtIngresosMesH.SUM("Enero", "NOT CtaMayor in (-1,3,4)") - DtGastosMesH.SUM("Enero", "NOT CtaMayor in (-1,3,4)") - Row.Item("Febrero") = DtIngresosMesH.SUM("Febrero", "NOT CtaMayor in (-1,3,4)") - DtGastosMesH.SUM("Febrero", "NOT CtaMayor in (-1,3,4)") - Row.Item("Marzo") = DtIngresosMesH.SUM("Marzo", "NOT CtaMayor in (-1,3,4)") - DtGastosMesH.SUM("Marzo", "NOT CtaMayor in (-1,3,4)") - Row.Item("Abril") = DtIngresosMesH.SUM("Abril", "NOT CtaMayor in (-1,3,4)") - DtGastosMesH.SUM("Abril", "NOT CtaMayor in (-1,3,4)") - Row.Item("Mayo") = DtIngresosMesH.SUM("Mayo", "NOT CtaMayor in (-1,3,4)") - DtGastosMesH.SUM("Mayo", "NOT CtaMayor in (-1,3,4)") - Row.Item("Junio") = DtIngresosMesH.SUM("Junio", "NOT CtaMayor in (-1,3,4)") - DtGastosMesH.SUM("Junio", "NOT CtaMayor in (-1,3,4)") - Row.Item("Julio") = DtIngresosMesH.SUM("Julio", "NOT CtaMayor in (-1,3,4)") - DtGastosMesH.SUM("Julio", "NOT CtaMayor in (-1,3,4)") - Row.Item("Agosto") = DtIngresosMesH.SUM("Agosto", "NOT CtaMayor in (-1,3,4)") - DtGastosMesH.SUM("Agosto", "NOT CtaMayor in (-1,3,4)") - Row.Item("Septiembre") = DtIngresosMesH.SUM("Septiembre", "NOT CtaMayor in (-1,3,4)") - DtGastosMesH.SUM("Septiembre", "NOT CtaMayor in (-1,3,4)") - Row.Item("Octubre") = DtIngresosMesH.SUM("Octubre", "NOT CtaMayor in (-1,3,4)") - DtGastosMesH.SUM("Octubre", "NOT CtaMayor in (-1,3,4)") - Row.Item("Noviembre") = DtIngresosMesH.SUM("Noviembre", "NOT CtaMayor in (-1,3,4)") - DtGastosMesH.SUM("Noviembre", "NOT CtaMayor in (-1,3,4)") - Row.Item("Diciembre") = DtIngresosMesH.SUM("Diciembre", "NOT CtaMayor in (-1,3,4)") - DtGastosMesH.SUM("Diciembre", "NOT CtaMayor in (-1,3,4)") - - Row.Item("Tri1") = DtIngresosMesH.SUM("Tri1", "NOT CtaMayor in (-1,3,4)") - DtGastosMesH.SUM("Tri1", "NOT CtaMayor in (-1,3,4)") - Row.Item("Tri2") = DtIngresosMesH.SUM("Tri2", "NOT CtaMayor in (-1,3,4)") - DtGastosMesH.SUM("Tri2", "NOT CtaMayor in (-1,3,4)") - Row.Item("Tri3") = DtIngresosMesH.SUM("Tri3", "NOT CtaMayor in (-1,3,4)") - DtGastosMesH.SUM("Tri3", "NOT CtaMayor in (-1,3,4)") - Row.Item("Tri4") = DtIngresosMesH.SUM("Tri4", "NOT CtaMayor in (-1,3,4)") - DtGastosMesH.SUM("Tri4", "NOT CtaMayor in (-1,3,4)") - - Row.Item("Cua1") = DtIngresosMesH.SUM("Cua1", "NOT CtaMayor in (-1,3,4)") - DtGastosMesH.SUM("Cua1", "NOT CtaMayor in (-1,3,4)") - Row.Item("Cua2") = DtIngresosMesH.SUM("Cua2", "NOT CtaMayor in (-1,3,4)") - DtGastosMesH.SUM("Cua2", "NOT CtaMayor in (-1,3,4)") - Row.Item("Cua3") = DtIngresosMesH.SUM("Cua3", "NOT CtaMayor in (-1,3,4)") - DtGastosMesH.SUM("Cua3", "NOT CtaMayor in (-1,3,4)") - - Row.Item("Nombre") = "Resultados del Ejercicio:" - 'Row.Item("ImporteActual") = TotalActual.ToString - 'Row.Item("PorcentajeActual") = "100.00" - Row.Item("ImporteAcumulado") = DtIngresosMesH.SUM("ImporteAcumulado", "NOT CtaMayor in (-1,3,4)") - DtGastosMesH.SUM("ImporteAcumulado", "NOT CtaMayor in (-1,3,4)") ' TotalAnterior.ToString - 'Row.Item("PorcentajeAcumulado") = "100.00" - 'Row.Item("CtaMayor") = -1 - - DTTotalesMesH.Rows.Add(Row) - - End If - - GvIngresosMesH.DataSource = DtIngresosMesH - GvIngresosMesH.DataBind() - - GvGastosMesH.DataSource = DtGastosMesH - GvGastosMesH.DataBind() - - GvTotalesMesH.DataSource = DTTotalesMesH - GvTotalesMesH.DataBind() - - - If DdlTri.SelectedValue.ToEntero = 0 Then 'ocultar trimestre cuatrimestre - - GvIngresosMesH.Columns(4).Visible = False - GvIngresosMesH.Columns(9).Visible = False - GvIngresosMesH.Columns(14).Visible = False - GvIngresosMesH.Columns(18).Visible = False - - GvGastosMesH.Columns(4).Visible = False - GvGastosMesH.Columns(9).Visible = False - GvGastosMesH.Columns(14).Visible = False - GvGastosMesH.Columns(18).Visible = False - - GvTotalesMesH.Columns(4).Visible = False - GvTotalesMesH.Columns(9).Visible = False - GvTotalesMesH.Columns(14).Visible = False - GvTotalesMesH.Columns(18).Visible = False - - GvIngresosMesH.Columns(6).Visible = False - GvIngresosMesH.Columns(12).Visible = False - GvIngresosMesH.Columns(19).Visible = False - - GvGastosMesH.Columns(6).Visible = False - GvGastosMesH.Columns(12).Visible = False - GvGastosMesH.Columns(19).Visible = False - - GvTotalesMesH.Columns(6).Visible = False - GvTotalesMesH.Columns(12).Visible = False - GvTotalesMesH.Columns(19).Visible = False - - - ElseIf DdlTri.SelectedValue.ToEntero = 1 Then 'Mostrar Trimestre - - - GvIngresosMesH.Columns(4).Visible = True - GvIngresosMesH.Columns(9).Visible = True - GvIngresosMesH.Columns(14).Visible = True - GvIngresosMesH.Columns(18).Visible = True - - GvGastosMesH.Columns(4).Visible = True - GvGastosMesH.Columns(9).Visible = True - GvGastosMesH.Columns(14).Visible = True - GvGastosMesH.Columns(18).Visible = True - - GvTotalesMesH.Columns(4).Visible = True - GvTotalesMesH.Columns(9).Visible = True - GvTotalesMesH.Columns(14).Visible = True - GvTotalesMesH.Columns(18).Visible = True - - GvIngresosMesH.Columns(6).Visible = False - GvIngresosMesH.Columns(12).Visible = False - GvIngresosMesH.Columns(19).Visible = False - - GvGastosMesH.Columns(6).Visible = False - GvGastosMesH.Columns(12).Visible = False - GvGastosMesH.Columns(19).Visible = False - - GvTotalesMesH.Columns(6).Visible = False - GvTotalesMesH.Columns(12).Visible = False - GvTotalesMesH.Columns(19).Visible = False - - ElseIf DdlTri.SelectedValue.ToEntero = 2 Then 'Mostrar Cuatrimestre - - GvIngresosMesH.Columns(4).Visible = False - GvIngresosMesH.Columns(9).Visible = False - GvIngresosMesH.Columns(14).Visible = False - GvIngresosMesH.Columns(18).Visible = False - - GvGastosMesH.Columns(4).Visible = False - GvGastosMesH.Columns(9).Visible = False - GvGastosMesH.Columns(14).Visible = False - GvGastosMesH.Columns(18).Visible = False - - GvTotalesMesH.Columns(4).Visible = False - GvTotalesMesH.Columns(9).Visible = False - GvTotalesMesH.Columns(14).Visible = False - GvTotalesMesH.Columns(18).Visible = False - - - GvIngresosMesH.Columns(6).Visible = True - GvIngresosMesH.Columns(12).Visible = True - GvIngresosMesH.Columns(19).Visible = True - - GvGastosMesH.Columns(6).Visible = True - GvGastosMesH.Columns(12).Visible = True - GvGastosMesH.Columns(19).Visible = True - - GvTotalesMesH.Columns(6).Visible = True - GvTotalesMesH.Columns(12).Visible = True - GvTotalesMesH.Columns(19).Visible = True - - End If - - - UpDatosMesH.Update() - - End Sub - - - Protected Sub GvIngresosMesH_RowDataBound(sender As Object, e As GridViewRowEventArgs) - - If e.Row.RowType = DataControlRowType.DataRow Then - If e.Row.DBCampo("CtaMayor").ToString.ToEntero < 0 Then - TotalActualMes += e.Row.DBCampo("ImporteActual").ToString.ToDouble - TotalAnteriorMes += e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble - e.Row.ControlStyle.Font.Bold = True - ElseIf e.Row.DBCampo("CtaMayor").ToString.ToEntero = 3 Then - e.Row.ControlStyle.Font.Bold = True - End If - - If e.Row.DBCampo("CtaMayor").ToString.ToEntero > 0 Then - - - 'e.Row.FCHyperLink("HLNombre").NavigateUrl = $"./RepAnexoCatalogoMensualHorizontal.aspx?CveCuenta={e.Row.DBCampo("CveCuenta").ToString}&FF=31/12/{DdlEjercicio.SelectedValue}&FI=01/01/{DdlEjercicio.SelectedValue}&ER=1" - - e.Row.FCHyperLink("HLNombre").NavigateUrl = $"./RepAnexoCatalogoMensual.aspx?CveCuenta={e.Row.DBCampo("CveCuenta").ToString}&Ejercicio={DdlEjercicio.SelectedValue}&Divisor={DdlDivisor.SelectedValue}&CveSubProyecto={DdlSubproyecto.SelectedValue}&Periodo={DdlPeriodo.SelectedValue}&TRCU={DdlTri.SelectedValue}" - - e.Row.FCHyperLink("HLEnero").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/01/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/01/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) - e.Row.FCHyperLink("HLFebrero").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/02/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/02/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) - e.Row.FCHyperLink("HLMarzo").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/03/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/03/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) - e.Row.FCHyperLink("HLAbril").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/04/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/04/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) - e.Row.FCHyperLink("HLMayo").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/05/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/05/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) - e.Row.FCHyperLink("HLJunio").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/06/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/06/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) - e.Row.FCHyperLink("HLJulio").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/07/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/07/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) - e.Row.FCHyperLink("HLAgosto").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/08/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/08/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) - e.Row.FCHyperLink("HLSeptiembre").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/09/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/09/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) - e.Row.FCHyperLink("HLOctubre").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/10/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/10/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) - e.Row.FCHyperLink("HLNoviembre").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/11/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/11/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) - e.Row.FCHyperLink("HLDiciembre").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/12/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/12/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) - - e.Row.FCHyperLink("HLTri1").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/03/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/01/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) - e.Row.FCHyperLink("HLTri2").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/06/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/04/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) - e.Row.FCHyperLink("HLTri3").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/09/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/07/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) - e.Row.FCHyperLink("HLTri4").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/12/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/10/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) - - e.Row.FCHyperLink("HLCua1").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/04/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/01/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) - e.Row.FCHyperLink("HLCua2").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/08/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/05/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) - e.Row.FCHyperLink("HLCua3").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/12/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/09/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) - - - ' e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, e.Row.DBCampo("FechaInicial").ToDate.ToShortDateString) - - e.Row.FCHyperLink("HLAnterior").NavigateUrl = $"./RepAnexoCatalogoMensual.aspx?CveCuenta={e.Row.DBCampo("CveCuenta").ToString}&Ejercicio={DdlEjercicio.SelectedValue}&Divisor={DdlDivisor.SelectedValue}&CveSubProyecto={DdlSubproyecto.SelectedValue}&Periodo={DdlPeriodo.SelectedValue}" - - End If - - If e.Row.DBCampo("CtaMayor").ToString.ToEntero > 0 Or e.Row.DBCampo("Nombre") = "TOTAL INGRESOS" Then - - If DdlDivisor.SelectedValue.ToEntero > 1 Then - - e.Row.FCHyperLink("HLEnero").Text = e.Row.DataKey("Enero").ToDecimal.ToString("###,###,##0") - e.Row.FCHyperLink("HLFebrero").Text = e.Row.DataKey("Febrero").ToDecimal.ToString("###,###,##0") - e.Row.FCHyperLink("HLMarzo").Text = e.Row.DataKey("Marzo").ToDecimal.ToString("###,###,##0") - e.Row.FCHyperLink("HLAbril").Text = e.Row.DataKey("Abril").ToDecimal.ToString("###,###,##0") - e.Row.FCHyperLink("HLMayo").Text = e.Row.DataKey("Mayo").ToDecimal.ToString("###,###,##0") - e.Row.FCHyperLink("HLJunio").Text = e.Row.DataKey("Junio").ToDecimal.ToString("###,###,##0") - e.Row.FCHyperLink("HLJulio").Text = e.Row.DataKey("Julio").ToDecimal.ToString("###,###,##0") - e.Row.FCHyperLink("HLAgosto").Text = e.Row.DataKey("Agosto").ToDecimal.ToString("###,###,##0") - e.Row.FCHyperLink("HLSeptiembre").Text = e.Row.DataKey("Septiembre").ToDecimal.ToString("###,###,##0") - e.Row.FCHyperLink("HLOctubre").Text = e.Row.DataKey("Octubre").ToDecimal.ToString("###,###,##0") - e.Row.FCHyperLink("HLNoviembre").Text = e.Row.DataKey("Noviembre").ToDecimal.ToString("###,###,##0") - e.Row.FCHyperLink("HLDiciembre").Text = e.Row.DataKey("Diciembre").ToDecimal.ToString("###,###,##0") - Else - e.Row.FCHyperLink("HLEnero").Text = e.Row.DataKey("Enero").ToDecimal.ToString("###,###,##0.00") - e.Row.FCHyperLink("HLFebrero").Text = e.Row.DataKey("Febrero").ToDecimal.ToString("###,###,##0.00") - e.Row.FCHyperLink("HLMarzo").Text = e.Row.DataKey("Marzo").ToDecimal.ToString("###,###,##0.00") - e.Row.FCHyperLink("HLAbril").Text = e.Row.DataKey("Abril").ToDecimal.ToString("###,###,##0.00") - e.Row.FCHyperLink("HLMayo").Text = e.Row.DataKey("Mayo").ToDecimal.ToString("###,###,##0.00") - e.Row.FCHyperLink("HLJunio").Text = e.Row.DataKey("Junio").ToDecimal.ToString("###,###,##0.00") - e.Row.FCHyperLink("HLJulio").Text = e.Row.DataKey("Julio").ToDecimal.ToString("###,###,##0.00") - e.Row.FCHyperLink("HLAgosto").Text = e.Row.DataKey("Agosto").ToDecimal.ToString("###,###,##0.00") - e.Row.FCHyperLink("HLSeptiembre").Text = e.Row.DataKey("Septiembre").ToDecimal.ToString("###,###,##0.00") - e.Row.FCHyperLink("HLOctubre").Text = e.Row.DataKey("Octubre").ToDecimal.ToString("###,###,##0.00") - e.Row.FCHyperLink("HLNoviembre").Text = e.Row.DataKey("Noviembre").ToDecimal.ToString("###,###,##0.00") - e.Row.FCHyperLink("HLDiciembre").Text = e.Row.DataKey("Diciembre").ToDecimal.ToString("###,###,##0.00") - End If - - End If - - setgrafica(e) - - - - - e.Row.FCHyperLink("HLEnero").ForeColor = If(e.Row.DataKey("Enero").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLEnero").ForeColor) - e.Row.FCHyperLink("HLFebrero").ForeColor = If(e.Row.DataKey("Febrero").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLFebrero").ForeColor) - e.Row.FCHyperLink("HLMarzo").ForeColor = If(e.Row.DataKey("Marzo").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLMarzo").ForeColor) - e.Row.FCHyperLink("HLAbril").ForeColor = If(e.Row.DataKey("Abril").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLAbril").ForeColor) - e.Row.FCHyperLink("HLMayo").ForeColor = If(e.Row.DataKey("Mayo").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLAbril").ForeColor) - e.Row.FCHyperLink("HLJunio").ForeColor = If(e.Row.DataKey("Junio").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLMayo").ForeColor) - e.Row.FCHyperLink("HLJulio").ForeColor = If(e.Row.DataKey("Julio").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLJulio").ForeColor) - e.Row.FCHyperLink("HLAgosto").ForeColor = If(e.Row.DataKey("Agosto").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLAgosto").ForeColor) - e.Row.FCHyperLink("HLSeptiembre").ForeColor = If(e.Row.DataKey("Septiembre").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLSeptiembre").ForeColor) - e.Row.FCHyperLink("HLOctubre").ForeColor = If(e.Row.DataKey("Octubre").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLOctubre").ForeColor) - e.Row.FCHyperLink("HLNoviembre").ForeColor = If(e.Row.DataKey("Noviembre").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLNoviembre").ForeColor) - e.Row.FCHyperLink("HLDiciembre").ForeColor = If(e.Row.DataKey("Diciembre").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLDiciembre").ForeColor) - - If e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble < 0 Then - e.Row.FCHyperLink("HLAnterior").ForeColor = Drawing.Color.Red - End If - - End If - - End Sub - - Protected Sub GvGastosMesH_RowDataBound(sender As Object, e As GridViewRowEventArgs) - If e.Row.RowType = DataControlRowType.DataRow Then - If e.Row.DBCampo("CtaMayor").ToString.ToEntero < 0 Then - TotalActualMes -= e.Row.DBCampo("ImporteActual").ToString.ToDouble - TotalAnteriorMes -= e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble - 'e.Row.ControlStyle.BackColor = Drawing.Color.LightGray - 'e.Row.ControlStyle.ForeColor = Drawing.Color.White - e.Row.ControlStyle.Font.Bold = True - ElseIf e.Row.DBCampo("CtaMayor").ToString.ToEntero = 3 Then - 'e.Row.CssClass = "SubTotales" - e.Row.ControlStyle.Font.Bold = True - End If - - If e.Row.DBCampo("CtaMayor").ToString.ToEntero > 0 Then - - Dim CveCuenta As Integer = e.Row.DataKey("CveCuenta").ToEntero - - 'e.Row.FCHyperLink("HLNombre").NavigateUrl = $"./RepAnexoCatalogoMensualHorizontal.aspx?CveCuenta={e.Row.DBCampo("CveCuenta").ToString}&FF=31/12/{DdlEjercicio.SelectedValue}&FI=01/01/{DdlEjercicio.SelectedValue}&ER=1" - e.Row.FCHyperLink("HLNombre").NavigateUrl = $"./RepAnexoCatalogoMensual.aspx?CveCuenta={e.Row.DBCampo("CveCuenta").ToString}&Ejercicio={DdlEjercicio.SelectedValue}&Divisor={DdlDivisor.SelectedValue}&CveSubProyecto={DdlSubproyecto.SelectedValue}&Periodo={DdlPeriodo.SelectedValue}&TRCU={DdlTri.SelectedValue}" - - e.Row.FCHyperLink("HLEnero").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/01/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/01/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) - e.Row.FCHyperLink("HLFebrero").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/02/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/02/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) - e.Row.FCHyperLink("HLMarzo").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/03/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/03/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) - e.Row.FCHyperLink("HLAbril").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/04/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/04/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) - e.Row.FCHyperLink("HLMayo").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/05/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/05/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) - e.Row.FCHyperLink("HLJunio").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/06/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/06/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) - e.Row.FCHyperLink("HLJulio").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/07/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/07/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) - e.Row.FCHyperLink("HLAgosto").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/08/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/08/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) - e.Row.FCHyperLink("HLSeptiembre").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/09/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/09/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) - e.Row.FCHyperLink("HLOctubre").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/10/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/10/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) - e.Row.FCHyperLink("HLNoviembre").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/11/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/11/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) - e.Row.FCHyperLink("HLDiciembre").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/12/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/12/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) - - e.Row.FCHyperLink("HLTri1").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/03/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/01/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) - e.Row.FCHyperLink("HLTri2").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/06/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/04/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) - e.Row.FCHyperLink("HLTri3").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/09/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/07/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) - e.Row.FCHyperLink("HLTri4").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/12/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/10/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) - - e.Row.FCHyperLink("HLCua1").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/04/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/01/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) - e.Row.FCHyperLink("HLCua2").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/08/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/05/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) - e.Row.FCHyperLink("HLCua3").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/12/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/09/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) - - 'e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, e.Row.DBCampo("FechaInicial").ToDate.ToShortDateString) - e.Row.FCHyperLink("HLAnterior").NavigateUrl = $"./RepAnexoCatalogoMensual.aspx?CveCuenta={e.Row.DBCampo("CveCuenta").ToString}&Ejercicio={DdlEjercicio.SelectedValue}&Divisor={DdlDivisor.SelectedValue}&CveSubProyecto={DdlSubproyecto.SelectedValue}&Periodo={DdlPeriodo.SelectedValue}" - - End If - - - - If e.Row.DBCampo("CtaMayor").ToString.ToEntero > 0 Or e.Row.DBCampo("Nombre") = "TOTAL GASTOS" Then - - If DdlDivisor.SelectedValue.ToEntero > 1 Then - - 'Enero,Febrero,Marzo,Abril,Mayo,Junio,Julio,Agosto,Septiembre,Octubre,Noviembre,Diciembre,PorcentajeAcumulado - e.Row.FCHyperLink("HLEnero").Text = e.Row.DataKey("Enero").ToDecimal.ToString("###,###,##0") - e.Row.FCHyperLink("HLFebrero").Text = e.Row.DataKey("Febrero").ToDecimal.ToString("###,###,##0") - e.Row.FCHyperLink("HLMarzo").Text = e.Row.DataKey("Marzo").ToDecimal.ToString("###,###,##0") - e.Row.FCHyperLink("HLAbril").Text = e.Row.DataKey("Abril").ToDecimal.ToString("###,###,##0") - e.Row.FCHyperLink("HLMayo").Text = e.Row.DataKey("Mayo").ToDecimal.ToString("###,###,##0") - e.Row.FCHyperLink("HLJunio").Text = e.Row.DataKey("Junio").ToDecimal.ToString("###,###,##0") - e.Row.FCHyperLink("HLJulio").Text = e.Row.DataKey("Julio").ToDecimal.ToString("###,###,##0") - e.Row.FCHyperLink("HLAgosto").Text = e.Row.DataKey("Agosto").ToDecimal.ToString("###,###,##0") - e.Row.FCHyperLink("HLSeptiembre").Text = e.Row.DataKey("Septiembre").ToDecimal.ToString("###,###,##0") - e.Row.FCHyperLink("HLOctubre").Text = e.Row.DataKey("Octubre").ToDecimal.ToString("###,###,##0") - e.Row.FCHyperLink("HLNoviembre").Text = e.Row.DataKey("Noviembre").ToDecimal.ToString("###,###,##0") - e.Row.FCHyperLink("HLDiciembre").Text = e.Row.DataKey("Diciembre").ToDecimal.ToString("###,###,##0") - - Else - e.Row.FCHyperLink("HLEnero").Text = e.Row.DataKey("Enero").ToDecimal.ToString("###,###,##0.00") - e.Row.FCHyperLink("HLFebrero").Text = e.Row.DataKey("Febrero").ToDecimal.ToString("###,###,##0.00") - e.Row.FCHyperLink("HLMarzo").Text = e.Row.DataKey("Marzo").ToDecimal.ToString("###,###,##0.00") - e.Row.FCHyperLink("HLAbril").Text = e.Row.DataKey("Abril").ToDecimal.ToString("###,###,##0.00") - e.Row.FCHyperLink("HLMayo").Text = e.Row.DataKey("Mayo").ToDecimal.ToString("###,###,##0.00") - e.Row.FCHyperLink("HLJunio").Text = e.Row.DataKey("Junio").ToDecimal.ToString("###,###,##0.00") - e.Row.FCHyperLink("HLJulio").Text = e.Row.DataKey("Julio").ToDecimal.ToString("###,###,##0.00") - e.Row.FCHyperLink("HLAgosto").Text = e.Row.DataKey("Agosto").ToDecimal.ToString("###,###,##0.00") - e.Row.FCHyperLink("HLSeptiembre").Text = e.Row.DataKey("Septiembre").ToDecimal.ToString("###,###,##0.00") - e.Row.FCHyperLink("HLOctubre").Text = e.Row.DataKey("Octubre").ToDecimal.ToString("###,###,##0.00") - e.Row.FCHyperLink("HLNoviembre").Text = e.Row.DataKey("Noviembre").ToDecimal.ToString("###,###,##0.00") - e.Row.FCHyperLink("HLDiciembre").Text = e.Row.DataKey("Diciembre").ToDecimal.ToString("###,###,##0.00") - End If - End If - - - setgrafica(e) - - - e.Row.FCHyperLink("HLEnero").ForeColor = If(e.Row.DataKey("Enero").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLEnero").ForeColor) - e.Row.FCHyperLink("HLFebrero").ForeColor = If(e.Row.DataKey("Febrero").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLFebrero").ForeColor) - e.Row.FCHyperLink("HLMarzo").ForeColor = If(e.Row.DataKey("Marzo").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLMarzo").ForeColor) - e.Row.FCHyperLink("HLAbril").ForeColor = If(e.Row.DataKey("Abril").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLAbril").ForeColor) - e.Row.FCHyperLink("HLMayo").ForeColor = If(e.Row.DataKey("Mayo").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLAbril").ForeColor) - e.Row.FCHyperLink("HLJunio").ForeColor = If(e.Row.DataKey("Junio").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLMayo").ForeColor) - e.Row.FCHyperLink("HLJulio").ForeColor = If(e.Row.DataKey("Julio").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLJulio").ForeColor) - e.Row.FCHyperLink("HLAgosto").ForeColor = If(e.Row.DataKey("Agosto").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLAgosto").ForeColor) - e.Row.FCHyperLink("HLSeptiembre").ForeColor = If(e.Row.DataKey("Septiembre").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLSeptiembre").ForeColor) - e.Row.FCHyperLink("HLOctubre").ForeColor = If(e.Row.DataKey("Octubre").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLOctubre").ForeColor) - e.Row.FCHyperLink("HLNoviembre").ForeColor = If(e.Row.DataKey("Noviembre").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLNoviembre").ForeColor) - e.Row.FCHyperLink("HLDiciembre").ForeColor = If(e.Row.DataKey("Diciembre").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLDiciembre").ForeColor) - - - - If e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble < 0 Then - e.Row.FCHyperLink("HLAnterior").ForeColor = Drawing.Color.Red - End If - End If - End Sub - - Protected Sub GvTotalesMesH_RowDataBound(sender As Object, e As GridViewRowEventArgs) - - If e.Row.RowType = DataControlRowType.Header Then - e.Row.Attributes.Add("style", "display:none") - End If - - If e.Row.RowType = DataControlRowType.DataRow Then - - e.Row.Attributes.Add("style", "Font-weight: bold") - - - If DdlDivisor.SelectedValue.ToEntero > 0 Then - - e.Row.FCHyperLink("HLEnero").Text = e.Row.DataKey("Enero").ToDecimal.ToString("###,###,##0") - e.Row.FCHyperLink("HLFebrero").Text = e.Row.DataKey("Febrero").ToDecimal.ToString("###,###,##0") - e.Row.FCHyperLink("HLMarzo").Text = e.Row.DataKey("Marzo").ToDecimal.ToString("###,###,##0") - e.Row.FCHyperLink("HLAbril").Text = e.Row.DataKey("Abril").ToDecimal.ToString("###,###,##0") - e.Row.FCHyperLink("HLMayo").Text = e.Row.DataKey("Mayo").ToDecimal.ToString("###,###,##0") - e.Row.FCHyperLink("HLJunio").Text = e.Row.DataKey("Junio").ToDecimal.ToString("###,###,##0") - e.Row.FCHyperLink("HLJulio").Text = e.Row.DataKey("Julio").ToDecimal.ToString("###,###,##0") - e.Row.FCHyperLink("HLAgosto").Text = e.Row.DataKey("Agosto").ToDecimal.ToString("###,###,##0") - e.Row.FCHyperLink("HLSeptiembre").Text = e.Row.DataKey("Septiembre").ToDecimal.ToString("###,###,##0") - e.Row.FCHyperLink("HLOctubre").Text = e.Row.DataKey("Octubre").ToDecimal.ToString("###,###,##0") - e.Row.FCHyperLink("HLNoviembre").Text = e.Row.DataKey("Noviembre").ToDecimal.ToString("###,###,##0") - e.Row.FCHyperLink("HLDiciembre").Text = e.Row.DataKey("Diciembre").ToDecimal.ToString("###,###,##0") - - Else - e.Row.FCHyperLink("HLEnero").Text = e.Row.DataKey("Enero").ToDecimal.ToString("###,###,##0.00") - e.Row.FCHyperLink("HLFebrero").Text = e.Row.DataKey("Febrero").ToDecimal.ToString("###,###,##0.00") - e.Row.FCHyperLink("HLMarzo").Text = e.Row.DataKey("Marzo").ToDecimal.ToString("###,###,##0.00") - e.Row.FCHyperLink("HLAbril").Text = e.Row.DataKey("Abril").ToDecimal.ToString("###,###,##0.00") - e.Row.FCHyperLink("HLMayo").Text = e.Row.DataKey("Mayo").ToDecimal.ToString("###,###,##0.00") - e.Row.FCHyperLink("HLJunio").Text = e.Row.DataKey("Junio").ToDecimal.ToString("###,###,##0.00") - e.Row.FCHyperLink("HLJulio").Text = e.Row.DataKey("Julio").ToDecimal.ToString("###,###,##0.00") - e.Row.FCHyperLink("HLAgosto").Text = e.Row.DataKey("Agosto").ToDecimal.ToString("###,###,##0.00") - e.Row.FCHyperLink("HLSeptiembre").Text = e.Row.DataKey("Septiembre").ToDecimal.ToString("###,###,##0.00") - e.Row.FCHyperLink("HLOctubre").Text = e.Row.DataKey("Octubre").ToDecimal.ToString("###,###,##0.00") - e.Row.FCHyperLink("HLNoviembre").Text = e.Row.DataKey("Noviembre").ToDecimal.ToString("###,###,##0.00") - e.Row.FCHyperLink("HLDiciembre").Text = e.Row.DataKey("Diciembre").ToDecimal.ToString("###,###,##0.00") - End If - - setgrafica(e) - - e.Row.FCHyperLink("HLEnero").ForeColor = If(e.Row.DataKey("Enero").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLEnero").ForeColor) - e.Row.FCHyperLink("HLFebrero").ForeColor = If(e.Row.DataKey("Febrero").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLFebrero").ForeColor) - e.Row.FCHyperLink("HLMarzo").ForeColor = If(e.Row.DataKey("Marzo").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLMarzo").ForeColor) - e.Row.FCHyperLink("HLAbril").ForeColor = If(e.Row.DataKey("Abril").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLAbril").ForeColor) - e.Row.FCHyperLink("HLMayo").ForeColor = If(e.Row.DataKey("Mayo").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLAbril").ForeColor) - e.Row.FCHyperLink("HLJunio").ForeColor = If(e.Row.DataKey("Junio").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLMayo").ForeColor) - e.Row.FCHyperLink("HLJulio").ForeColor = If(e.Row.DataKey("Julio").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLJulio").ForeColor) - e.Row.FCHyperLink("HLAgosto").ForeColor = If(e.Row.DataKey("Agosto").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLAgosto").ForeColor) - e.Row.FCHyperLink("HLSeptiembre").ForeColor = If(e.Row.DataKey("Septiembre").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLSeptiembre").ForeColor) - e.Row.FCHyperLink("HLOctubre").ForeColor = If(e.Row.DataKey("Octubre").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLOctubre").ForeColor) - e.Row.FCHyperLink("HLNoviembre").ForeColor = If(e.Row.DataKey("Noviembre").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLNoviembre").ForeColor) - e.Row.FCHyperLink("HLDiciembre").ForeColor = If(e.Row.DataKey("Diciembre").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLDiciembre").ForeColor) - - - End If - - End Sub - - Public Sub setgrafica(e As GridViewRowEventArgs) - - Dim lista As New List(Of Object) - lista.Add(New With {.Texto = "Enero", .Valor = e.Row.DataKey("Enero").ToDecimal(), .Color = "#FF0F00"}) - lista.Add(New With {.Texto = "Febrero", .Valor = e.Row.DataKey("Febrero").ToDecimal(), .Color = "#FF6600"}) - lista.Add(New With {.Texto = "Marzo", .Valor = e.Row.DataKey("Marzo").ToDecimal(), .Color = "#F8FF01"}) - lista.Add(New With {.Texto = "Abril", .Valor = e.Row.DataKey("Abril").ToDecimal(), .Color = "#04D215"}) - lista.Add(New With {.Texto = "Mayo", .Valor = e.Row.DataKey("Mayo").ToDecimal(), .Color = "#2A0CD0"}) - lista.Add(New With {.Texto = "Junio", .Valor = e.Row.DataKey("Junio").ToDecimal(), .Color = "#8A0CCF"}) - lista.Add(New With {.Texto = "Julio", .Valor = e.Row.DataKey("Julio").ToDecimal(), .Color = "#CD0D74"}) - lista.Add(New With {.Texto = "Agosto", .Valor = e.Row.DataKey("Agosto").ToDecimal(), .Color = "#754DEB"}) - lista.Add(New With {.Texto = "Septiembre", .Valor = e.Row.DataKey("Septiembre").ToDecimal(), .Color = "#DDDDDD"}) - lista.Add(New With {.Texto = "Octubre", .Valor = e.Row.DataKey("Octubre").ToDecimal(), .Color = "#999999"}) - lista.Add(New With {.Texto = "Noviembre", .Valor = e.Row.DataKey("Noviembre").ToDecimal(), .Color = "#000000"}) - lista.Add(New With {.Texto = "Diciembre", .Valor = e.Row.DataKey("Diciembre").ToDecimal(), .Color = "#FF0F00"}) - e.Row.FCHyperLink("Hypgrafica").Attributes.Add("data-values", Newtonsoft.Json.JsonConvert.SerializeObject(lista)) - End Sub -#End Region - - - -#Region "Anual H O R I Z O N T A L" - - Private Sub CargaDatosAnualH() - - - FechaIMes = $"01/01/{DdlEjercicio.SelectedValue}" - FechaFMes = $"31/12/{DdlEjercicio2.SelectedValue}" - - Dim CveSubProyecto As Integer = DdlSubproyecto.SelectedValue.ToEntero - - 'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa) - Dim ObjConta As New ClsContabilidad - If ObjConta.GetEstadosAnualHorizontal(FechaIMes.ToDate, FechaFMes.ToDate, CveSubProyecto, DdlDivisor.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, DdlPeriodo.SelectedValue.ToEntero, Periodo:=DdlPeriodo.SelectedValue.ToEntero) Then - DtDatosAnualH = ObjConta.DtResultados.FiltraParametros("(ImporteActual <> 0 OR ImporteAcumulado <> 0)") - Else - DtDatosAnualH = Nothing - Alert("Ocurrio un error al cargar los datos del Estado de Actividades", TipoMensaje.MsgError) - End If - ObjConta.Dispose() - - If DtDatosAnualH IsNot Nothing Then - CargaGridsAnualH() - - End If - - End Sub - - Private Sub CargaGridsAnualH() - - DtIngresosAnualH = DtDatosAnualH.FiltraParametros("Tipo ='H' ") - DtGastosAnualH = DtDatosAnualH.FiltraParametros("Tipo ='G' ") - DTTotalesAnualH = DtDatosAnualH.Clone() - - Dim Row As DataRow = DtIngresosAnualH.NewRow - - Dim TotalActual = 0.0, TotalAnterior = 0.0 - - - Dim IndexData As Integer = 0 - Dim IndexGv As Integer = 1 - Dim IndexMax As Integer = 1 - - - Dim IDX_LIMPIAR As Integer = 1 - - For IDX_LIMPIAR = 1 To 25 - - GvIngresosAnualH.Columns(IDX_LIMPIAR).Visible = False - GvGastosAnualH.Columns(IDX_LIMPIAR).Visible = False - GvTotalesAnualH.Columns(IDX_LIMPIAR).Visible = False - Next - listaCamposanios.Clear() - listaCamposaniosGastos.Clear() - listaCamposaniosTotal.Clear() - - If DtIngresosAnualH.Rows.Count > 0 Then - - - - - For Each dCoumn As DataColumn In DtIngresosAnualH.Columns - - If IndexData >= 13 Then - - If dCoumn.ColumnName.ToEntero > 0 And dCoumn.ColumnName.ToEntero <= DdlEjercicio2.SelectedValue.ToEntero Then - - CType(GvIngresosAnualH.Columns(IndexGv), BoundField).DataField = dCoumn.ColumnName - CType(GvIngresosAnualH.Columns(IndexGv), BoundField).HeaderText = dCoumn.ColumnName - - - listaCamposanios.Add(New String() {dCoumn.ColumnName.ToString(), dCoumn.ColumnName.ToString()}) - - listaCamposaniosTotal.Add(New String() {dCoumn.ColumnName.ToString(), dCoumn.ColumnName.ToString()}) - 'CType(GvIngresosAnualH.Columns(IndexGv), BoundField).DataField = dCoumn.ColumnName - 'CType(GvIngresosAnualH.Columns(IndexGv), BoundField).HeaderText = dCoumn.ColumnName - GvIngresosAnualH.Columns(IndexGv).Visible = True - - - CType(GvTotalesAnualH.Columns(IndexGv), BoundField).DataField = dCoumn.ColumnName - CType(GvTotalesAnualH.Columns(IndexGv), BoundField).HeaderText = dCoumn.ColumnName - 'CType(GvTotalesAnualH.Columns(IndexGv), BoundField).DataField = dCoumn.ColumnName - 'CType(GvTotalesAnualH.Columns(IndexGv), BoundField).HeaderText = dCoumn.ColumnName - GvTotalesAnualH.Columns(IndexGv).Visible = True - - IndexMax = IndexData - Else - GvIngresosAnualH.Columns(IndexGv).Visible = False - GvTotalesAnualH.Columns(IndexGv).Visible = False - End If - - - - IndexGv = IndexGv + 1 - End If - - IndexData = IndexData + 1 - - Next - - - For Each dr As DataRow In DtIngresosAnualH.FiltraParametros("NOT CtaMayor in (3,4)").Rows - - TotalActual += dr("ImporteActual").ToString.ToDouble - TotalAnterior += dr("ImporteAcumulado").ToString.ToDouble - - Next - - IndexData = 13 - For IndexData = 13 To IndexMax - Row.Item(IndexData) = DtIngresosAnualH.SUM($"[{DtIngresosAnualH.Columns(IndexData).ColumnName}]", "NOT CtaMayor in (3,4)") - Next - - Row.Item("Nombre") = "TOTAL INGRESOS " - Row.Item("ImporteActual") = DtIngresosAnualH.SUM("ImporteActual", "NOT CtaMayor in (3,4)") 'TotalActual.ToString - Row.Item("PorcentajeActual") = "100.00" - Row.Item("ImporteAcumulado") = DtIngresosAnualH.SUM("ImporteAcumulado", "NOT CtaMayor in (3,4)") 'TotalAnterior.ToString - Row.Item("PorcentajeAcumulado") = "100.00" - Row.Item("CtaMayor") = -1 - Row.Item("CountDinamico") = DtGastosAnualH.MAX("CountDinamico") - CountDinamicoAnual = DtGastosAnualH.MAX("CountDinamico").ToEntero - DtIngresosAnualH.Rows.Add(Row) - Else - Row.Item("Nombre") = "TOTAL INGRESOS " - Row.Item("ImporteActual") = "0.00" - Row.Item("ImporteAcumulado") = "0.00" - Row.Item("CtaMayor") = -1 - DtIngresosAnualH.Rows.Add(Row) - End If - - Dim T1 = TotalActual, T2 = TotalAnterior - - TotalActual = 0 - TotalAnterior = 0 - - Row = DtGastosAnualH.NewRow - - If DtGastosAnualH.Rows.Count > 0 Then - - - IndexData = 0 - IndexGv = 1 - IndexMax = 0 - - For Each dCoumn As DataColumn In DtGastosAnualH.Columns - - If IndexData >= 13 Then - - If dCoumn.ColumnName.ToEntero > 0 And dCoumn.ColumnName.ToEntero <= DdlEjercicio2.SelectedValue.ToEntero Then - 'HyperLinkField - - CType(GvGastosAnualH.Columns(IndexGv), BoundField).DataField = dCoumn.ColumnName - CType(GvGastosAnualH.Columns(IndexGv), BoundField).HeaderText = dCoumn.ColumnName - listaCamposaniosGastos.Add(New String() {dCoumn.ColumnName.ToString(), dCoumn.ColumnName.ToString()}) - - 'CType(GvGastosAnualH.Columns(IndexGv), HyperLinkField).DataNavigateUrlFields = {"CveCuenta", "FechaInicial", "FechaFActual", "CveSubProyecto"} - 'CType(GvGastosAnualH.Columns(IndexGv), HyperLinkField).DataNavigateUrlFormatString = "/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1&CveSubProyecto{3}" - - 'CType(GvGastosAnualH.Columns(IndexGv), BoundField).DataField = dCoumn.ColumnName - 'CType(GvGastosAnualH.Columns(IndexGv), BoundField).HeaderText = dCoumn.ColumnName - - GvGastosAnualH.Columns(IndexGv).Visible = True - IndexMax = IndexData - Else - GvGastosAnualH.Columns(IndexGv).Visible = False - End If - - - - IndexGv = IndexGv + 1 - End If - - IndexData = IndexData + 1 - - Next - - - For Each dr As DataRow In DtGastosAnualH.FiltraParametros("Not CtaMayor In (3,4)").Rows - TotalActual += dr("ImporteActual").ToString.ToDouble - TotalAnterior += dr("ImporteAcumulado").ToString.ToDouble - Next - - IndexData = 13 - For IndexData = 13 To IndexMax - - Row.Item(IndexData) = DtGastosAnualH.SUM($"[{DtIngresosAnualH.Columns(IndexData).ColumnName}]", "Not CtaMayor In (3,4)") - - Next - - Row.Item("Nombre") = "TOTAL GASTOS" - Row.Item("ImporteActual") = TotalActual - Row.Item("PorcentajeActual") = If(T1 > 0, (TotalActual * 100 / T1).ToString, "0").FormatoNumero - Row.Item("ImporteAcumulado") = TotalAnterior.ToString - Row.Item("PorcentajeAcumulado") = If(T2 > 0, (TotalAnterior * 100 / T2).ToString, "0").FormatoNumero - Row.Item("CtaMayor") = -1 - Row.Item("CountDinamico") = DtGastosAnualH.MAX("CountDinamico") - DtGastosAnualH.Rows.Add(Row) - Else - Row.Item("Nombre") = "TOTAL GASTOS" - Row.Item("ImporteActual") = "0.00" - Row.Item("ImporteAcumulado") = "0.00" - Row.Item("CtaMayor") = -1 - DtGastosAnualH.Rows.Add(Row) - End If - - If DtIngresosAnualH.Rows.Count > 0 Then - - Row = DTTotalesAnualH.NewRow - - - IndexData = 13 - For IndexData = 13 To IndexMax - Row.Item(IndexData) = DtIngresosAnualH.SUM($"[{DtIngresosAnualH.Columns(IndexData).ColumnName}]", "Not CtaMayor In (-1,3,4)") - DtGastosAnualH.SUM($"[{DtGastosAnualH.Columns(IndexData).ColumnName}]", "Not CtaMayor In (-1,3,4)") - Next - - Row.Item("Nombre") = "Resultados del Ejercicio" - Row.Item("ImporteAcumulado") = DtIngresosAnualH.SUM($"ImporteAcumulado", "Not CtaMayor in (-1,3,4)") - DtGastosAnualH.SUM($"ImporteAcumulado", "Not CtaMayor in (-1,3,4)") - - - DTTotalesAnualH.Rows.Add(Row) - - End If - - GvIngresosAnualH.DataSource = DtIngresosAnualH - GvIngresosAnualH.DataBind() - - GvGastosAnualH.DataSource = DtGastosAnualH - GvGastosAnualH.DataBind() - - GvTotalesAnualH.DataSource = DTTotalesAnualH - GvTotalesAnualH.DataBind() - - UpDatosAnualH.Update() - - End Sub - - - - Protected Sub GvIngresosAnualH_RowDataBound(sender As Object, e As GridViewRowEventArgs) - If e.Row.RowType = DataControlRowType.DataRow Then - setgraficaCCAnual(e, listaCamposanios) - If e.Row.DBCampo("CtaMayor").ToString.ToEntero < 0 Then - TotalActualMes += e.Row.DBCampo("ImporteActual").ToString.ToDouble - TotalAnteriorMes += e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble - 'e.Row.ControlStyle.BackColor = Drawing.Color.LightGray - 'e.Row.ControlStyle.ForeColor = Drawing.Color.White - e.Row.ControlStyle.Font.Bold = True - ElseIf e.Row.DBCampo("CtaMayor").ToString.ToEntero = 3 Then - 'e.Row.CssClass = "SubTotales3" - e.Row.ControlStyle.Font.Bold = True - End If - - - Dim CveCuenta As Integer = e.Row.DataKey("CveCuenta").ToEntero - Dim CveSubProyecto As Integer = e.Row.DataKey("CveSubProyecto").ToEntero - - If e.Row.DBCampo("CtaMayor").ToString.ToEntero > 0 Then - - e.Row.FCHyperLink("HLNombre").NavigateUrl = $"./RepAnexoCatalogoAnual.aspx?CveCuenta={e.Row.DBCampo("CveCuenta").ToString}&Ejercicio={DdlEjercicio.SelectedValue}&Divisor={DdlDivisor.SelectedValue}&CveSubProyecto={DdlSubproyecto.SelectedValue}&EjercicioFinal={DdlEjercicio2.SelectedValue}&Periodo={DdlPeriodo.SelectedValue}" - - Dim CountDinamico As Integer = e.Row.DataKey("CountDinamico").ToEntero - Dim IndiceInicio As Integer = 1 - Dim IndiceMax As Integer = 1 + CountDinamico - - For IndiceInicio = 1 To IndiceMax - Dim Anio As String = CType(GvGastosAnualH.Columns(IndiceInicio), BoundField).DataField - Dim Importe As Decimal = e.Row.Cells(IndiceInicio).Text.ToDecimal - e.Row.Cells(IndiceInicio).Text = $"{ If(DdlDivisor.SelectedValue.ToEntero > 1, Importe.ToString("###,###,##0"), Importe.ToString("###,###,###.00")) }" - 'e.Row.Cells(IndiceInicio).ForeColor = If(Importe < 0, Drawing.Color.Red, e.Row.Cells(IndiceInicio).ForeColor) - Next IndiceInicio - - 'e.Row.FCHyperLink("HLAnterior").NavigateUrl = $"./RepAnexoCatalogo.aspx?CveCuenta={CveCuenta}&FF=31/12/{DdlEjercicio2.SelectedValue}&FI=01/01/{DdlEjercicio.SelectedValue}&ER=1&CveSubProyecto={CveSubProyecto}" - e.Row.FCHyperLink("HLAnterior").NavigateUrl = $"./RepAnexoCatalogoAnual.aspx?CveCuenta={e.Row.DBCampo("CveCuenta").ToString}&Ejercicio={DdlEjercicio.SelectedValue}&Divisor={DdlDivisor.SelectedValue}&CveSubProyecto={DdlSubproyecto.SelectedValue}&EjercicioFinal={DdlEjercicio2.SelectedValue}&Periodo={DdlPeriodo.SelectedValue}" - - - - ElseIf e.Row.DBCampo("CtaMayor").ToString.ToEntero = -1 Then - - Dim CountDinamico As Integer = e.Row.DataKey("CountDinamico").ToEntero - Dim IndiceInicio As Integer = 1 - Dim IndiceMax As Integer = 1 + CountDinamico - - For IndiceInicio = 1 To IndiceMax - - Dim Importe As Decimal = e.Row.Cells(IndiceInicio).Text.ToDecimal - e.Row.Cells(IndiceInicio).Text = $"{ If(DdlDivisor.SelectedValue.ToEntero > 1, Importe.ToString("###,###,##0"), Importe.ToString("###,###,###.00")) }" - - Next IndiceInicio - - - End If - - - - If e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble < 0 Then - e.Row.FCHyperLink("HLAnterior").ForeColor = Drawing.Color.Red - End If - End If - End Sub - - Protected Sub GvGastosAnualH_RowDataBound(sender As Object, e As GridViewRowEventArgs) - If e.Row.RowType = DataControlRowType.DataRow Then - setgraficaCCAnual(e, listaCamposaniosGastos) - If e.Row.DBCampo("CtaMayor").ToString.ToEntero < 0 Then - TotalActualMes -= e.Row.DBCampo("ImporteActual").ToString.ToDouble - TotalAnteriorMes -= e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble - 'e.Row.ControlStyle.BackColor = Drawing.Color.LightGray - 'e.Row.ControlStyle.ForeColor = Drawing.Color.White - e.Row.ControlStyle.Font.Bold = True - ElseIf e.Row.DBCampo("CtaMayor").ToString.ToEntero = 3 Then - 'e.Row.CssClass = "SubTotales" - e.Row.ControlStyle.Font.Bold = True - End If - - Dim CveCuenta As Integer = e.Row.DataKey("CveCuenta").ToEntero - Dim CveSubProyecto As Integer = e.Row.DataKey("CveSubProyecto").ToEntero - If e.Row.DBCampo("CtaMayor").ToString.ToEntero > 0 Then - - 'e.Row.FCHyperLink("HLNombre").NavigateUrl = $"./RepAnexoCatalogoAnual.aspx?CveCuenta={e.Row.DBCampo("CveCuenta").ToString}&Ejercicio={DdlEjercicio.SelectedValue}&Divisor={DdlDivisor.SelectedValue}&CveSubProyecto=-1&EjercicioFinal={DdlEjercicio2.SelectedValue}" - e.Row.FCHyperLink("HLNombre").NavigateUrl = $"./RepAnexoCatalogoAnual.aspx?CveCuenta={e.Row.DBCampo("CveCuenta").ToString}&Ejercicio={DdlEjercicio.SelectedValue}&Divisor={DdlDivisor.SelectedValue}&CveSubProyecto={DdlSubproyecto.SelectedValue}&EjercicioFinal={DdlEjercicio2.SelectedValue}&Periodo={DdlPeriodo.SelectedValue}" - - Dim CountDinamico As Integer = e.Row.DataKey("CountDinamico").ToEntero - Dim IndiceInicio As Integer = 1 - Dim IndiceMax As Integer = 1 + CountDinamico - For IndiceInicio = 1 To IndiceMax - Dim Anio As String = CType(GvGastosAnualH.Columns(IndiceInicio), BoundField).DataField - Dim Importe As Decimal = e.Row.Cells(IndiceInicio).Text.ToDecimal - e.Row.Cells(IndiceInicio).Text = $"{If(DdlDivisor.SelectedValue.ToEntero > 1, Importe.ToString("###,###,##0"), Importe.ToString("###,###,###.00"))}" - 'e.Row.Cells(IndiceInicio).ForeColor = If(Importe < 0, Drawing.Color.Red, e.Row.Cells(IndiceInicio).ForeColor) - Next IndiceInicio - - 'e.Row.FCHyperLink("HLAnterior").NavigateUrl = $"./RepAnexoCatalogo.aspx?CveCuenta={CveCuenta}&FF=31/12/{DdlEjercicio2.SelectedValue}&FI=01/01/{DdlEjercicio.SelectedValue}&ER=1&CveSubProyecto={CveSubProyecto}" - e.Row.FCHyperLink("HLAnterior").NavigateUrl = $"./RepAnexoCatalogoAnual.aspx?CveCuenta={e.Row.DBCampo("CveCuenta").ToString}&Ejercicio={DdlEjercicio.SelectedValue}&Divisor={DdlDivisor.SelectedValue}&CveSubProyecto={DdlSubproyecto.SelectedValue}&EjercicioFinal={DdlEjercicio2.SelectedValue}&Periodo={DdlPeriodo.SelectedValue}" - - - ElseIf e.Row.DBCampo("CtaMayor").ToString.ToEntero = -1 Then - - Dim CountDinamico As Integer = e.Row.DataKey("CountDinamico").ToEntero - Dim IndiceInicio As Integer = 1 - Dim IndiceMax As Integer = 1 + CountDinamico - - For IndiceInicio = 1 To IndiceMax - - Dim Importe As Decimal = e.Row.Cells(IndiceInicio).Text.ToDecimal - e.Row.Cells(IndiceInicio).Text = $"{ If(DdlDivisor.SelectedValue.ToEntero > 1, Importe.ToString("###,###,##0"), Importe.ToString("###,###,###.00")) }" - - Next IndiceInicio - - End If - - If e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble < 0 Then - e.Row.FCHyperLink("HLAnterior").ForeColor = Drawing.Color.Red - End If - End If - End Sub - - Protected Sub GvTotalesAnualH_RowDataBound(sender As Object, e As GridViewRowEventArgs) - - If e.Row.RowType = DataControlRowType.Header Then - e.Row.Attributes.Add("style", "display:none") - End If - - If e.Row.RowType = DataControlRowType.DataRow Then - setgraficaCCAnual(e, listaCamposaniosTotal) - e.Row.Attributes.Add("style", "Font-weight: bold") - End If - - End Sub - - Public Sub setgraficaCCAnual(e As GridViewRowEventArgs, listaCampos As List(Of String())) - Dim lista As New List(Of Object) - Dim colorindex As Integer = 0 - For Each campo As String() In listaCampos - lista.Add(New With {.Texto = campo(1), .Valor = e.Row.DBCampo(campo(0)).ToDecimal(), .Color = listacolores(colorindex)}) - colorindex = colorindex + 1 - If colorindex >= listacolores.Count Then - colorindex = 0 - End If - Next - e.Row.FCHyperLink("Hypgrafica").Attributes.Add("data-values", Newtonsoft.Json.JsonConvert.SerializeObject(lista)) - End Sub -#End Region - - -#Region "S U B P R O Y E C T O H O R I Z O N T A L" - - Private Sub CargaDatosSubProyectoH() - - - FechaIMes = $"01/01/{DdlEjercicio.SelectedValue}" - FechaFMes = $"01/{DdlPeriodo.SelectedValue.ToEntero.ToString("00")}/{DdlEjercicio.SelectedValue}" - FechaFMes = DateAdd(DateInterval.Day, -1, DateAdd(DateInterval.Month, 1, CDate(FechaFMes))).ToString("dd/MM/yyyy") - - Dim CveSubProyecto As Integer = DdlSubproyecto.SelectedValue.ToEntero - - - Dim ObjConta As New ClsContabilidad - If ObjConta.GetEstadosSubProyectoHorizontal(FechaIMes.ToDate, FechaFMes.ToDate, CveSubProyecto, DdlDivisor.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) Then - DTSubProyectosCabecerasH = ObjConta.DSResultados.Tables(0) - DtDatosSubProyectoH = ObjConta.DSResultados.Tables(1).FiltraParametros("(ImporteActual <> 0 OR ImporteAcumulado <> 0)") - Else - DtDatosSubProyectoH = Nothing - Alert("Ocurrio un error al cargar los datos del Estado de Actividades", TipoMensaje.MsgError) - End If - ObjConta.Dispose() - - If DtDatosSubProyectoH IsNot Nothing And DTSubProyectosCabecerasH IsNot Nothing Then - CargaGridsSubProyectoH() - End If - - End Sub - - Private Sub CargaGridsSubProyectoH() - - DtIngresosSubProyectoH = DtDatosSubProyectoH.FiltraParametros("Tipo ='H' ") - DtGastosSubProyectoH = DtDatosSubProyectoH.FiltraParametros("Tipo ='G' ") - DTTotalesSubProyectoH = DtDatosSubProyectoH.Clone() - - Dim Row As DataRow = DtIngresosSubProyectoH.NewRow - - Dim TotalActual = 0.0, TotalAnterior = 0.0 - - - Dim IndexData As Integer = 0 - Dim IndexGv As Integer = 1 - Dim IndexMax As Integer = 1 - Dim IndexSubProyecto = 0 - Dim IndexSubProyectoMAx As Integer = DTSubProyectosCabecerasH.Rows.Count - 1 - Dim IndexTotatles As Integer = 13 + IndexSubProyectoMAx - - '34 - Dim IDX_LIMPIAR As Integer = 1 - - For IDX_LIMPIAR = 1 To 35 - CType(GvIngresosSubProyectoH.Columns(IDX_LIMPIAR), BoundField).DataField = Nothing - CType(GvIngresosSubProyectoH.Columns(IDX_LIMPIAR), BoundField).HeaderText = "" - GvIngresosSubProyectoH.Columns(IDX_LIMPIAR).Visible = False - Next - listaCampos.Clear() - - - If DtIngresosSubProyectoH.Rows.Count > 0 Then - - For Each dCoumn As DataColumn In DtIngresosSubProyectoH.Columns - - If IndexData >= 13 Then - - If IndexSubProyecto <= IndexSubProyectoMAx Then - - CType(GvIngresosSubProyectoH.Columns(IndexGv), BoundField).DataField = dCoumn.ColumnName - GvIngresosSubProyectoH.Columns(IndexGv).Visible = True - - CType(GvTotalesSubProyectoH.Columns(IndexGv), BoundField).DataField = dCoumn.ColumnName - GvTotalesSubProyectoH.Columns(IndexGv).Visible = True - - If IndexSubProyecto <= IndexSubProyectoMAx Then - CType(GvIngresosSubProyectoH.Columns(IndexGv), BoundField).HeaderText = DTSubProyectosCabecerasH.Rows(IndexSubProyecto)(0).ToString - CType(GvTotalesSubProyectoH.Columns(IndexGv), BoundField).HeaderText = DTSubProyectosCabecerasH.Rows(IndexSubProyecto)(0).ToString - CType(GvGastosSubProyectoH.Columns(IndexGv), BoundField).HeaderText = DTSubProyectosCabecerasH.Rows(IndexSubProyecto)(0).ToString - End If - listaCampos.Add(New String() {dCoumn.ColumnName.ToString(), DTSubProyectosCabecerasH.Rows(IndexSubProyecto)(0).ToString()}) - Else - GvIngresosSubProyectoH.Columns(IndexGv).Visible = False - GvTotalesSubProyectoH.Columns(IndexGv).Visible = False - End If - - IndexGv = IndexGv + 1 - IndexSubProyecto = IndexSubProyecto + 1 - IndexMax = IndexMax + 1 - - End If - IndexData = IndexData + 1 - Next - - - For Each dr As DataRow In DtIngresosSubProyectoH.FiltraParametros("NOT CtaMayor in (3,4)").Rows - TotalActual += dr("ImporteActual").ToString.ToDouble - TotalAnterior += dr("ImporteAcumulado").ToString.ToDouble - Next - - IndexData = 13 - For IndexData = 13 To IndexTotatles - Row.Item(IndexData) = DtIngresosSubProyectoH.SUM($"[{DtIngresosSubProyectoH.Columns(IndexData).ColumnName}]", "NOT CtaMayor in (3,4)") - Next - - Row.Item("Nombre") = "TOTAL INGRESOS " - Row.Item("ImporteActual") = DtIngresosSubProyectoH.SUM("ImporteActual", "NOT CtaMayor in (3,4)") 'TotalActual.ToString - Row.Item("PorcentajeActual") = "100.00" - Row.Item("ImporteAcumulado") = DtIngresosSubProyectoH.SUM("ImporteAcumulado", "NOT CtaMayor in (3,4)") 'TotalAnterior.ToString - Row.Item("PorcentajeAcumulado") = "100.00" - Row.Item("CtaMayor") = -1 - Row.Item("CountDinamico") = DtIngresosSubProyectoH.MAX("CountDinamico") - CountDinamicoSubProyecto = DtIngresosSubProyectoH.MAX("CountDinamico").ToEntero - DtIngresosSubProyectoH.Rows.Add(Row) - Else - Row.Item("Nombre") = "TOTAL INGRESOS " - Row.Item("ImporteActual") = "0.00" - Row.Item("ImporteAcumulado") = "0.00" - Row.Item("CtaMayor") = -1 - DtIngresosSubProyectoH.Rows.Add(Row) - End If - - Dim T1 = TotalActual, T2 = TotalAnterior - - TotalActual = 0 - TotalAnterior = 0 - - Row = DtGastosSubProyectoH.NewRow - - If DtGastosSubProyectoH.Rows.Count > 0 Then - - - IndexData = 0 - IndexGv = 1 - IndexMax = 0 - IndexSubProyecto = 0 - - For Each dCoumn As DataColumn In DtIngresosSubProyectoH.Columns - If IndexData >= 13 Then - If IndexSubProyecto <= IndexSubProyectoMAx Then - CType(GvGastosSubProyectoH.Columns(IndexGv), BoundField).DataField = dCoumn.ColumnName - GvGastosSubProyectoH.Columns(IndexGv).Visible = True - CType(GvTotalesSubProyectoH.Columns(IndexGv), BoundField).DataField = dCoumn.ColumnName - GvTotalesSubProyectoH.Columns(IndexGv).Visible = True - Else - GvIngresosSubProyectoH.Columns(IndexGv).Visible = False - GvTotalesSubProyectoH.Columns(IndexGv).Visible = False - End If - - IndexGv = IndexGv + 1 - IndexSubProyecto = IndexSubProyecto + 1 - End If - IndexData = IndexData + 1 - Next - - - - For Each dr As DataRow In DtGastosSubProyectoH.FiltraParametros("NOT CtaMayor in (3,4)").Rows - TotalActual += dr("ImporteActual").ToString.ToDouble - TotalAnterior += dr("ImporteAcumulado").ToString.ToDouble - Next - - IndexData = 13 - For IndexData = 13 To IndexTotatles - Row.Item(IndexData) = DtGastosSubProyectoH.SUM($"[{DtIngresosSubProyectoH.Columns(IndexData).ColumnName}]", "NOT CtaMayor in (3,4)") - Next - - Row.Item("Nombre") = "TOTAL GASTOS" - Row.Item("ImporteActual") = TotalActual - Row.Item("PorcentajeActual") = If(T1 > 0, (TotalActual * 100 / T1).ToString, "0").FormatoNumero - Row.Item("ImporteAcumulado") = TotalAnterior.ToString - Row.Item("PorcentajeAcumulado") = If(T2 > 0, (TotalAnterior * 100 / T2).ToString, "0").FormatoNumero - Row.Item("CtaMayor") = -1 - Row.Item("CountDinamico") = DtGastosSubProyectoH.MAX("CountDinamico") - - DtGastosSubProyectoH.Rows.Add(Row) - Else - Row.Item("Nombre") = "TOTAL GASTOS" - Row.Item("ImporteActual") = "0.00" - Row.Item("ImporteAcumulado") = "0.00" - Row.Item("CtaMayor") = -1 - DtGastosSubProyectoH.Rows.Add(Row) - End If - - If DtIngresosSubProyectoH.Rows.Count > 0 Then - - Row = DTTotalesSubProyectoH.NewRow - - IndexData = 13 - For IndexData = 13 To IndexTotatles - Row.Item(IndexData) = DtIngresosSubProyectoH.SUM($"[{DtIngresosSubProyectoH.Columns(IndexData).ColumnName}]", "NOT CtaMayor in (-1,3,4)") - DtGastosSubProyectoH.SUM($"[{DtGastosSubProyectoH.Columns(IndexData).ColumnName}]", "NOT CtaMayor in (-1,3,4)") - Next - - Row.Item("Nombre") = "Resultado del ejercicio" - Row.Item("ImporteAcumulado") = DtIngresosSubProyectoH.SUM($"ImporteAcumulado", "NOT CtaMayor in (-1,3,4)") - DtGastosSubProyectoH.SUM($"ImporteAcumulado", "NOT CtaMayor in (-1,3,4)") - Row.Item("CtaMayor") = -2 - Row.Item("CountDinamico") = DtIngresosSubProyectoH.MAX("CountDinamico") - - DTTotalesSubProyectoH.Rows.Add(Row) - - End If - - DtIngresosSubProyectoH.Merge(DtGastosSubProyectoH) - DtIngresosSubProyectoH.Merge(DTTotalesSubProyectoH) - - - GvIngresosSubProyectoH.DataSource = DtIngresosSubProyectoH - GvIngresosSubProyectoH.DataBind() - - - - UpDatosSubProyectoH.Update() - - End Sub - - 'Private Sub SumaTotalesSubProyectoH() - ' ''Llena Lb´s Totales - ' ''********************************************************************************* - ' 'LbTotalActual.Text = TotalActualMes.ToString.FormatoNumero - ' 'LbTotalAnterior.Text = TotalAnteriorMes.ToString.FormatoNumero - - ' 'LbTotalActual.ForeColor = If(TotalActualMes < 0, Drawing.Color.Red, Color.Black) - ' 'LbTotalAnterior.ForeColor = If(TotalAnteriorMes < 0, Drawing.Color.Red, Color.Black) - - - 'End Sub - - Protected Sub GvIngresosSubProyectoH_RowDataBound(sender As Object, e As GridViewRowEventArgs) - - If e.Row.RowType = DataControlRowType.DataRow Then - If e.Row.DBCampo("CtaMayor").ToString.ToEntero = -1 Then - TotalActualMes += e.Row.DBCampo("ImporteActual").ToString.ToDouble - TotalAnteriorMes += e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble - 'e.Row.ControlStyle.BackColor = Drawing.Color.LightGray - 'e.Row.ControlStyle.ForeColor = Drawing.Color.White - e.Row.ControlStyle.Font.Bold = True - ElseIf e.Row.DBCampo("CtaMayor").ToString.ToEntero = 3 Then - 'e.Row.CssClass = "SubTotales3" - e.Row.ControlStyle.Font.Bold = True - - ElseIf e.Row.DBCampo("CtaMayor").ToString.ToEntero = -2 Then - - e.Row.ControlStyle.Font.Bold = True - e.Row.ControlStyle.Font.Size = 13 - End If - Dim CveCuenta As Integer = e.Row.DataKey("CveCuenta").ToEntero - setgraficaCC(e) - 'Dim CveSubProyecto As Integer = e.Row.DataKey("CveSubProyecto").ToEntero - If e.Row.DBCampo("CtaMayor").ToString.ToEntero > 0 Then - - e.Row.FCHyperLink("HLNombre").NavigateUrl = $"./RepAnexoCatalogoCC.aspx?CveCuenta={e.Row.DBCampo("CveCuenta").ToString}&Ejercicio={DdlEjercicio.SelectedValue}&Divisor={DdlDivisor.SelectedValue}&CveSubProyecto={DdlSubproyecto.SelectedValue}&Periodo={DdlPeriodo.SelectedValue}" - - Dim CountDinamico As Integer = e.Row.DataKey("CountDinamico").ToEntero - Dim IndiceInicio As Integer = 1 - Dim IndiceMax As Integer = 1 + CountDinamico - - Dim FEchaMesFinal As Date = New Date(DdlEjercicio.SelectedValue.ToEntero, DdlPeriodo.SelectedValue.ToEntero, 1).LastDayOfMonth - - For IndiceInicio = 1 To IndiceMax - - Dim CveSubProyectoIntermo As String = CType(GvGastosSubProyectoH.Columns(IndiceInicio), BoundField).DataField - Dim Importe As Decimal = e.Row.Cells(IndiceInicio).Text.ToDecimal - - - If CveSubProyectoIntermo.ToEntero > 0 Then - e.Row.Cells(IndiceInicio).Text = $"{ If(DdlDivisor.SelectedValue.ToEntero > 1, Importe.ToString("###,###,##0"), Importe.ToString("###,###,###.00")) }" - End If - - - - Next IndiceInicio - - e.Row.FCHyperLink("HLAnterior").NavigateUrl = $"./RepAnexoCatalogoCC.aspx?CveCuenta={e.Row.DBCampo("CveCuenta").ToString}&Ejercicio={DdlEjercicio.SelectedValue}&Divisor={DdlDivisor.SelectedValue}&CveSubProyecto={DdlSubproyecto.SelectedValue}&Periodo={DdlPeriodo.SelectedValue}" - - ElseIf e.Row.DBCampo("CtaMayor").ToString.ToEntero = -1 Then - - Dim CountDinamico As Integer = e.Row.DataKey("CountDinamico").ToEntero - Dim IndiceInicio As Integer = 1 - Dim IndiceMax As Integer = 1 + CountDinamico - - For IndiceInicio = 1 To IndiceMax - - Dim Importe As Decimal = e.Row.Cells(IndiceInicio).Text.ToDecimal - e.Row.Cells(IndiceInicio).Text = $"
    { If(DdlDivisor.SelectedValue.ToEntero > 1, Importe.ToString("###,###,##0"), Importe.ToString("###,###,###.00")) }
    " - Next IndiceInicio - - - - ElseIf e.Row.DBCampo("CtaMayor").ToString.ToEntero = -2 Then - - Dim CountDinamico As Integer = e.Row.DataKey("CountDinamico").ToEntero - Dim IndiceInicio As Integer = 1 - Dim IndiceMax As Integer = 1 + CountDinamico - - For IndiceInicio = 1 To IndiceMax - - Dim Importe As Decimal = e.Row.Cells(IndiceInicio).Text.ToDecimal - e.Row.Cells(IndiceInicio).Text = $"
    { If(DdlDivisor.SelectedValue.ToEntero > 1, Importe.ToString("###,###,##0"), Importe.ToString("###,###,###.00")) }
    " - - Next IndiceInicio - - - End If - e.Row.FCHyperLink("HLAnterior").Text = If(DdlDivisor.SelectedValue.ToEntero > 1, e.Row.DBCampo("ImporteAcumulado").ToString.ToDecimal.ToString("###,###,##0"), e.Row.DBCampo("ImporteAcumulado").ToString.ToDecimal.ToString("###,###,##0.00")) - If e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble < 0 Then - e.Row.FCHyperLink("HLAnterior").ForeColor = Drawing.Color.Red - End If - - End If - - End Sub - - Protected Sub GvGastosSubProyectoH_RowDataBound(sender As Object, e As GridViewRowEventArgs) - If e.Row.RowType = DataControlRowType.DataRow Then - setgraficaCC(e) - If e.Row.DBCampo("CtaMayor").ToString.ToEntero < 0 Then - TotalActualMes -= e.Row.DBCampo("ImporteActual").ToString.ToDouble - TotalAnteriorMes -= e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble - e.Row.ControlStyle.Font.Bold = True - ElseIf e.Row.DBCampo("CtaMayor").ToString.ToEntero = 3 Then - 'e.Row.CssClass = "SubTotales" - e.Row.ControlStyle.Font.Bold = True - End If - If e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble < 0 Then - e.Row.FCHyperLink("HLAnterior").ForeColor = Drawing.Color.Red - End If - End If - End Sub - - Protected Sub GvTotalesSubProyectoH_RowDataBound(sender As Object, e As GridViewRowEventArgs) - If e.Row.RowType = DataControlRowType.Header Then - ' e.Row.Attributes.Add("style", "display:none") - End If - If e.Row.RowType = DataControlRowType.DataRow Then - setgraficaCC(e) - e.Row.Attributes.Add("style", "Font-weight: bold") - End If - End Sub - - Public Sub setgraficaCC(e As GridViewRowEventArgs) - Dim lista As New List(Of Object) - Dim colorindex As Integer = 0 - For Each campo As String() In listaCampos - lista.Add(New With {.Texto = campo(1), .Valor = e.Row.DBCampo(campo(0)).ToDecimal(), .Color = listacolores(colorindex)}) - colorindex = colorindex + 1 - If colorindex >= listacolores.Count Then - colorindex = 0 - End If - Next - e.Row.FCHyperLink("Hypgrafica").Attributes.Add("data-values", Newtonsoft.Json.JsonConvert.SerializeObject(lista)) - End Sub -#End Region - - - - - -#Region "DESCARGA EXCEL" - - Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click - Imprimir("Excel") - End Sub - - Private Sub Imprimir(Optional reporte As String = "PDF") - - - If TAB.ActiveTabIndex = 0 AndAlso GvIngresosMes.Rows.Count > 0 Then - ExportToExcelG(GvIngresosMes, GvGastosMes, TMesT1, "Reporte_Mensual", UsuarioActual, "Mensual") - ElseIf TAB.ActiveTabIndex = 1 AndAlso GvIngresosMesH.Rows.Count > 0 Then - ExportToExcelG(GvIngresosMesH, GvGastosMesH, TMesT1, "Reporte_Mensual_Horizontal", UsuarioActual, "Mensual Horizontal", Gv3:=GvTotalesMesH) - ElseIf TAB.ActiveTabIndex = 2 AndAlso GvIngresosAnualH.Rows.Count > 0 Then - ExportToExcelG(GvIngresosAnualH, GvGastosAnualH, TMesT1, "Reporte_Anual_Horizontal", UsuarioActual, "Anual Horizontal", Gv3:=GvTotalesAnualH) - - ElseIf TAB.ActiveTabIndex = 3 AndAlso GvIngresosSubProyectoH.Rows.Count > 0 Then - - ExportToExcelG(GvIngresosSubProyectoH, GvGastosSubProyectoH, TMesT1, "Reporte_Proyecto_Horizontal", UsuarioActual, $"Estado de Resultados Horizontal por {LblSubProyecto.Text}", Gv3:=GvTotalesSubProyectoH, EsPorSubProtyecto:=True) - - End If - - - End Sub - - 'Public Sub ExportToExcelG(Gv1 As GridView, Gv2 As GridView, NombreArchivoXLSx As String, Optional Titulo As String = "Reporte", Optional Usuario As Usuario = Nothing, Optional Filtros As String = "", Optional AlturaImagen As Double = 100, Optional AnchoImagen As Double = 100) - Public Sub ExportToExcelG(Gv1 As GridView, Gv2 As GridView, TablaResultados As HtmlTable, NombreArchivoXLSx As String, Usuario As Usuario, Titulo As String, Optional AlturaImagen As Double = 100, Optional AnchoImagen As Double = 100, Optional Gv3 As GridView = Nothing, Optional EsPorSubProtyecto As Boolean = False) - - Dim sw1 As New StringWriter() - Dim htw1 As New HtmlTextWriter(sw1) - Gv1.RenderControl(htw1) - - Dim sw2 As New StringWriter() - Dim htw2 As New HtmlTextWriter(sw2) - Gv2.RenderControl(htw2) - - - TablaResultados.Width = Gv2.Width.ToString - - Dim sw3 As New StringWriter() - Dim htw3 As New HtmlTextWriter(sw3) - TablaResultados.RenderControl(htw3) - - Dim options = GemBox.Spreadsheet.LoadOptions.HtmlDefault - - Dim htmlStream1 = New MemoryStream(options.Encoding.GetBytes(sw1.ToString())) - Dim htmlStream2 = New MemoryStream(options.Encoding.GetBytes(sw2.ToString())) - Dim htmlStream3 = New MemoryStream(options.Encoding.GetBytes(sw3.ToString())) - - htmlStream1.Position = 0 - Dim sr1 As New StreamReader(htmlStream1) - - htmlStream2.Position = 0 - Dim sr2 As New StreamReader(htmlStream2) - - htmlStream3.Position = 0 - Dim sr3 As New StreamReader(htmlStream3) - - - Dim myStr1 = sr1.ReadToEnd() - Dim myStr2 = sr2.ReadToEnd() - Dim myStr3 = sr3.ReadToEnd() - - sr1.Dispose() - sr2.Dispose() - sr3.Dispose() - - htmlStream1.Dispose() - htmlStream2.Dispose() - htmlStream3.Dispose() - - sw1.Dispose() - sw2.Dispose() - sw3.Dispose() - - If Gv3 IsNot Nothing Then - - Gv3.ShowHeader = False - - Dim sw4 As New StringWriter() - Dim htw4 As New HtmlTextWriter(sw4) - Gv3.RenderControl(htw4) - Dim htmlStream4 = New MemoryStream(options.Encoding.GetBytes(sw4.ToString())) - htmlStream4.Position = 0 - Dim sr4 As New StreamReader(htmlStream4) - myStr3 = sr4.ReadToEnd() - - sr4.Dispose() - htmlStream2.Dispose() - sw4.Dispose() - - End If - - - Dim HtmlCompleto As String = myStr1 & "
    " & myStr2 & "
    " & myStr3 - - - HtmlCompleto = Regex.Replace(HtmlCompleto, "\<[\/]*a[^\>]*\>", "") - - - Dim htmlStream5 = New MemoryStream(options.Encoding.GetBytes(HtmlCompleto)) - - GemBox.Spreadsheet.SpreadsheetInfo.SetLicense(SerialGemBoxSpreadsheet) - - Dim excel As GemBox.Spreadsheet.ExcelFile - - excel = GemBox.Spreadsheet.ExcelFile.Load(htmlStream5, options) - - If Usuario IsNot Nothing Then - - Dim TotalRowHeader As Integer = 8 - Dim TotalRowFooter As Integer = 2 - - - Dim worksheet = excel.Worksheets(0) - worksheet.Rows.InsertEmpty(0, TotalRowHeader) - Dim celdasConTexto = worksheet.GetUsedCellRange(True) - celdasConTexto.Style.Font.Name = "Calibri Light" - - Dim RangoNombreEmpresa = worksheet.Cells.GetSubrangeAbsolute(1, celdasConTexto.FirstColumnIndex, 1, celdasConTexto.LastColumnIndex) - RangoNombreEmpresa.Merged = True - RangoNombreEmpresa.Value = Usuario.Empresa.Empresa - RangoNombreEmpresa.Style.Font.Size = 18 * 20 - RangoNombreEmpresa.Style.Font.Name = "Calibri Light" - RangoNombreEmpresa.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center - RangoNombreEmpresa.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center - - - Dim RangoTitulo = worksheet.Cells.GetSubrangeAbsolute(3, celdasConTexto.FirstColumnIndex, 3, celdasConTexto.LastColumnIndex) - RangoTitulo.Merged = True - RangoTitulo.Value = Titulo - RangoTitulo.Style.Font.Size = 20 * 20 - RangoTitulo.Style.Font.Name = "Calibri Light" - RangoTitulo.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center - RangoTitulo.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center - - Dim RangoFechas = worksheet.Cells.GetSubrangeAbsolute(4, celdasConTexto.FirstColumnIndex, 4, celdasConTexto.LastColumnIndex) - RangoFechas.Merged = True - RangoFechas.Value = $"Fechas: {FechaIMes} a {FechaFMes}" - RangoFechas.Style.Font.Size = 15 * 20 - RangoFechas.Style.Font.Name = "Calibri Light" - RangoFechas.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center - RangoFechas.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center - - - If EsPorSubProtyecto And DdlSubproyecto.SelectedValue.ToEntero > 0 Then - Dim RangoSubProyecto = worksheet.Cells.GetSubrangeAbsolute(5, celdasConTexto.FirstColumnIndex, 5, celdasConTexto.LastColumnIndex) - RangoSubProyecto.Merged = True - RangoSubProyecto.Value = DdlSubproyecto.SelectedItem.Text - RangoSubProyecto.Style.Font.Size = 20 * 20 - RangoSubProyecto.Style.Font.Name = "Calibri Light" - RangoSubProyecto.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center - RangoSubProyecto.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center - End If - - For i = celdasConTexto.FirstColumnIndex To celdasConTexto.LastColumnIndex - - worksheet.Rows(8).Cells(i).Style.Font.Size = 12 * 20 - worksheet.Rows(8).Cells(i).Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center - worksheet.Rows(8).Cells(i).Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center - - worksheet.Rows(8).Cells(i).Style.FillPattern.SetPattern(GemBox.Spreadsheet.FillPatternStyle.Solid, GemBox.Spreadsheet.SpreadsheetColor.FromArgb(75, 119, 190), GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255)) - worksheet.Rows(8).Cells(i).Style.Font.Color = GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255) - - - - If Not EsPorSubProtyecto Then - worksheet.Rows(8 + Gv1.Rows.Count + 2).Cells(i).Style.FillPattern.SetPattern(GemBox.Spreadsheet.FillPatternStyle.Solid, GemBox.Spreadsheet.SpreadsheetColor.FromArgb(75, 119, 190), GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255)) - worksheet.Rows(8 + Gv1.Rows.Count + 2).Cells(i).Style.Font.Color = GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255) - Else - worksheet.Rows(18).Cells(i).Style.FillPattern.SetPattern(GemBox.Spreadsheet.FillPatternStyle.Solid, GemBox.Spreadsheet.SpreadsheetColor.FromArgb(75, 119, 190), GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255)) - worksheet.Rows(18).Cells(i).Style.Font.Color = GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255) - End If - - - - If i > 0 Then - Try - worksheet.Columns(i).AutoFit(1) - Catch ex As Exception - End Try - End If - Next - - Dim IndexEndTable As Integer = Gv1.Rows.Count + Gv2.Rows.Count + 4 + TotalRowHeader + TotalRowFooter - - worksheet.Rows(IndexEndTable).Cells(0).Value = "Usuario Imprimió" - worksheet.Rows(IndexEndTable + 1).Cells(0).Value = Usuario.Nombre - - worksheet.Rows(IndexEndTable).Cells(2).Value = "Fecha Impresión" - worksheet.Rows(IndexEndTable + 1).Cells(2).Value = DateTime.Now.ToString("dd/MM/yyyy") - - Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", Usuario.Empresa.Ruta)) - - If Imagen.Exists Then - Dim Ruta As String = String.Format("{0}/Logo.png", Usuario.Empresa.Ruta) - Using sr As New StreamReader(Ruta) - Dim ms As New MemoryStream() - sr.BaseStream.CopyTo(ms) - worksheet.Pictures.Add(ms, ExcelPictureFormat.Png, "A1", AnchoImagen, AlturaImagen, LengthUnit.Pixel) - End Using - End If - - - - - - - For I = celdasConTexto.FirstColumnIndex To celdasConTexto.LastColumnIndex - - If I > 0 Then - - If DdlDivisor.SelectedValue.ToEntero = 1 Then - worksheet.Columns(I + 1).Style.NumberFormat = "#,##0.00" - Else - worksheet.Columns(I + 1).Style.NumberFormat = "#,##" - End If - - Try - worksheet.Columns(I).AutoFit(1) - Catch ex As Exception - End Try - - End If - Next - - End If - - excel.Save(HttpContext.Current.Response, $"{NombreArchivoXLSx}.xlsx") - - - End Sub - - Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control) - End Sub - -#End Region - - - - - -End Class - From 601c23100a36d1c1c28c87d16cfe3afa27613618 Mon Sep 17 00:00:00 2001 From: rrene Date: Fri, 24 Feb 2023 08:59:03 -0700 Subject: [PATCH 15/20] =?UTF-8?q?--=20correcci=C3=B3n=20de=20cvecuentasig?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Inventarios/RecepcionAlmacen.aspx.vb | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb index c23c87baf..b1237c243 100644 --- a/Inventarios/RecepcionAlmacen.aspx.vb +++ b/Inventarios/RecepcionAlmacen.aspx.vb @@ -3567,7 +3567,6 @@ Partial Class Inventarios_RecepcionAlmacen CveClasificacionDifCostoNC = gvr.DataKey("CveClasificacion").ToEntero Next Dim IdCtaContableClasificacion As Integer = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {CveClasificacionDifCostoNC}").ToEntero - Dim CveCuentaClasificacion As Integer = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostosSIG", $"CveClasificacion = {CveClasificacionDifCostoNC}").ToEntero TotalNC = TotalNC.RoundSQL Dim DifCostoNC As Decimal = (TotalCosto - TotalNC).RoundSQL @@ -3609,7 +3608,7 @@ Partial Class Inventarios_RecepcionAlmacen If ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, TotalNC, SerieFolio, CveConceptoContableNC, SerieFolio, Fecha, IdCtaContableNC, -1, CveCompra:=CveCompraSurtir, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalNC, Contabilizable:=EsContabilizable) Then If ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, TotalCosto * -1, SerieFolio, 68, SerieFolio, Fecha, IdCtaContableAlmacen, -1, CveCompra:=CveCompraSurtir, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCosto * -1, Contabilizable:=If(CveTipoCompra = 10, False, EsContabilizable)) Then If DifCostoNC <> 0 Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, DifCostoNC * -1, SerieFolio, 69, SerieFolio, Fecha, IdCtaContableClasificacion, -1, CveClasificacion:=CveClasificacionDifCostoNC, CveCompra:=CveCompraSurtir, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=DifCostoNC * -1, CveCuenta:=CveCuentaClasificacion, Contabilizable:=EsContabilizable, CveSubProyecto:=CveSubProyecto) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, DifCostoNC * -1, SerieFolio, 69, SerieFolio, Fecha, IdCtaContableClasificacion, -1, CveClasificacion:=CveClasificacionDifCostoNC, CveCompra:=CveCompraSurtir, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=DifCostoNC * -1, Contabilizable:=EsContabilizable, CveSubProyecto:=CveSubProyecto) Then ErrorMovInv = True End If End If @@ -4040,7 +4039,13 @@ Partial Class Inventarios_RecepcionAlmacen End If End If If CvePrePoliza > 0 Then - Dim IdCtaContableAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {DdlAlmacen.SelectedValue}").ToEntero + Dim dtta As DataTable = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacen.SelectedValue.ToEntero) + Dim IdCtaContableAlmacen As Integer = -1 + Dim CveSubProyecto As Integer = -1 + If dtta IsNot Nothing Then + IdCtaContableAlmacen = dtta.FiltroPrimeroValor("IdCtaContable").ToEntero + CveSubProyecto = dtta.FiltroPrimeroValor("CveSubProyecto").ToEntero + End If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Dim TotalCosto As Decimal = ObjInventario.DtResultados.SUMD("Total").RoundSQL() @@ -4049,7 +4054,7 @@ Partial Class Inventarios_RecepcionAlmacen Dim PorcentajeRecepcionCompras As Decimal = TotalCosto / DtTempCompras.SUMD("SubTotalTC") Dim ConceptoPartida As String = String.Format("{0}- Inv#{1}", HLFolio.Text, InvFolio) - If ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, TotalCosto, InvFolio, 68, InvFolio, FechaMovto, IdCtaContableAlmacen, -1, CveCompra:=CveCompraSurtir, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCosto, Contabilizable:=If(CveTipoCompra = 10, False, True)) Then + If ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, TotalCosto, InvFolio, 68, InvFolio, FechaMovto, IdCtaContableAlmacen, -1, CveCompra:=CveCompraSurtir, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCosto, CveSubProyecto:=CveSubProyecto, Contabilizable:=If(CveTipoCompra = 10, False, True)) Then 'se recorren las facturas a descontar el recepción If DtTempCompras IsNot Nothing AndAlso DtTempCompras.Rows.Count > 0 Then @@ -4073,7 +4078,7 @@ Partial Class Inventarios_RecepcionAlmacen - If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteAbono, ConceptoPartida, CveConceptoCostoIndirecto, ConceptoPartida, FechaMovto, IdCtaContableCostoInd, -1, CveCompra:=CveComp, CveProveedor:=dr("CveProveedor").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=ImporteAbono) Then + If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteAbono, ConceptoPartida, CveConceptoCostoIndirecto, ConceptoPartida, FechaMovto, IdCtaContableCostoInd, -1, CveCompra:=CveComp, CveProveedor:=dr("CveProveedor").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=ImporteAbono, CveSubProyecto:=CveSubProyecto) Then ' si tiene valor es que hay complementaria If ImporteAbonoME > 0 Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteAbono, ConceptoPartida, If(CveImportacionSurtir > 0, 242, 239), ConceptoPartida, FechaMovto, IdCtaContableCostoInd, -1, CveCompra:=CveComp, CveProveedor:=dr("CveProveedor").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=ImporteAbono) Then From 07d161bff3b09387498e296a41b586a1595565a0 Mon Sep 17 00:00:00 2001 From: rrene Date: Fri, 24 Feb 2023 10:51:18 -0700 Subject: [PATCH 16/20] -- cambios en GlobalDT --- AC/CatOGClasificaciones.aspx.vb | 16 ++--- AC/RepPresupuestoEgresos.aspx.vb | 2 +- AC/RepPresupuestoEgresosMensual.aspx.vb | 2 +- App_Code/ClsPaginas.vb | 70 +++++++++---------- Contratos/Estimaciones.aspx.vb | 2 +- Contratos/RepContratos.aspx.vb | 2 +- Contratos/RepContratosDetalle.aspx.vb | 2 +- Flotillas/CatCombustibles.aspx.vb | 16 ++--- ...tProductosServiciosCaracteristicas.aspx.vb | 8 +-- OS/PopUpMateriales.aspx.vb | 6 +- .../CatClasificacionesCaracteristicas.aspx.vb | 30 ++++---- Prospectos/CatProspectosApoyos.aspx.vb | 14 ++-- Prospectos/CatProspectosApoyosTipos.aspx.vb | 14 ++-- Prospectos/RedesCallCenter.aspx.vb | 2 +- Prospectos/RedesEncuestas.aspx.vb | 2 +- .../CatProspectosSolicitudesEstatus.aspx.vb | 11 ++- .../CatProspectosSolicitudesTipos.aspx.vb | 12 ++-- Sistemas/CatSesiones.aspx.vb | 40 +++++------ Ventas/CatClasificacionesDetalle.aspx.vb | 12 ++-- Ventas/CatFamiliaSubFamilia.aspx.vb | 15 ++-- Ventas/CatPS.aspx.vb | 2 +- Ventas/ClientesAbonar.aspx.vb | 6 +- Ventas/PopUpBuscarPs.aspx.vb | 2 +- Ventas/ProductosServicios.aspx.vb | 2 +- 24 files changed, 143 insertions(+), 147 deletions(-) diff --git a/AC/CatOGClasificaciones.aspx.vb b/AC/CatOGClasificaciones.aspx.vb index 02524768e..e41239c25 100644 --- a/AC/CatOGClasificaciones.aspx.vb +++ b/AC/CatOGClasificaciones.aspx.vb @@ -47,10 +47,10 @@ Partial Class AC_CatOGClasificaciones Public Sub CargaDatos() Dim ObjClasificaciones As New ClsClasificaciones - If ObjClasificaciones.GetClasificaciones() Then + If ObjClasificaciones.GetClasificaciones(UsuarioActual.CveEmpresa) Then ViewState("DTOGClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros("Codigo <> '' AND CveEmpresa = " & UsuarioActual.CveEmpresa, "Codigo") - GlobalDTClasificaciones = ObjClasificaciones.DtResultados - GlobalDTACClasificadorObjetoGasto = ObjClasificaciones.DtResultados.FiltraParametros("Codigo <> '' ") + + GlobalDTACClasificadorObjetoGasto(UsuarioActual.CveEmpresa) = Nothing Else Me.GvDatos.DataSource = Nothing End If @@ -74,14 +74,14 @@ Partial Class AC_CatOGClasificaciones Alert("La Clasificacion de Objeto de Gasto se guardó correctamente.", TipoMensaje.MsgInformacion) 'UpTitulos.Update() ViewState("DTOGClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTClasificaciones = ObjClasificaciones.DtResultados + GlobalDTClasificaciones(UsuarioActual.CveEmpresa) = Nothing End If Else If ObjClasificaciones.UpdateClasificacion(TxtOGClasificacion.Text, TxtCodigo.Text, -1, "", -1, "", -1, "", ChkEstatus.Checked, ChkAfectable.Checked, 0, UsuarioActual.CveUsuario, CveClasificacion) Then GvDatos.EditIndex = -1 ViewState("DTOGClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTClasificaciones = ObjClasificaciones.DtResultados + GlobalDTClasificaciones(UsuarioActual.CveEmpresa) = Nothing Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) End If End If @@ -119,7 +119,7 @@ Partial Class AC_CatOGClasificaciones If ObjClasificaciones.RemoveClasificacion(GvRow.DataKey("CveClasificacion").ToEntero) Then GvDatos.EditIndex = -1 ViewState("DTOGClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTClasificaciones = ObjClasificaciones.DtResultados + GlobalDTClasificaciones(UsuarioActual.CveEmpresa) = Nothing Alert("la Clasificacion de Objeto de Gasto se eliminó correctamente.", TipoMensaje.MsgInformacion) End If @@ -159,7 +159,7 @@ Partial Class AC_CatOGClasificaciones If ObjClasificaciones.RemoveClasificacion(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then GvDatos.EditIndex = -1 ViewState("DTOGClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTClasificaciones = ObjClasificaciones.DtResultados + GlobalDTClasificaciones(UsuarioActual.CveEmpresa) = Nothing Alert("la Clasificacion de Objeto de Gasto se eliminó correctamente.", TipoMensaje.MsgInformacion) End If @@ -194,7 +194,7 @@ Partial Class AC_CatOGClasificaciones If ObjOGClasificaciones.UpdateClasificacion(OGClasificacion, Codigo, -1, "", -1, "", -1, "", Estatus, Afectable, 0, UsuarioActual.CveUsuario, CveOGClasificacion) Then GvDatos.EditIndex = -1 ViewState("DTOGClasificaciones") = ObjOGClasificaciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTClasificaciones = ObjOGClasificaciones.DtResultados + GlobalDTClasificaciones(UsuarioActual.CveEmpresa) = Nothing Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) End If diff --git a/AC/RepPresupuestoEgresos.aspx.vb b/AC/RepPresupuestoEgresos.aspx.vb index b4f15938e..152d498b5 100644 --- a/AC/RepPresupuestoEgresos.aspx.vb +++ b/AC/RepPresupuestoEgresos.aspx.vb @@ -115,7 +115,7 @@ Partial Class AC_RepPresupuestoEgresos Private Sub CargaDatos() Dim objAC As New ClsContPAQi(UsuarioActual.Empresa) Dim FechaF As Date = txtFechaF.Text.ToDate - Dim Capitulo As String = If(DdlCapituloClasificaciones.SelectedValue.ToEntero = -1, "-1", GlobalDTACClasificadorObjetoGasto.FiltraParametros(String.Format("CveClasificacion = {0}", DdlCapituloClasificaciones.SelectedValue.ToEntero)).Rows(0)("Codigo").ToString.Substring(0, 1)) + Dim Capitulo As String = If(DdlCapituloClasificaciones.SelectedValue.ToEntero = -1, "-1", GlobalDTACClasificadorObjetoGasto(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveClasificacion = {0}", DdlCapituloClasificaciones.SelectedValue.ToEntero)).Rows(0)("Codigo").ToString.Substring(0, 1)) If objAC.GetRepPresupuestosEgresosSaldos(DdlEjercicio.SelectedValue.ToEntero, FechaF, Capitulo, DdlClasificaciones.SelectedValue.ToEntero, DdlFuenteFinanciamiento.SelectedValue.ToEntero, DdlProgramaOperativo.SelectedValue.ToEntero, DdlUnidadAdministrativa.SelectedValue.ToEntero, DdlTipoGasto.SelectedValue.ToEntero, DdlOrden.SelectedValue.ToEntero) Then DtPresupuestoEgresos = objAC.DtResultados diff --git a/AC/RepPresupuestoEgresosMensual.aspx.vb b/AC/RepPresupuestoEgresosMensual.aspx.vb index 70514d7bd..2aef73b62 100644 --- a/AC/RepPresupuestoEgresosMensual.aspx.vb +++ b/AC/RepPresupuestoEgresosMensual.aspx.vb @@ -75,7 +75,7 @@ Partial Class AC_RepPresupuestoEgresosMensual BtnImprimir.Visible = False Dim objAC As New ClsContPAQi(UsuarioActual.Empresa) - Dim Capitulo As String = If(DdlCapituloClasificaciones.SelectedValue.ToEntero = -1, "-1", GlobalDTACClasificadorObjetoGasto.FiltraParametros(String.Format("CveClasificacion = {0}", DdlCapituloClasificaciones.SelectedValue.ToEntero)).Rows(0)("Codigo").ToString.Substring(0, 1)) + Dim Capitulo As String = If(DdlCapituloClasificaciones.SelectedValue.ToEntero = -1, "-1", GlobalDTACClasificadorObjetoGasto(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveClasificacion = {0}", DdlCapituloClasificaciones.SelectedValue.ToEntero)).Rows(0)("Codigo").ToString.Substring(0, 1)) UPPDatos.Update() Gv.DataBind() diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 079d44f73..1c88a95eb 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -847,7 +847,7 @@ Public Class ClsPaginas End Set End Property #End Region - Public Shared Property GlobalDTClasificaciones(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1, Optional UsoClasificacion As Integer = -1, Optional CveClasificacion As Integer = -1) As DataTable + Public Shared Property GlobalDTClasificaciones(CveEmpresa As Integer, Optional CveCategoria As Integer = -1, Optional UsoClasificacion As Integer = -1, Optional CveClasificacion As Integer = -1) As DataTable Get Dim AppNombre As String = $"GlobalDTClasificaciones-{CveEmpresa}" If HttpContext.Current.Application(AppNombre) Is Nothing Then @@ -888,10 +888,9 @@ Public Class ClsPaginas Application(AppNombre) = value End Set End Property - Public Shared Property GlobalDTClasificaciones2(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1) As DataTable + Public Shared Property GlobalDTClasificaciones2(CveEmpresa As Integer, Optional CveCategoria As Integer = -1) As DataTable Get Dim AppNombre As String = $"GlobalDTClasificaciones2-{CveEmpresa}" - 'sino existe, recarga los datos If HttpContext.Current.Application(AppNombre) Is Nothing Then Dim ObjClasificaciones As New ClsClasificaciones If ObjClasificaciones.GetClasificaciones(CveEmpresa:=CveEmpresa, Tipo:=4) Then HttpContext.Current.Application(AppNombre) = ObjClasificaciones.DtResultados @@ -933,7 +932,7 @@ Public Class ClsPaginas Application(AppNombre) = value End Set End Property - Property GlobalDTACClasificadorObjetoGasto(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1) As DataTable + Property GlobalDTACClasificadorObjetoGasto(CveEmpresa As Integer, Optional CveCategoria As Integer = -1) As DataTable Get Dim AppNombre As String = $"GlobalDTACClasificadorObjetoGasto-{CveEmpresa}" If HttpContext.Current.Application(AppNombre) Is Nothing Then @@ -956,7 +955,7 @@ Public Class ClsPaginas Application(AppNombre) = value End Set End Property - Property GlobalDTClasificacionesDetalle(Optional CveEmpresa As Integer = -1, Optional CveClasificacion As Integer = -1) As DataTable + Property GlobalDTClasificacionesDetalle(CveEmpresa As Integer, Optional CveClasificacion As Integer = -1) As DataTable Get Dim AppNombre As String = $"GlobalDTClasificacionesDetalle-{CveEmpresa}" If Application(AppNombre) Is Nothing Then @@ -998,10 +997,9 @@ Public Class ClsPaginas HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTFamilias(Optional CveEmpresa As Integer = -1) As DataTable + Property GlobalDTFamilias(CveEmpresa As Integer) As DataTable Get Dim AppNombre As String = $"GlobalDTFamilias-{CveEmpresa}" - 'sino existe, recarga los datos If Application(AppNombre) Is Nothing Then Dim ObjGenerales As New ClsGenerales If ObjGenerales.GetCategorias(CveEmpresa, 2) Then Application(AppNombre) = ObjGenerales.DtResultados @@ -1014,7 +1012,7 @@ Public Class ClsPaginas Application(AppNombre) = value End Set End Property - Property GlobalDTCategoriasPresupuestos(Optional CveEmpresa As Integer = -1) As DataTable + Property GlobalDTCategoriasPresupuestos(CveEmpresa As Integer) As DataTable Get Dim AppNombre As String = $"GlobalDTCategoriasPresupuestos-{CveEmpresa}" If Application(AppNombre) Is Nothing Then @@ -1661,20 +1659,20 @@ Public Class ClsPaginas HttpContext.Current.Application(AppNombre) = value End Set End Property - 'Property GlobalDTProductosServiciosCaracteristicas(CveEmpresa As Integer) As DataTable - ' Get - ' If CveEmpresa <> -1 Then - ' Dim Dv As New DataView(DirectCast(Application("GlobalDTProductosServiciosCaracteristicas"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - ' GlobalDTProductosServiciosCaracteristicas = Dv.ToTable - ' Dv.Dispose() - ' Else - ' GlobalDTProductosServiciosCaracteristicas = DirectCast(Application("GlobalDTProductosServiciosCaracteristicas"), DataTable) - ' End If - ' End Get - ' Set(value As DataTable) - ' Application("GlobalDTProductosServiciosCaracteristicas") = value - ' End Set - 'End Property + Property GlobalDTProductosServiciosCaracteristicas(CveEmpresa As Integer) As DataTable + Get + If CveEmpresa <> -1 Then + Dim Dv As New DataView(DirectCast(Application("GlobalDTProductosServiciosCaracteristicas"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) + GlobalDTProductosServiciosCaracteristicas = Dv.ToTable + Dv.Dispose() + Else + GlobalDTProductosServiciosCaracteristicas = DirectCast(Application("GlobalDTProductosServiciosCaracteristicas"), DataTable) + End If + End Get + Set(value As DataTable) + Application("GlobalDTProductosServiciosCaracteristicas") = value + End Set + End Property Property GlobalDTPSAdicionales(CvePS As Integer, CveEmpresa As Integer) As DataTable Get Dim AppNombre As String = $"GlobalDTPSAdicionales-{CveEmpresa}" @@ -1697,20 +1695,20 @@ Public Class ClsPaginas Application(AppNombre) = value End Set End Property - 'Property GlobalDTProductosServiciosCaracteristicasOpciones(CveEmpresa As Integer) As DataTable - ' Get - ' If CveEmpresa <> -1 Then - ' Dim Dv As New DataView(DirectCast(Application("GlobalDTProductosServiciosCaracteristicasOpciones"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - ' GlobalDTProductosServiciosCaracteristicasOpciones = Dv.ToTable - ' Dv.Dispose() - ' Else - ' GlobalDTProductosServiciosCaracteristicasOpciones = DirectCast(Application("GlobalDTProductosServiciosCaracteristicasOpciones"), DataTable) - ' End If - ' End Get - ' Set(value As DataTable) - ' Application("GlobalDTProductosServiciosCaracteristicasOpciones") = value - ' End Set - 'End Property + Property GlobalDTProductosServiciosCaracteristicasOpciones(CveEmpresa As Integer) As DataTable + Get + If CveEmpresa <> -1 Then + Dim Dv As New DataView(DirectCast(Application("GlobalDTProductosServiciosCaracteristicasOpciones"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) + GlobalDTProductosServiciosCaracteristicasOpciones = Dv.ToTable + Dv.Dispose() + Else + GlobalDTProductosServiciosCaracteristicasOpciones = DirectCast(Application("GlobalDTProductosServiciosCaracteristicasOpciones"), DataTable) + End If + End Get + Set(value As DataTable) + Application("GlobalDTProductosServiciosCaracteristicasOpciones") = value + End Set + End Property Property GlobalDTInvMetodosInventario() As DataTable Get Dim AppNombre As String = $"GlobalDTInvMetodosInventario" diff --git a/Contratos/Estimaciones.aspx.vb b/Contratos/Estimaciones.aspx.vb index afd08771d..a4804defb 100644 --- a/Contratos/Estimaciones.aspx.vb +++ b/Contratos/Estimaciones.aspx.vb @@ -59,7 +59,7 @@ Partial Class Contratos_Estimaciones DdlContrato.Items.Insert(0, New System.Web.UI.WebControls.ListItem("Todos", "-1")) End Sub Private Sub CargaClasificacion() - DdlClasificacion.DataSource = GlobalDTClasificaciones.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) + DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) DdlClasificacion.DataBind() DdlClasificacion.Items.Insert(0, New System.Web.UI.WebControls.ListItem("Todas", "-1")) End Sub diff --git a/Contratos/RepContratos.aspx.vb b/Contratos/RepContratos.aspx.vb index 862ba07a6..f4ea8b85f 100644 --- a/Contratos/RepContratos.aspx.vb +++ b/Contratos/RepContratos.aspx.vb @@ -60,7 +60,7 @@ Partial Class RepContratos DdlContrato.Items.Insert(0, New System.Web.UI.WebControls.ListItem("Todos", "-1")) End Sub Private Sub CargaClasificacion() - DdlClasificacion.DataSource = GlobalDTClasificaciones.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) + DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) DdlClasificacion.DataBind() DdlClasificacion.Items.Insert(0, New System.Web.UI.WebControls.ListItem("Todas", "-1")) End Sub diff --git a/Contratos/RepContratosDetalle.aspx.vb b/Contratos/RepContratosDetalle.aspx.vb index 95da1ce79..5d2bafd75 100644 --- a/Contratos/RepContratosDetalle.aspx.vb +++ b/Contratos/RepContratosDetalle.aspx.vb @@ -60,7 +60,7 @@ Partial Class RepContratos DdlContrato.Items.Insert(0, New System.Web.UI.WebControls.ListItem("Todos", "-1")) End Sub Private Sub CargaClasificacion() - DdlClasificacion.DataSource = GlobalDTClasificaciones.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) + DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) DdlClasificacion.DataBind() DdlClasificacion.Items.Insert(0, New System.Web.UI.WebControls.ListItem("Todas", "-1")) End Sub diff --git a/Flotillas/CatCombustibles.aspx.vb b/Flotillas/CatCombustibles.aspx.vb index 03c6e5879..c79e181a3 100644 --- a/Flotillas/CatCombustibles.aspx.vb +++ b/Flotillas/CatCombustibles.aspx.vb @@ -33,14 +33,14 @@ Partial Class Maq_CatCombustibles If ObjFlotilla.GetCombustiblesTipos(UsuarioActual.CveEmpresa) Then ViewState("DTCombustibleTipo") = ObjFlotilla.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTCombustiblesTipos = ObjFlotilla.DtResultados + GlobalDTCombustiblesTipos(UsuarioActual.CveEmpresa) = Nothing Else Me.GvDatosCombustiblesTipos.DataSource = Nothing End If - If ObjFlotilla.GetCombustibles() Then + If ObjFlotilla.GetCombustibles(UsuarioActual.CveEmpresa) Then ViewState("DTCombustible") = ObjFlotilla.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTCombustiblesTipos = ObjFlotilla.DtResultados + GlobalDTCombustiblesTipos(UsuarioActual.CveEmpresa) = Nothing Else Me.GvDatosCombustibles.DataSource = Nothing End If @@ -75,7 +75,7 @@ Partial Class Maq_CatCombustibles Alert("El nuevo Combustible se guardó correctamente.", TipoMensaje.MsgInformacion) UpTitulosCombustibles.Update() ViewState("DTCombustible") = ObjFlotilla.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTCombustibles(-1) = ObjFlotilla.DtResultados + GlobalDTCombustibles(UsuarioActual.CveEmpresa) = Nothing If ViewState("Orden").ToString() <> String.Empty Then CargaGrid(ViewState("Orden").ToString(), 0) @@ -126,7 +126,7 @@ Partial Class Maq_CatCombustibles If ObjFlotilla.RemoveCombustibles(GvDatosCombustibles.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then GvDatosCombustibles.EditIndex = -1 ViewState("DTCombustible") = ObjFlotilla.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTCombustiblesTipos = ObjFlotilla.DtResultados + GlobalDTCombustibles(UsuarioActual.CveEmpresa) = Nothing Alert("El Combustible se eliminó correctamente.", TipoMensaje.MsgInformacion) End If @@ -189,7 +189,7 @@ Partial Class Maq_CatCombustibles Alert("El nuevo Tipo de Combustible se guardó correctamente.", TipoMensaje.MsgInformacion) UpTitulosCombustiblesTipos.Update() ViewState("DTCombustibleTipo") = ObjFlotilla.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTCombustibles(-1) = ObjFlotilla.DtResultados + GlobalDTCombustibles(UsuarioActual.CveEmpresa) = Nothing If ViewState("Orden").ToString() <> String.Empty Then CargaGrid(ViewState("Orden").ToString(), 1) @@ -221,7 +221,7 @@ Partial Class Maq_CatCombustibles If ObjFlotilla.RemoveCombustiblesTipos(GvDatosCombustiblesTipos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then GvDatosCombustiblesTipos.EditIndex = -1 ViewState("DTCombustibleTipo") = ObjFlotilla.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTCombustiblesTipos = ObjFlotilla.DtResultados + GlobalDTCombustibles(UsuarioActual.CveEmpresa) = Nothing Alert("El Tipo de Combustible se eliminó correctamente.", TipoMensaje.MsgInformacion) End If @@ -255,7 +255,7 @@ Partial Class Maq_CatCombustibles If ObjFlotilla.UpdateCombustiblesTipos(CombustibleTipo, EstatusCombustibleTipo, CveCombustibleTipo) Then GvDatosCombustiblesTipos.EditIndex = -1 ViewState("DTCombustibleTipo") = ObjFlotilla.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTCombustiblesTipos = ObjFlotilla.DtResultados + GlobalDTCombustibles(UsuarioActual.CveEmpresa) = Nothing Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) End If diff --git a/General/CatProductosServiciosCaracteristicas.aspx.vb b/General/CatProductosServiciosCaracteristicas.aspx.vb index d0e6ccfec..df4c3adfd 100644 --- a/General/CatProductosServiciosCaracteristicas.aspx.vb +++ b/General/CatProductosServiciosCaracteristicas.aspx.vb @@ -40,9 +40,9 @@ Partial Class GRAL_CatCaracteristicasProductosServicios Public Sub CargaDatos() Dim ObjCaracteristicas As New ClsGralProductosServiciosCaracteristicas - If ObjCaracteristicas.GetProductosServiciosCaracteristicas() Then + If ObjCaracteristicas.GetProductosServiciosCaracteristicas(UsuarioActual.CveEmpresa) Then ViewState("DTProductosServiciosCaracteristicas") = ObjCaracteristicas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTProductosServiciosCaracteristicas(UsuarioActual.CveEmpresa) = ObjCaracteristicas.DtResultados + 'GlobalDTProductosServiciosCaracteristicas(UsuarioActual.CveEmpresa) = ObjCaracteristicas.DtResultados Else Me.GvDatosCaracteristicas.DataSource = Nothing End If @@ -56,9 +56,9 @@ Partial Class GRAL_CatCaracteristicasProductosServicios Public Sub CargaDatosO() Dim ObjOpciones As New ClsGralProductosServiciosCaracteristicas - If ObjOpciones.GetProductosServiciosCaracteristicasOpciones() Then + If ObjOpciones.GetProductosServiciosCaracteristicasOpciones(UsuarioActual.CveEmpresa) Then ViewState("DTProductosServiciosCaracteristicasOpciones") = ObjOpciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTProductosServiciosCaracteristicasOpciones(UsuarioActual.CveEmpresa) = ObjOpciones.DtResultados + 'GlobalDTProductosServiciosCaracteristicasOpciones(UsuarioActual.CveEmpresa) = ObjOpciones.DtResultados Else GvDatosOpciones.DataSource = Nothing End If diff --git a/OS/PopUpMateriales.aspx.vb b/OS/PopUpMateriales.aspx.vb index 1dadf3c2e..c2ea18ead 100644 --- a/OS/PopUpMateriales.aspx.vb +++ b/OS/PopUpMateriales.aspx.vb @@ -96,7 +96,7 @@ Partial Class OS_PopUpMateriales End Sub Private Sub CargaClasificaciones() - DdlClasificacion.DataSource = GlobalDTClasificaciones.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) + DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) DdlClasificacion.DataBind() End Sub @@ -129,7 +129,7 @@ Partial Class OS_PopUpMateriales Dim CveUnidadMedida As Integer = RowPS("CveUnidadMedida").ToString.ToEntero Dim UM = GlobalDTUnidadesMedida.FiltraParametros("CveUnidadMedida = " & CveUnidadMedida).Rows(0)("UnidadMedida").ToString Dim CveClasificacion As Integer = RowPS("CveClasificacion").ToString.ToEntero - Dim Clasificacion As String = GlobalDTClasificaciones.FiltraParametros("CveClasificacion = " & CveClasificacion).Rows(0)("Clasificacion").ToString + Dim Clasificacion As String = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros("CveClasificacion = " & CveClasificacion).Rows(0)("Clasificacion").ToString AddPS(Material("CveMaterialUtilizado").ToString.ToEntero, CveOSDetalle, Material("Cantidad").ToString.ToDecimal, CveUnidadMedida, UM, Material("CvePS").ToString.ToEntero, PS, CveClasificacion, Clasificacion, Material("SeFacturara").ToString) Next @@ -176,7 +176,7 @@ Partial Class OS_PopUpMateriales e.Row.FCDropDownList("DdlPS").DataBind() e.Row.FCDropDownList("DdlPS").SelectedValue = e.Row.DBCampo("CvePS") - e.Row.FCDropDownList("DdlClasificacion").DataSource = GlobalDTClasificaciones.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) + e.Row.FCDropDownList("DdlClasificacion").DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) e.Row.FCDropDownList("DdlClasificacion").DataBind() e.Row.FCDropDownList("DdlClasificacion").SelectedValue = e.Row.DBCampo("CveClasificacion") End If diff --git a/Prospectos/CatClasificacionesCaracteristicas.aspx.vb b/Prospectos/CatClasificacionesCaracteristicas.aspx.vb index a6d181150..8adb866b3 100644 --- a/Prospectos/CatClasificacionesCaracteristicas.aspx.vb +++ b/Prospectos/CatClasificacionesCaracteristicas.aspx.vb @@ -56,7 +56,7 @@ Partial Class Prospectos_CatClasificacionesCaracteristicas If (ViewState("DTClasificacionesCaracteristicas") Is Nothing) Then ViewState("DTClasificacionesCaracteristicas") = ObjClasificaciones.DtResultados End If - GlobalDTProspectosCaracteristicasClasificaciones = ObjClasificaciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) + GlobalDTProspectosCaracteristicasClasificaciones(UsuarioActual.CveEmpresa) = Nothing Else Me.GvDatosCl.DataSource = Nothing End If @@ -77,7 +77,7 @@ Partial Class Prospectos_CatClasificacionesCaracteristicas Alert("La nueva Clasificación de Tipo de Característica se guardó correctamente.", TipoMensaje.MsgInformacion) 'UpTitulos.Update() ViewState("DTClasificacionesCaracteristicas") = ObjClasificaciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTProspectosCaracteristicasClasificaciones = ObjClasificaciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) + GlobalDTProspectosCaracteristicasClasificaciones(UsuarioActual.CveEmpresa) = Nothing CambioClasificacionesCaracteristicas() End If @@ -186,7 +186,7 @@ Partial Class Prospectos_CatClasificacionesCaracteristicas e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then - e.Row.FCDropDownList("DdlCaracteristicaClasificacionEdit").DataSource = GlobalDTProspectosCaracteristicasClasificaciones.FiltraParametros("Estatus = 'Activo' AND CveEmpresa = " & UsuarioActual.CveEmpresa) + e.Row.FCDropDownList("DdlCaracteristicaClasificacionEdit").DataSource = GlobalDTProspectosCaracteristicasClasificaciones(UsuarioActual.CveEmpresa) e.Row.FCDropDownList("DdlCaracteristicaClasificacionEdit").DataBind() e.Row.FCDropDownList("DdlCaracteristicaClasificacionEdit").SelectedValue = e.Row.DBCampo("CveCaracteristicaClasificacion") End If @@ -199,11 +199,11 @@ Partial Class Prospectos_CatClasificacionesCaracteristicas End Sub Private Sub CargaClasificaciones() DdlCaracteristicaClasificacion.Items.Clear() - DdlCaracteristicaClasificacion.DataSource = GlobalDTProspectosCaracteristicasClasificaciones.FiltraParametros("Estatus = 'Activo' AND CveEmpresa = " & UsuarioActual.CveEmpresa) + DdlCaracteristicaClasificacion.DataSource = GlobalDTProspectosCaracteristicasClasificaciones(UsuarioActual.CveEmpresa) DdlCaracteristicaClasificacion.DataBind() DdlCaracteristicaClasificacionC.Items.Clear() - DdlCaracteristicaClasificacionC.DataSource = GlobalDTProspectosCaracteristicasClasificaciones.FiltraParametros("Estatus = 'Activo' AND CveEmpresa = " & UsuarioActual.CveEmpresa) + DdlCaracteristicaClasificacionC.DataSource = GlobalDTProspectosCaracteristicasClasificaciones(UsuarioActual.CveEmpresa) DdlCaracteristicaClasificacionC.DataBind() End Sub Protected Sub BtnDuplicarCaracteristicaTipo_Click(sender As Object, e As EventArgs) Handles BtnDuplicarCaracteristicaTipo.Click @@ -219,7 +219,7 @@ Partial Class Prospectos_CatClasificacionesCaracteristicas Alert("El nuevo Tipo de Característica se guardó correctamente.", TipoMensaje.MsgInformacion) 'UpTitulos.Update() ViewState("DTTiposCaracteristicas") = ObjCaracteristicaTipo.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTProspectosTiposCaracteristicas = ObjCaracteristicaTipo.DtResultados + GlobalDTProspectosTiposCaracteristicas(UsuarioActual.CveEmpresa) = Nothing CambioCaracteristicaTipo() End If @@ -292,11 +292,11 @@ Partial Class Prospectos_CatClasificacionesCaracteristicas Private Sub CargaTiposCaracteristicas() DdlCaracteristicaTipo.Items.Clear() - DdlCaracteristicaTipo.DataSource = GlobalDTProspectosTiposCaracteristicas.FiltraParametros("Estatus = 'Activo' AND CveEmpresa = " & UsuarioActual.CveEmpresa) + DdlCaracteristicaTipo.DataSource = GlobalDTProspectosCaracteristicasClasificaciones(UsuarioActual.CveEmpresa) DdlCaracteristicaTipo.DataBind() DdlCaracteristicaTipoO.Items.Clear() - DdlCaracteristicaTipoO.DataSource = GlobalDTProspectosTiposCaracteristicas.FiltraParametros("Estatus = 'Activo' AND CveEmpresa = " & UsuarioActual.CveEmpresa) + DdlCaracteristicaTipoO.DataSource = GlobalDTProspectosCaracteristicasClasificaciones(UsuarioActual.CveEmpresa) DdlCaracteristicaTipoO.DataBind() End Sub Protected Sub GvDatosCaracteristicas_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatosCaracteristicas.RowDataBound @@ -316,7 +316,7 @@ Partial Class Prospectos_CatClasificacionesCaracteristicas e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then - e.Row.FCDropDownList("DdlCaracteristicaTipoEdit").DataSource = GlobalDTProspectosTiposCaracteristicas.FiltraParametros("Estatus = 'Activo' AND CveEmpresa = " & UsuarioActual.CveEmpresa) + e.Row.FCDropDownList("DdlCaracteristicaTipoEdit").DataSource = GlobalDTProspectosCaracteristicasClasificaciones(UsuarioActual.CveEmpresa) e.Row.FCDropDownList("DdlCaracteristicaTipoEdit").DataBind() e.Row.FCDropDownList("DdlCaracteristicaTipoEdit").SelectedValue = e.Row.DBCampo("CveCaracteristicaTipo") @@ -382,7 +382,7 @@ Partial Class Prospectos_CatClasificacionesCaracteristicas If (ViewState("DTTiposCaracteristicas") Is Nothing) Then ViewState("DTTiposCaracteristicas") = ObjCaracteristicaTipo.DtResultados End If - GlobalDTProspectosTiposCaracteristicas = ObjCaracteristicaTipo.DtResultados.FiltraParametros("Estatus = 'Activo' AND CveEmpresa = " & UsuarioActual.CveEmpresa) + GlobalDTProspectosCaracteristicasClasificaciones(UsuarioActual.CveEmpresa) = Nothing Else Me.GvDatos.DataSource = Nothing End If @@ -415,7 +415,7 @@ Partial Class Prospectos_CatClasificacionesCaracteristicas Alert("El nuevo Tipo de Característica se guardó correctamente.", TipoMensaje.MsgInformacion) 'UpTitulos.Update() ViewState("DTTiposCaracteristicas") = ObjTiposCaracteristicas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTProspectosTiposCaracteristicas = ObjTiposCaracteristicas.DtResultados.FiltraParametros("Estatus = 'Activo' AND CveEmpresa = " & UsuarioActual.CveEmpresa) + GlobalDTProspectosCaracteristicasClasificaciones(UsuarioActual.CveEmpresa) = Nothing CambioCaracteristicaTipo() End If @@ -564,7 +564,7 @@ Partial Class Prospectos_CatClasificacionesCaracteristicas If ObjClasificaciones.RemoveClasificacionesCaracteristicas(GvDatosCl.DataKeys(e.RowIndex).Value.ToString.ToEntero, UsuarioActual.CveEmpresa) Then GvDatosCl.EditIndex = -1 ViewState("DTClasificacionesCaracteristicas") = ObjClasificaciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTProspectosCaracteristicasClasificaciones = ObjClasificaciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) + GlobalDTProspectosCaracteristicasClasificaciones(UsuarioActual.CveEmpresa) = Nothing Alert("La Clasificacion de Tipo de Caracteristica se eliminó correctamente.", TipoMensaje.MsgInformacion) CambioClasificacionesCaracteristicas() @@ -578,7 +578,7 @@ Partial Class Prospectos_CatClasificacionesCaracteristicas If ObjTiposCaracteristicas.RemoveTiposCaracteristicas(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero, UsuarioActual.CveEmpresa) Then GvDatos.EditIndex = -1 ViewState("DTTiposCaracteristicas") = ObjTiposCaracteristicas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTProspectosTiposCaracteristicas = ObjTiposCaracteristicas.DtResultados.FiltraParametros("Estatus = 'Activo' AND CveEmpresa = " & UsuarioActual.CveEmpresa) + GlobalDTProspectosTiposCaracteristicas(UsuarioActual.CveEmpresa) = Nothing Alert("El Tipo de Característica se eliminó correctamente.", TipoMensaje.MsgInformacion) CambioCaracteristicaTipo() @@ -661,7 +661,7 @@ Partial Class Prospectos_CatClasificacionesCaracteristicas If ObjClasificaciones.UpdateClasificacionesCaracteristicas(CaracteristicaClasificacion, Orden, Estatus, UsuarioActual.CveEmpresa, CveCaracteristicaClasificacion) Then GvDatosCl.EditIndex = -1 ViewState("DTClasificacionesCaracteristicas") = ObjClasificaciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTProspectosCaracteristicasClasificaciones = ObjClasificaciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) + GlobalDTProspectosCaracteristicasClasificaciones(UsuarioActual.CveEmpresa) = Nothing Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) CambioClasificacionesCaracteristicas() @@ -681,7 +681,7 @@ Partial Class Prospectos_CatClasificacionesCaracteristicas If ObjTiposCaracteristicas.UpdateTiposCaracteristicas(CaracteristicaTipo, CveCaracteristicaClasificacion, Orden, Estatus, UsuarioActual.CveEmpresa, CveCaracteristicaTipo) Then GvDatos.EditIndex = -1 ViewState("DTTiposCaracteristicas") = ObjTiposCaracteristicas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTProspectosTiposCaracteristicas = ObjTiposCaracteristicas.DtResultados.FiltraParametros("Estatus = 'Activo' AND CveEmpresa = " & UsuarioActual.CveEmpresa) + GlobalDTProspectosTiposCaracteristicas(UsuarioActual.CveEmpresa) = Nothing Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) CambioCaracteristicaTipo() diff --git a/Prospectos/CatProspectosApoyos.aspx.vb b/Prospectos/CatProspectosApoyos.aspx.vb index 4c4b8db6f..6639678e5 100644 --- a/Prospectos/CatProspectosApoyos.aspx.vb +++ b/Prospectos/CatProspectosApoyos.aspx.vb @@ -18,9 +18,9 @@ Partial Class Prospectos_CatProspectosApoyos Public Sub CargaDatos() Dim ObjProspectosApoyos As New ClsProspectos - If ObjProspectosApoyos.GetProspectoApoyo() Then - ViewState("DTProspectosApoyos") = ObjProspectosApoyos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTProspectosApoyos(UsuarioActual.CveEmpresa) = ObjProspectosApoyos.DtResultados + If ObjProspectosApoyos.GetProspectoApoyo(UsuarioActual.CveEmpresa) Then + ViewState("DTProspectosApoyos") = ObjProspectosApoyos.DtResultados + GlobalDTProspectosApoyos(UsuarioActual.CveEmpresa) = Nothing Else Me.GvDatos.DataSource = Nothing End If @@ -40,8 +40,8 @@ Partial Class Prospectos_CatProspectosApoyos TxtProspectoApoyo.Text = "" Alert("El nuevo Apoyo se guardó correctamente.", TipoMensaje.MsgInformacion) UpTitulos.Update() - ViewState("DTProspectosApoyos") = ObjProspectosApoyos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTProspectosApoyos(UsuarioActual.CveEmpresa) = ObjProspectosApoyos.DtResultados + ViewState("DTProspectosApoyos") = ObjProspectosApoyos.DtResultados + GlobalDTProspectosApoyos(UsuarioActual.CveEmpresa) = Nothing If ViewState("Orden").ToString() <> String.Empty Then CargaGrid(ViewState("Orden").ToString()) @@ -72,7 +72,7 @@ Partial Class Prospectos_CatProspectosApoyos If ObjProspectosApoyos.RemoveProspectoApoyo(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then GvDatos.EditIndex = -1 ViewState("DTProspectosApoyos") = ObjProspectosApoyos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTProspectosApoyos(UsuarioActual.CveEmpresa) = ObjProspectosApoyos.DtResultados + GlobalDTProspectosApoyos(UsuarioActual.CveEmpresa) = Nothing Alert("El Apoyo se eliminó correctamente.", TipoMensaje.MsgInformacion) End If @@ -103,7 +103,7 @@ Partial Class Prospectos_CatProspectosApoyos If ObjProspectosApoyos.UpdateProspectoApoyo(ProspectoApoyo, Estatus, CveProspectoApoyo) Then GvDatos.EditIndex = -1 ViewState("DTProspectosApoyos") = ObjProspectosApoyos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTProspectosApoyos(UsuarioActual.CveEmpresa) = ObjProspectosApoyos.DtResultados + GlobalDTProspectosApoyos(UsuarioActual.CveEmpresa) = Nothing Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) End If diff --git a/Prospectos/CatProspectosApoyosTipos.aspx.vb b/Prospectos/CatProspectosApoyosTipos.aspx.vb index 0c6ff5279..70ab05df9 100644 --- a/Prospectos/CatProspectosApoyosTipos.aspx.vb +++ b/Prospectos/CatProspectosApoyosTipos.aspx.vb @@ -18,9 +18,9 @@ Partial Class Prospectos_CatProspectosApoyosTipos Public Sub CargaDatos() Dim ObjApoyoTipo As New ClsProspectos - If ObjApoyoTipo.GetApoyoTipo() Then - ViewState("DTApoyoTipo") = ObjApoyoTipo.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTProspectosApoyosTipos(UsuarioActual.CveEmpresa) = ObjApoyoTipo.DtResultados + If ObjApoyoTipo.GetApoyoTipo(UsuarioActual.CveEmpresa) Then + ViewState("DTApoyoTipo") = ObjApoyoTipo.DtResultados + GlobalDTProspectosApoyosTipos(UsuarioActual.CveEmpresa) = Nothing Else Me.GvDatos.DataSource = Nothing End If @@ -40,8 +40,8 @@ Partial Class Prospectos_CatProspectosApoyosTipos TxtApoyoTipo.Text = "" Alert("El nuevo Tipo de Apoyo se guardó correctamente.", TipoMensaje.MsgInformacion) UpTitulos.Update() - ViewState("DTApoyoTipo") = ObjApoyoTipo.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTProspectosApoyosTipos(UsuarioActual.CveEmpresa) = ObjApoyoTipo.DtResultados + ViewState("DTApoyoTipo") = ObjApoyoTipo.DtResultados + GlobalDTProspectosApoyosTipos(UsuarioActual.CveEmpresa) = Nothing If ViewState("Orden").ToString() <> String.Empty Then CargaGrid(ViewState("Orden").ToString()) @@ -72,7 +72,7 @@ Partial Class Prospectos_CatProspectosApoyosTipos If ObjApoyoTipo.RemoveApoyoTipo(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then GvDatos.EditIndex = -1 ViewState("DTApoyoTipo") = ObjApoyoTipo.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTProspectosApoyosTipos(UsuarioActual.CveEmpresa) = ObjApoyoTipo.DtResultados + GlobalDTProspectosApoyosTipos(UsuarioActual.CveEmpresa) = Nothing Alert("El Tipo de Apoyo se eliminó correctamente.", TipoMensaje.MsgInformacion) End If @@ -102,7 +102,7 @@ Partial Class Prospectos_CatProspectosApoyosTipos If ObjApoyoTipo.UpdateApoyoTipo(ApoyoTipo, Estatus, CveApoyoTipo) Then GvDatos.EditIndex = -1 ViewState("DTApoyoTipo") = ObjApoyoTipo.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTProspectosApoyosTipos(UsuarioActual.CveEmpresa) = ObjApoyoTipo.DtResultados + GlobalDTProspectosApoyosTipos(UsuarioActual.CveEmpresa) = Nothing Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) End If diff --git a/Prospectos/RedesCallCenter.aspx.vb b/Prospectos/RedesCallCenter.aspx.vb index da8742f7f..8234b79d8 100644 --- a/Prospectos/RedesCallCenter.aspx.vb +++ b/Prospectos/RedesCallCenter.aspx.vb @@ -97,7 +97,7 @@ Partial Class Prospectos_RedesCallCenter GvPreguntas.DataSource = ObjProsEncuestas.DtResultados DTProspectosPreguntas = ObjProsEncuestas.DtResultados - If ObjProsEncuestas.GetRespuestas(-1, CveEncuesta) Then + If ObjProsEncuestas.GetRespuestas(-1, CveEncuesta, UsuarioActual.CveEmpresa) Then DTProspectosRespuestas = ObjProsEncuestas.DtResultados End If diff --git a/Prospectos/RedesEncuestas.aspx.vb b/Prospectos/RedesEncuestas.aspx.vb index b0e2ade0c..0d90d6dc3 100644 --- a/Prospectos/RedesEncuestas.aspx.vb +++ b/Prospectos/RedesEncuestas.aspx.vb @@ -463,7 +463,7 @@ Partial Class Prospectos_RedesEncuestas GvPreguntas.DataSource = ObjProsEncuestas.DtResultados DTProspectosPreguntas = ObjProsEncuestas.DtResultados - If ObjProsEncuestas.GetRespuestas(-1, CveEncuesta) Then + If ObjProsEncuestas.GetRespuestas(-1, CveEncuesta, UsuarioActual.CveEmpresa) Then DTProspectosRespuestas = ObjProsEncuestas.DtResultados End If diff --git a/Prospectos/Solicitudes/CatProspectosSolicitudesEstatus.aspx.vb b/Prospectos/Solicitudes/CatProspectosSolicitudesEstatus.aspx.vb index 4e497a722..4035126bb 100644 --- a/Prospectos/Solicitudes/CatProspectosSolicitudesEstatus.aspx.vb +++ b/Prospectos/Solicitudes/CatProspectosSolicitudesEstatus.aspx.vb @@ -22,9 +22,8 @@ Partial Class Prospectos_Solicitudes_CatProspectosSolicitudesEstatus Public Sub CargaDatos() Dim ObjProspectosEstatus As New ClsProspectos - If ObjProspectosEstatus.GetSolicitudEstatus() Then - ViewState("DTProspectosEstatus") = ObjProspectosEstatus.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTProspectosSolicitudesEstatus(UsuarioActual.CveEmpresa) = ObjProspectosEstatus.DtResultados + If ObjProspectosEstatus.GetSolicitudEstatus(UsuarioActual.CveEmpresa) Then + ViewState("DTProspectosEstatus") = ObjProspectosEstatus.DtResultados Else Me.GvDatos.DataSource = Nothing End If @@ -45,7 +44,7 @@ Partial Class Prospectos_Solicitudes_CatProspectosSolicitudesEstatus Alert("El nuevo Estatus se guardó correctamente.", TipoMensaje.MsgInformacion) UpTitulos.Update() ViewState("DTProspectosEstatus") = ObjProspectosEstatus.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTProspectosSolicitudesEstatus(UsuarioActual.CveEmpresa) = ObjProspectosEstatus.DtResultados + GlobalDTProspectosSolicitudesEstatus(UsuarioActual.CveEmpresa) = Nothing If ViewState("Orden").ToString() <> String.Empty Then CargaGrid(ViewState("Orden").ToString()) @@ -126,7 +125,7 @@ Partial Class Prospectos_Solicitudes_CatProspectosSolicitudesEstatus If ObjProspectosEstatus.RemoveSolicitudEstatus(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then GvDatos.EditIndex = -1 ViewState("DTProspectosEstatus") = ObjProspectosEstatus.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTProspectosSolicitudesEstatus(UsuarioActual.CveEmpresa) = ObjProspectosEstatus.DtResultados + GlobalDTProspectosSolicitudesEstatus(UsuarioActual.CveEmpresa) = Nothing Alert("El Estatus se eliminó correctamente.", TipoMensaje.MsgInformacion) End If @@ -159,7 +158,7 @@ Partial Class Prospectos_Solicitudes_CatProspectosSolicitudesEstatus If ObjProspectosEstatus.UpdateSolicitudEstatus(SolicitudEstatus, Estatus, CveSolicitudEstatus) Then GvDatos.EditIndex = -1 ViewState("DTProspectosEstatus") = ObjProspectosEstatus.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTProspectosSolicitudesEstatus(UsuarioActual.CveEmpresa) = ObjProspectosEstatus.DtResultados + GlobalDTProspectosSolicitudesEstatus(UsuarioActual.CveEmpresa) = Nothing Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) End If diff --git a/Prospectos/Solicitudes/CatProspectosSolicitudesTipos.aspx.vb b/Prospectos/Solicitudes/CatProspectosSolicitudesTipos.aspx.vb index 7c75a1edc..1d714497b 100644 --- a/Prospectos/Solicitudes/CatProspectosSolicitudesTipos.aspx.vb +++ b/Prospectos/Solicitudes/CatProspectosSolicitudesTipos.aspx.vb @@ -22,9 +22,9 @@ Partial Class Prospectos_Solicitudes_CatProspectosSolicitudesTipos Public Sub CargaDatos() Dim ObjSolicitudTipo As New ClsProspectos - If ObjSolicitudTipo.GetSolicitudTipo() Then - ViewState("DTSolicitudTipo") = ObjSolicitudTipo.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTProspectosSolicitudesTipos(UsuarioActual.CveEmpresa) = ObjSolicitudTipo.DtResultados + If ObjSolicitudTipo.GetSolicitudTipo(UsuarioActual.CveEmpresa) Then + ViewState("DTSolicitudTipo") = ObjSolicitudTipo.DtResultados + GlobalDTProspectosSolicitudesTipos(UsuarioActual.CveEmpresa) = Nothing Else Me.GvDatos.DataSource = Nothing End If @@ -45,7 +45,7 @@ Partial Class Prospectos_Solicitudes_CatProspectosSolicitudesTipos Alert("El nuevo Tipo de Solicitud se guardó correctamente.", TipoMensaje.MsgInformacion) UpTitulos.Update() ViewState("DTSolicitudTipo") = ObjSolicitudTipo.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTProspectosSolicitudesTipos(UsuarioActual.CveEmpresa) = ObjSolicitudTipo.DtResultados + GlobalDTProspectosSolicitudesTipos(UsuarioActual.CveEmpresa) = Nothing If ViewState("Orden").ToString() <> String.Empty Then CargaGrid(ViewState("Orden").ToString()) @@ -126,7 +126,7 @@ Partial Class Prospectos_Solicitudes_CatProspectosSolicitudesTipos If ObjSolicitudTipo.RemoveSolicitudTipo(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then GvDatos.EditIndex = -1 ViewState("DTSolicitudTipo") = ObjSolicitudTipo.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTProspectosSolicitudesTipos(UsuarioActual.CveEmpresa) = ObjSolicitudTipo.DtResultados + GlobalDTProspectosSolicitudesTipos(UsuarioActual.CveEmpresa) = Nothing Alert("El Tipo de Solicitud se eliminó correctamente.", TipoMensaje.MsgInformacion) End If @@ -159,7 +159,7 @@ Partial Class Prospectos_Solicitudes_CatProspectosSolicitudesTipos If ObjSolicitudTipo.UpdateSolicitudTipo(SolicitudTipo, Estatus, CveSolicitudTipo) Then GvDatos.EditIndex = -1 ViewState("DTSolicitudTipo") = ObjSolicitudTipo.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTProspectosSolicitudesTipos(UsuarioActual.CveEmpresa) = ObjSolicitudTipo.DtResultados + GlobalDTProspectosSolicitudesTipos(UsuarioActual.CveEmpresa) = Nothing Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) End If diff --git a/Sistemas/CatSesiones.aspx.vb b/Sistemas/CatSesiones.aspx.vb index 58cea5074..1e88d9a3e 100644 --- a/Sistemas/CatSesiones.aspx.vb +++ b/Sistemas/CatSesiones.aspx.vb @@ -366,23 +366,23 @@ Partial Class Sistemas_CatSesiones End Sub Private Sub cargaAC() Using ObjAC As New ClsAC - If ObjAC.GetClasificacionFuncional() Then Application("GlobalDTAC_ClasificacionFuncional") = ObjAC.DtResultados Else Application("GlobalDTAC_ClasificacionFuncional") = Nothing - If ObjAC.GetClasificacionGeografica() Then Application("GlobalDTAC_ClasificacionGeografica") = ObjAC.DtResultados Else Application("GlobalDTAC_ClasificacionGeografica") = Nothing - If ObjAC.GetFuentesFinanciamiento() Then Application("GlobalDTAC_FuentesFinanciamiento") = ObjAC.DtResultados Else Application("GlobalDTAC_FuentesFinanciamiento") = Nothing + If ObjAC.GetClasificacionFuncional(UsuarioActual.CveEmpresa) Then Application("GlobalDTAC_ClasificacionFuncional") = ObjAC.DtResultados Else Application("GlobalDTAC_ClasificacionFuncional") = Nothing + If ObjAC.GetClasificacionGeografica(UsuarioActual.CveEmpresa) Then Application("GlobalDTAC_ClasificacionGeografica") = ObjAC.DtResultados Else Application("GlobalDTAC_ClasificacionGeografica") = Nothing + If ObjAC.GetFuentesFinanciamiento(UsuarioActual.CveEmpresa) Then Application("GlobalDTAC_FuentesFinanciamiento") = ObjAC.DtResultados Else Application("GlobalDTAC_FuentesFinanciamiento") = Nothing If ObjAC.GetFuenteFinanciamientoCONAC() Then Application("GlobalDTAC_FuentesFinanciamientoCONAC") = ObjAC.DtResultados Else Application("GlobalDTAC_FuentesFinanciamientoCONAC") = Nothing If ObjAC.GetProgramaCONAC() Then Application("GlobalDTAC_ProgramasCONAC") = ObjAC.DtResultados Else Application("GlobalDTAC_ProgramasCONAC") = Nothing - If ObjAC.GetUnidadesAdministrativas() Then Application("GlobalDTAC_UnidadesAdministrativas") = ObjAC.DtResultados Else Application("GlobalDTAC_UnidadesAdministrativas") = Nothing - If ObjAC.GetClasificacionAdministrativa() Then Application("GlobalDTAC_ClasificacionAdministrativa") = ObjAC.DtResultados Else Application("GlobalDTAC_ClasificacionAdministrativa") = Nothing - If ObjAC.GetPD_EjeRector() Then Application("GlobalDTAC_PD_EjeRector") = ObjAC.DtResultados Else Application("GlobalDTAC_PD_EjeRector") = Nothing + If ObjAC.GetUnidadesAdministrativas(UsuarioActual.CveEmpresa) Then Application("GlobalDTAC_UnidadesAdministrativas") = ObjAC.DtResultados Else Application("GlobalDTAC_UnidadesAdministrativas") = Nothing + If ObjAC.GetClasificacionAdministrativa(UsuarioActual.CveEmpresa) Then Application("GlobalDTAC_ClasificacionAdministrativa") = ObjAC.DtResultados Else Application("GlobalDTAC_ClasificacionAdministrativa") = Nothing + If ObjAC.GetPD_EjeRector(UsuarioActual.CveEmpresa) Then Application("GlobalDTAC_PD_EjeRector") = ObjAC.DtResultados Else Application("GlobalDTAC_PD_EjeRector") = Nothing If ObjAC.GetPD_Programas() Then Application("GlobalDTAC_PD_Programas") = ObjAC.DtResultados Else Application("GlobalDTAC_PD_Programas") = Nothing If ObjAC.GetPD_Estrategias() Then Application("GlobalDTAC_PD_Estrategias") = ObjAC.DtResultados Else Application("GlobalDTAC_PD_Estrategias") = Nothing If ObjAC.GetPD_LineasAccion() Then Application("GlobalDTAC_PD_LineasAccion") = ObjAC.DtResultados Else Application("GlobalDTAC_PD_LineasAccion") = Nothing If ObjAC.GetPD_Metas() Then Application("GlobalDTAC_PD_Metas") = ObjAC.DtResultados Else Application("GlobalDTAC_PD_Metas") = Nothing If ObjAC.GetTipoGasto() Then Application("GlobalDTAC_TipoGasto") = ObjAC.DtResultados Else Application("GlobalDTAC_TipoGasto") = Nothing - If ObjAC.GetProgramaOperativo() Then Application("GlobalDTAC_ProgramaOperativo") = ObjAC.DtResultados Else Application("GlobalDTAC_ProgramaOperativo") = Nothing - If ObjAC.GetFuentesFinanciamiento() Then Application("GlobalDTAC_FuentesFinanciamiento") = ObjAC.DtResultados Else Application("GlobalDTAC_FuentesFinanciamiento") = Nothing + If ObjAC.GetProgramaOperativo(UsuarioActual.CveEmpresa) Then Application("GlobalDTAC_ProgramaOperativo") = ObjAC.DtResultados Else Application("GlobalDTAC_ProgramaOperativo") = Nothing + If ObjAC.GetFuentesFinanciamiento(UsuarioActual.CveEmpresa) Then Application("GlobalDTAC_FuentesFinanciamiento") = ObjAC.DtResultados Else Application("GlobalDTAC_FuentesFinanciamiento") = Nothing If ObjAC.GetRubrosIngreso() Then Application("GlobalDTAC_RubrosIngreso") = ObjAC.DtResultados Else Application("GlobalDTAC_RubrosIngreso") = Nothing - If ObjAC.GetFuentesRecaudacion() Then Application("GlobalDTAC_FuentesRecaudacion") = ObjAC.DtResultados Else Application("GlobalDTAC_FuentesRecaudacion") = Nothing + If ObjAC.GetFuentesRecaudacion(UsuarioActual.CveEmpresa) Then Application("GlobalDTAC_FuentesRecaudacion") = ObjAC.DtResultados Else Application("GlobalDTAC_FuentesRecaudacion") = Nothing If ObjAC.GetMatrizID Then Application("GlobalDTAC_MatrizIngresos") = ObjAC.DtResultados Else Application("GlobalDTAC_MatrizIngresos") = Nothing If ObjAC.GetMatrizGD Then Application("GlobalDTAC_MatrizEgresos") = ObjAC.DtResultados Else Application("GlobalDTAC_MatrizEgresos") = Nothing @@ -509,7 +509,7 @@ Partial Class Sistemas_CatSesiones Private Sub CargaProsCla() Dim Prosp As New ClsProspectos - If Prosp.GetClasificacion Then Application("GlobalDTProspectosClasificaciones") = Prosp.DtResultados Else Application("GlobalDTProspectosClasificaciones") = Nothing + If Prosp.GetClasificacion(UsuarioActual.CveEmpresa) Then Application("GlobalDTProspectosClasificaciones") = Prosp.DtResultados Else Application("GlobalDTProspectosClasificaciones") = Nothing Prosp.Dispose() End Sub @@ -583,21 +583,21 @@ Partial Class Sistemas_CatSesiones Private Sub CargaCONAC() Dim ObjAC As New ClsAC - If ObjAC.GetClasificacionFuncional() Then Application("GlobalDTAC_ClasificacionFuncional") = ObjAC.DtResultados Else Application("GlobalDTAC_ClasificacionFuncional") = Nothing + If ObjAC.GetClasificacionFuncional(UsuarioActual.CveEmpresa) Then Application("GlobalDTAC_ClasificacionFuncional") = ObjAC.DtResultados Else Application("GlobalDTAC_ClasificacionFuncional") = Nothing - If ObjAC.GetClasificacionGeografica() Then Application("GlobalDTAC_ClasificacionGeografica") = ObjAC.DtResultados Else Application("GlobalDTAC_ClasificacionGeografica") = Nothing + If ObjAC.GetClasificacionGeografica(UsuarioActual.CveEmpresa) Then Application("GlobalDTAC_ClasificacionGeografica") = ObjAC.DtResultados Else Application("GlobalDTAC_ClasificacionGeografica") = Nothing - If ObjAC.GetFuentesFinanciamiento() Then Application("GlobalDTAC_FuentesFinanciamiento") = ObjAC.DtResultados Else Application("GlobalDTAC_FuentesFinanciamiento") = Nothing + If ObjAC.GetFuentesFinanciamiento(UsuarioActual.CveEmpresa) Then Application("GlobalDTAC_FuentesFinanciamiento") = ObjAC.DtResultados Else Application("GlobalDTAC_FuentesFinanciamiento") = Nothing If ObjAC.GetFuenteFinanciamientoCONAC() Then Application("GlobalDTAC_FuentesFinanciamientoCONAC") = ObjAC.DtResultados Else Application("GlobalDTAC_FuentesFinanciamientoCONAC") = Nothing If ObjAC.GetProgramaCONAC() Then Application("GlobalDTAC_ProgramasCONAC") = ObjAC.DtResultados Else Application("GlobalDTAC_ProgramasCONAC") = Nothing - If ObjAC.GetUnidadesAdministrativas() Then Application("GlobalDTAC_UnidadesAdministrativas") = ObjAC.DtResultados Else Application("GlobalDTAC_UnidadesAdministrativas") = Nothing + If ObjAC.GetUnidadesAdministrativas(UsuarioActual.CveEmpresa) Then Application("GlobalDTAC_UnidadesAdministrativas") = ObjAC.DtResultados Else Application("GlobalDTAC_UnidadesAdministrativas") = Nothing - If ObjAC.GetClasificacionAdministrativa() Then Application("GlobalDTAC_ClasificacionAdministrativa") = ObjAC.DtResultados Else Application("GlobalDTAC_ClasificacionAdministrativa") = Nothing + If ObjAC.GetClasificacionAdministrativa(UsuarioActual.CveEmpresa) Then Application("GlobalDTAC_ClasificacionAdministrativa") = ObjAC.DtResultados Else Application("GlobalDTAC_ClasificacionAdministrativa") = Nothing - If ObjAC.GetPD_EjeRector() Then Application("GlobalDTAC_PD_EjeRector") = ObjAC.DtResultados Else Application("GlobalDTAC_PD_EjeRector") = Nothing + If ObjAC.GetPD_EjeRector(UsuarioActual.CveEmpresa) Then Application("GlobalDTAC_PD_EjeRector") = ObjAC.DtResultados Else Application("GlobalDTAC_PD_EjeRector") = Nothing If ObjAC.GetPD_Programas() Then Application("GlobalDTAC_PD_Programas") = ObjAC.DtResultados Else Application("GlobalDTAC_PD_Programas") = Nothing @@ -609,13 +609,13 @@ Partial Class Sistemas_CatSesiones If ObjAC.GetTipoGasto() Then Application("GlobalDTAC_TipoGasto") = ObjAC.DtResultados Else Application("GlobalDTAC_TipoGasto") = Nothing - If ObjAC.GetProgramaOperativo() Then Application("GlobalDTAC_ProgramaOperativo") = ObjAC.DtResultados Else Application("GlobalDTAC_ProgramaOperativo") = Nothing + If ObjAC.GetProgramaOperativo(UsuarioActual.CveEmpresa) Then Application("GlobalDTAC_ProgramaOperativo") = ObjAC.DtResultados Else Application("GlobalDTAC_ProgramaOperativo") = Nothing - If ObjAC.GetFuentesFinanciamiento() Then Application("GlobalDTAC_FuentesFinanciamiento") = ObjAC.DtResultados Else Application("GlobalDTAC_FuentesFinanciamiento") = Nothing + If ObjAC.GetFuentesFinanciamiento(UsuarioActual.CveEmpresa) Then Application("GlobalDTAC_FuentesFinanciamiento") = ObjAC.DtResultados Else Application("GlobalDTAC_FuentesFinanciamiento") = Nothing If ObjAC.GetRubrosIngreso() Then Application("GlobalDTAC_RubrosIngreso") = ObjAC.DtResultados Else Application("GlobalDTAC_RubrosIngreso") = Nothing - If ObjAC.GetFuentesRecaudacion() Then Application("GlobalDTAC_FuentesRecaudacion") = ObjAC.DtResultados Else Application("GlobalDTAC_FuentesRecaudacion") = Nothing + If ObjAC.GetFuentesRecaudacion(UsuarioActual.CveEmpresa) Then Application("GlobalDTAC_FuentesRecaudacion") = ObjAC.DtResultados Else Application("GlobalDTAC_FuentesRecaudacion") = Nothing If ObjAC.GetMatrizID Then Application("GlobalDTAC_MatrizIngresos") = ObjAC.DtResultados Else Application("GlobalDTAC_MatrizIngresos") = Nothing @@ -646,7 +646,7 @@ Partial Class Sistemas_CatSesiones Private Sub CargarCombustible() Dim ObjFlotillas As New ClsFlotillas - If ObjFlotillas.GetCombustibles() Then Application("GlobalDTCombustibles") = ObjFlotillas.DtResultados Else Application("GlobalDTCombustibles") = Nothing + If ObjFlotillas.GetCombustibles(UsuarioActual.CveEmpresa) Then Application("GlobalDTCombustibles") = ObjFlotillas.DtResultados Else Application("GlobalDTCombustibles") = Nothing ObjFlotillas.Dispose() End Sub diff --git a/Ventas/CatClasificacionesDetalle.aspx.vb b/Ventas/CatClasificacionesDetalle.aspx.vb index bec440813..47e242f3b 100644 --- a/Ventas/CatClasificacionesDetalle.aspx.vb +++ b/Ventas/CatClasificacionesDetalle.aspx.vb @@ -82,12 +82,12 @@ Partial Class CatClasificacionesDetalle Private Sub CargaGlobal() Dim ObjClasificaciones As New ClsClasificaciones - If ObjClasificaciones.GetClasificaciones() Then - GlobalDTClasificaciones = ObjClasificaciones.DtResultados - Else - Alert("Ocurrió un error al cargar las clasificaciones generales. Por favor avisar a Sistemas.", TipoMensaje.MsgError) - End If - + 'If ObjClasificaciones.GetClasificaciones(UsuarioActual.CveEmpresa) Then + ' GlobalDTClasificaciones = ObjClasificaciones.DtResultados + 'Else + ' Alert("Ocurrió un error al cargar las clasificaciones generales. Por favor avisar a Sistemas.", TipoMensaje.MsgError) + 'End If + GlobalDTClasificaciones(UsuarioActual.CveEmpresa) = Nothing If ObjClasificaciones.GetClasificacionesSubProyecto(CveClasificacion, UsuarioActual.CveEmpresa) Then ViewState("DTClasificaciones") = ObjClasificaciones.DtResultados End If diff --git a/Ventas/CatFamiliaSubFamilia.aspx.vb b/Ventas/CatFamiliaSubFamilia.aspx.vb index d9968d5cc..56eb761f7 100644 --- a/Ventas/CatFamiliaSubFamilia.aspx.vb +++ b/Ventas/CatFamiliaSubFamilia.aspx.vb @@ -76,8 +76,7 @@ Partial Class Ventas_CatFamiliaSubFamilia Public Sub CargaDatosS() Dim ObjClasificaciones As New ClsClasificaciones - If ObjClasificaciones.GetClasificaciones(-1, 2) Then - GlobalDTSubFamilias = ObjClasificaciones.DtResultados + If ObjClasificaciones.GetClasificaciones(UsuarioActual.CveEmpresa, 2) Then ViewState("DTSubFamilias") = GlobalDTSubFamilias(UsuarioActual.CveEmpresa) Else GvDatosS.DataSource = Nothing @@ -197,9 +196,9 @@ Partial Class Ventas_CatFamiliaSubFamilia Alert("La nueva SubFamilia se guardó correctamente.", TipoMensaje.MsgInformacion) UpTitulosS.Update() - If ObjClasificaciones.GetClasificaciones(-1, 2) Then - ViewState("DTSubFamilias") = ObjClasificaciones.DtResultados.FiltraParametros(String.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa)) - GlobalDTSubFamilias = ObjClasificaciones.DtResultados + If ObjClasificaciones.GetClasificaciones(UsuarioActual.CveEmpresa, 2) Then + ViewState("DTSubFamilias") = ObjClasificaciones.DtResultados + GlobalDTSubFamilias(UsuarioActual.CveEmpresa) = Nothing End If 'DdlCuentaGastoS.SelectedValue = "-1" @@ -290,9 +289,9 @@ Partial Class Ventas_CatFamiliaSubFamilia Dim ObjClasificaciones As New ClsClasificaciones If ObjClasificaciones.RemoveClasificacion(GvDatosS.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then GvDatosS.EditIndex = -1 - If ObjClasificaciones.GetClasificaciones(-1, 2) Then - ViewState("DTSubFamilias") = ObjClasificaciones.DtResultados.FiltraParametros(String.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa)) - GlobalDTSubFamilias = ObjClasificaciones.DtResultados + If ObjClasificaciones.GetClasificaciones(UsuarioActual.CveEmpresa, 2) Then + ViewState("DTSubFamilias") = ObjClasificaciones.DtResultados + GlobalDTSubFamilias(UsuarioActual.CveEmpresa) = Nothing End If Alert("La SubFamilia se eliminó correctamente.", TipoMensaje.MsgInformacion) End If diff --git a/Ventas/CatPS.aspx.vb b/Ventas/CatPS.aspx.vb index 087af1283..65e31729e 100644 --- a/Ventas/CatPS.aspx.vb +++ b/Ventas/CatPS.aspx.vb @@ -51,7 +51,7 @@ Partial Class CatPS End Sub Public Sub CargaClasificaciones() - Ddlclasificacion.DataSource = GlobalDTClasificaciones.FiltraParametros(String.Format("CveEmpresa = {0} AND (UsoClasificacion = {1} OR {1} = -1)", UsuarioActual.CveEmpresa, DdlTipoClasificacion.SelectedValue.ToEntero)) + Ddlclasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros(String.Format(" (UsoClasificacion = {0} OR {0} = -1)", DdlTipoClasificacion.SelectedValue.ToEntero)) Ddlclasificacion.DataBind() Ddlclasificacion.Items.Insert(0, New ListItem("Todos", "-1")) End Sub diff --git a/Ventas/ClientesAbonar.aspx.vb b/Ventas/ClientesAbonar.aspx.vb index ac075bd59..ebe60dbda 100644 --- a/Ventas/ClientesAbonar.aspx.vb +++ b/Ventas/ClientesAbonar.aspx.vb @@ -898,7 +898,7 @@ Partial Class Ventas_ClientesAbonar For Each Gvr As GridViewRow In GvCxC.Rows If Gvr.FCCheckBox("Chk").Checked Then - CveSubProyecto = Gvr.DataKey("CveSubProyecto").ToEntero + CveSubProyectoMaximo = Gvr.DataKey("CveSubProyecto").ToEntero Exit For End If Next @@ -1225,9 +1225,9 @@ Partial Class Ventas_ClientesAbonar End If End If - If MsgError = "" AndAlso ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, 3) AndAlso UsuarioActual.CveEmpresa <> 158 Then + If MsgError = "" AndAlso ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, 3) Then If ObjMov.ValorPolizaDescuadre > 0 Then - MsgError = ObjMov.MensajePolizaDescuadre + " La diferencia es de: " + ObjMov.ValorDiferencia + MsgError = ObjMov.MensajePolizaDescuadre & " La diferencia es de: " & ObjMov.ValorDiferencia End If End If diff --git a/Ventas/PopUpBuscarPs.aspx.vb b/Ventas/PopUpBuscarPs.aspx.vb index 986ee61da..ba278141d 100644 --- a/Ventas/PopUpBuscarPs.aspx.vb +++ b/Ventas/PopUpBuscarPs.aspx.vb @@ -28,7 +28,7 @@ Partial Class PopUpBuscarPs #Region " INICIALIZA VALORES " Private Sub CargaClasificaciones() - Ddlclasificacion.DataSource = GlobalDTClasificaciones.FiltraParametros(String.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa)) + Ddlclasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) Ddlclasificacion.DataBind() Ddlclasificacion.Items.Insert(0, New ListItem("Todos", "-1")) End Sub diff --git a/Ventas/ProductosServicios.aspx.vb b/Ventas/ProductosServicios.aspx.vb index cd8b91676..5430bba37 100644 --- a/Ventas/ProductosServicios.aspx.vb +++ b/Ventas/ProductosServicios.aspx.vb @@ -657,7 +657,7 @@ Partial Class ProductosyServicios If ObjOpciones.UpdateProductosServiciosCaracteristicasOpciones(Opcion, CveCaracteristica, CveOpcion) Then GvDatosOpciones.EditIndex = -1 ViewState("DTProductosServiciosCaracteristicasOpciones") = ObjOpciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTProductosServiciosCaracteristicasOpciones(UsuarioActual.CveEmpresa) = ObjOpciones.DtResultados + GlobalDTProductosServiciosCaracteristicasOpciones(UsuarioActual.CveEmpresa) = Nothing Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) CambioProductosServiciosCaracteristicasOpciones() From 8b0ea244f4f0eae5545800462a12602b3f1f2865 Mon Sep 17 00:00:00 2001 From: rrene Date: Fri, 24 Feb 2023 16:17:24 -0700 Subject: [PATCH 17/20] =?UTF-8?q?--=20cambios=20en=20fluctuaci=C3=B3n=20de?= =?UTF-8?q?=20Bancos,=20para=20que=20sea=20esquema=20SIG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bancos/FluctuacionCambiaria.aspx | 6 +- Bancos/FluctuacionCambiaria.aspx.vb | 125 ++++++++++++++-------------- 2 files changed, 66 insertions(+), 65 deletions(-) diff --git a/Bancos/FluctuacionCambiaria.aspx b/Bancos/FluctuacionCambiaria.aspx index 8d2b2f78b..9f944d3b2 100644 --- a/Bancos/FluctuacionCambiaria.aspx +++ b/Bancos/FluctuacionCambiaria.aspx @@ -738,8 +738,8 @@
    @@ -750,7 +750,7 @@
    - +
    diff --git a/Bancos/FluctuacionCambiaria.aspx.vb b/Bancos/FluctuacionCambiaria.aspx.vb index f8e7000b9..077ad1d5b 100644 --- a/Bancos/FluctuacionCambiaria.aspx.vb +++ b/Bancos/FluctuacionCambiaria.aspx.vb @@ -73,7 +73,7 @@ Partial Class Bancos_FluctuacionCambiaria If T.ActiveTabIndex = 3 Then CargaDatosClientesAnticipos() If T.ActiveTabIndex = 4 Then CargaDatosAcreedores() If T.ActiveTabIndex = 5 Then CargaDatosAcreedoresAnticipos() - If T.ActiveTabIndex = 6 Then CargaDatosCuentas() + If T.ActiveTabIndex = 6 Then CargaDatosBancosCuentas() If T.ActiveTabIndex = 7 Then CargaDatosFiliales() If T.ActiveTabIndex = 8 Then CargaDatosDeudores() @@ -301,42 +301,42 @@ Partial Class Bancos_FluctuacionCambiaria GvAcreedoresAnt.DataBind() End Sub - Private Sub CargaDatosCuentas() + Private Sub CargaDatosBancosCuentas() Dim ObjBancos As New ClsBancos LblTotalBancos.Text = "0.00" - If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 7, UsuarioActual.CveEmpresa) Then + If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 77, UsuarioActual.CveEmpresa) Then Dim DtTemp As DataTable = ObjBancos.DtResultados.Copy Dim TCCierreFluctuacion As Decimal = LtTipoCambioActual.Text.ToDecimal - Dim TotAcumulado As Decimal = 0 - Dim Conta As New ClsContabilidad - For Each Dr As DataRow In DtTemp.Rows - Dim Total As Decimal = 0 - Dim CveCuentaExtranjera As Integer = Dr("CveCuentaExtranjera").ToString.ToEntero - If CveCuentaExtranjera > 0 Then - If Conta.GetMovimientosAuxiliaresCatalogo(CveCuentaExtranjera, MinFecha, FechaUltimoDiaMes, 2, -1, -1, UsuarioActual.CveEmpresa, "1") Then - If Conta.DtResultados.Rows.Count > 1 Then - Total = Conta.DtResultados.Rows(1)("SaldoActual").ToString.ToDecimal - End If - End If - End If - Dr("Saldo") = Total - Total = Total * TCCierreFluctuacion - Total - Dim SaldoActualContabilidad As Decimal = 0 - Dim CveCuentaComplementaria As Integer = Dr("CveCuentaComplementaria").ToString.ToEntero - If CveCuentaComplementaria > 0 Then - If Conta.GetMovimientosAuxiliaresCatalogo(CveCuentaComplementaria, MinFecha, FechaUltimoDiaMes, 2, -1, -1, UsuarioActual.CveEmpresa, "1") Then - If Conta.DtResultados.Rows.Count > 1 Then - SaldoActualContabilidad = Conta.DtResultados.Rows(1)("SaldoActual").ToString.ToDecimal - End If - End If - End If + Dim TotAcumulado As Decimal = ObjBancos.DtResultados.SUMD("Fluctuacion") + 'Dim Conta As New ClsContabilidad + 'For Each Dr As DataRow In DtTemp.Rows + ' Dim Total As Decimal = 0 + ' Dim CveCuentaExtranjera As Integer = Dr("CveCuentaExtranjera").ToString.ToEntero + ' If CveCuentaExtranjera > 0 Then + ' If Conta.GetMovimientosAuxiliaresCatalogo(CveCuentaExtranjera, MinFecha, FechaUltimoDiaMes, 2, -1, -1, UsuarioActual.CveEmpresa, "1") Then + ' If Conta.DtResultados.Rows.Count > 1 Then + ' Total = Conta.DtResultados.Rows(1)("SaldoActual").ToString.ToDecimal + ' End If + ' End If + ' End If + ' Dr("Saldo") = Total + ' Total = Total * TCCierreFluctuacion - Total + ' Dim SaldoActualContabilidad As Decimal = 0 + ' Dim CveCuentaComplementaria As Integer = Dr("CveCuentaComplementaria").ToString.ToEntero + ' If CveCuentaComplementaria > 0 Then + ' If Conta.GetMovimientosAuxiliaresCatalogo(CveCuentaComplementaria, MinFecha, FechaUltimoDiaMes, 2, -1, -1, UsuarioActual.CveEmpresa, "1") Then + ' If Conta.DtResultados.Rows.Count > 1 Then + ' SaldoActualContabilidad = Conta.DtResultados.Rows(1)("SaldoActual").ToString.ToDecimal + ' End If + ' End If + ' End If - Total = Total - SaldoActualContabilidad - TotAcumulado += Math.Round(Total, 2) - Dr("Fluctuacion") = Total - Next - DtTemp.AcceptChanges() - Conta.Dispose() + ' Total = Total - SaldoActualContabilidad + ' TotAcumulado += Math.Round(Total, 2) + ' Dr("Fluctuacion") = Total + 'Next + 'DtTemp.AcceptChanges() + 'Conta.Dispose() GvCuentas.DataSource = DtTemp LblTotalBancos.Text = TotAcumulado.FormatoNumero @@ -910,8 +910,8 @@ Partial Class Bancos_FluctuacionCambiaria Dim Total As Decimal = 0 Dim Conta As New ClsContabilidad Conta.IniciaTransacSQL() - Dim ObjContPaq As New ClsContPAQi(UsuarioActual.Empresa) - ObjContPaq.IniciaTransacSQL() + 'Dim ObjContPaq As New ClsContPAQi(UsuarioActual.Empresa) + 'ObjContPaq.IniciaTransacSQL() Dim idCta As Integer = 0 Dim CveCuenta As Integer = 0 Dim CveCuentaPerdida, CveCuentaGanancia As Integer @@ -937,8 +937,8 @@ Partial Class Bancos_FluctuacionCambiaria For Each gvr As GridViewRow In GvCuentas.Rows Dim cb As CheckBox = gvr.FCCheckBox("ChkGenerarBancos") If cb.Checked Then - Total = gvr.DataKey("Fluctuacion").ToDecimal - Dim IdCtaComplementaria As Integer = gvr.DataKey("IdCtaAfectable").ToEntero + Total = gvr.DataKey("Fluctuacion").ToDecimal + ' Dim IdCtaComplementaria As Integer = gvr.DataKey("IdCtaAfectable").ToEntero Dim ConceptoReferencia As String = String.Format("{0} - {1} {2}", gvr.DataKey("Banco"), gvr.DataKey("NumCuenta"), MesTCtexto) 'MOVIMIENTO DE FLUCTUACION @@ -952,15 +952,16 @@ Partial Class Bancos_FluctuacionCambiaria CveCuenta = CveCuentaPerdida idCta = idCtaPerdida TipoMovto = False - End If - - 'movimiento de complementaria - If Not Conta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovto, Math.Abs(Total), ConceptoReferencia, CveConconceptoBancos, ConceptoReferencia, Now, IdCtaComplementaria, 0, TipoCambio:=TC, ImporteMX:=Math.Abs(Total), ImporteME:=Math.Abs(Total)) Then + End If + + 'movimiento de complementaria + If Not Conta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovto, Math.Abs(Total), ConceptoReferencia, CveConconceptoBancos, ConceptoReferencia, Now, 0, 0, TipoCambio:=TC, ImporteMX:=Math.Abs(Total), ImporteME:=Math.Abs(Total), CveCuenta:=gvr.DataKey("CveCuentaMEComplementaria").ToEntero) Then ErrorRegistrar = True Exit For End If - If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), ConceptoReferencia, CveConceptoContable, ConceptoReferencia, Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta, CveSubProyecto:=DdlSubproyectoBancos.SelectedValue.ToEntero) Then + + If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), Math.Abs(Total), CveConceptoContable, ConceptoReferencia, ConceptoReferencia, 0, CveSubProyecto:=DdlSubproyectoBancos.SelectedValue.ToEntero) Then ErrorRegistrar = True End If End If @@ -970,7 +971,7 @@ Partial Class Bancos_FluctuacionCambiaria Dim AutoConta As Boolean = UsuarioActual.Empresa.Funcionalidad(200) = "1" If AutoConta Then - If Conta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContPaq) Then + If Conta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then SeContabilizo = True Else ErrorRegistrar = True @@ -978,15 +979,15 @@ Partial Class Bancos_FluctuacionCambiaria End If End If - If Not ErrorRegistrar And SeContabilizo Then + If Not ErrorRegistrar Then - Conta.Commit() - ObjContPaq.Commit() + Conta.Commit() + ' ObjContPaq.Commit() Alert(String.Format("La Fluctuación se ha generado
    Ver PrePóliza", CvePrePoliza), TipoMensaje.MsgInformacion) - CargaDatosCuentas() + CargaDatosBancosCuentas() Else - Conta.RollBack() - ObjContPaq.Dispose() + Conta.RollBack() + ' ObjContPaq.Dispose() End If Conta.Dispose() End Sub @@ -1165,20 +1166,20 @@ Partial Class Bancos_FluctuacionCambiaria #Region "GRIDVIEWS" - Protected Sub GvCuentas_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvCuentas.RowDataBound - If e.Row.RowType = DataControlRowType.DataRow Then - 'TipoCambio = e.Row.DBCampo("TipoCambio").ToString.ToDouble - 'e.Row.FCLabel("LbTipoCambioActual").Text = TipoCambioActual.ToString - 'e.Row.FCLabel("LbTipoCambio").Text = If(TipoCambio > 0, TipoCambio.ToString, "No hay TipoCambio") - 'e.Row.FCLabel("LbFluctuacion").Text = If(TipoCambio > 0, ((TipoCambio - TipoCambioActual) * e.Row.DBCampo("Saldo").ToString.ToDouble).ToString, "No aplica") - - If Not e.Row.DBCampo("IdCtaContable").ToString.ToEntero > 0 Then - ' e.Row.FCLabel("LabelBanco").ForeColor = Drawing.Color.Red - End If - - End If - End Sub - + 'Protected Sub GvCuentas_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvCuentas.RowDataBound + ' If e.Row.RowType = DataControlRowType.DataRow Then + ' 'TipoCambio = e.Row.DBCampo("TipoCambio").ToString.ToDouble + ' 'e.Row.FCLabel("LbTipoCambioActual").Text = TipoCambioActual.ToString + ' 'e.Row.FCLabel("LbTipoCambio").Text = If(TipoCambio > 0, TipoCambio.ToString, "No hay TipoCambio") + ' 'e.Row.FCLabel("LbFluctuacion").Text = If(TipoCambio > 0, ((TipoCambio - TipoCambioActual) * e.Row.DBCampo("Saldo").ToString.ToDouble).ToString, "No aplica") + + ' 'If Not e.Row.DBCampo("IdCtaContable").ToString.ToEntero > 0 Then + ' ' ' e.Row.FCLabel("LabelBanco").ForeColor = Drawing.Color.Red + ' 'End If + + ' End If + 'End Sub + Private Sub GvFiliales_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvFiliales.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then From ffb32eb558e8e07a728bbcf201ee89a5b4a4a390 Mon Sep 17 00:00:00 2001 From: MLopez Date: Fri, 24 Feb 2023 16:14:20 -0700 Subject: [PATCH 18/20] =?UTF-8?q?Se=20reintroducen=20los=20GlobalDT=20de?= =?UTF-8?q?=20PS=20Caracter=C3=ADsticas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CAMBIOS EN BD VENTAS: - PA_GRAL_ProductosServiciosCaracteristicasGet - PA_GRAL_ProductosServiciosCaracteristicasOpcionesGet El parámetro @CveEmpresa INT se vuelve requerido. --- ...lsGralProductosServiciosCaracteristicas.vb | 4 +-- App_Code/ClsPaginas.vb | 36 ++++++++++--------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/App_Code/ClsGralProductosServiciosCaracteristicas.vb b/App_Code/ClsGralProductosServiciosCaracteristicas.vb index 8ee0d7822..593903c4f 100644 --- a/App_Code/ClsGralProductosServiciosCaracteristicas.vb +++ b/App_Code/ClsGralProductosServiciosCaracteristicas.vb @@ -100,7 +100,7 @@ Public Class ClsGralProductosServiciosCaracteristicas #End Region #Region "ProductosServiciosCaracteristicas" - Public Function GetProductosServiciosCaracteristicas(Optional CveEmpresa As Integer = -1, Optional CveSubProyecto As Integer = -1) As Boolean + Public Function GetProductosServiciosCaracteristicas(CveEmpresa As Integer, Optional CveSubProyecto As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_GRAL_ProductosServiciosCaracteristicasGet") @@ -203,7 +203,7 @@ Public Class ClsGralProductosServiciosCaracteristicas #Region "ProductosServiciosCaracteristicasOpciones" - Public Function GetProductosServiciosCaracteristicasOpciones(Optional CveEmpresa As Integer = -1, Optional CveSubProyecto As Integer = -1) As Boolean + Public Function GetProductosServiciosCaracteristicasOpciones(CveEmpresa As Integer, Optional CveSubProyecto As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_GRAL_ProductosServiciosCaracteristicasOpcionesGet") diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 1c88a95eb..dc48e03e1 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -1659,18 +1659,20 @@ Public Class ClsPaginas HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProductosServiciosCaracteristicas(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProductosServiciosCaracteristicas(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProductosServiciosCaracteristicas"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProductosServiciosCaracteristicas = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProductosServiciosCaracteristicas = DirectCast(Application("GlobalDTProductosServiciosCaracteristicas"), DataTable) + Dim AppNombre As String = $"GlobalDTProductosServiciosCaracteristicas-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProductosServiciosCaracteristicas As New ClsGralProductosServiciosCaracteristicas + If ObjProductosServiciosCaracteristicas.GetProductosServiciosCaracteristicas(CveEmpresa:=CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProductosServiciosCaracteristicas.DtResultados + End Using End If + GlobalDTProductosServiciosCaracteristicas = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTProductosServiciosCaracteristicas") = value + Dim AppNombre As String = $"GlobalDTProductosServiciosCaracteristicas-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property Property GlobalDTPSAdicionales(CvePS As Integer, CveEmpresa As Integer) As DataTable @@ -1695,18 +1697,20 @@ Public Class ClsPaginas Application(AppNombre) = value End Set End Property - Property GlobalDTProductosServiciosCaracteristicasOpciones(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProductosServiciosCaracteristicasOpciones(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProductosServiciosCaracteristicasOpciones"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProductosServiciosCaracteristicasOpciones = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProductosServiciosCaracteristicasOpciones = DirectCast(Application("GlobalDTProductosServiciosCaracteristicasOpciones"), DataTable) + Dim AppNombre As String = $"GlobalDTProductosServiciosCaracteristicasOpciones-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProductosServiciosCaracteristicas As New ClsGralProductosServiciosCaracteristicas + If ObjProductosServiciosCaracteristicas.GetProductosServiciosCaracteristicasOpciones(CveEmpresa:=CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProductosServiciosCaracteristicas.DtResultados + End Using End If + GlobalDTProductosServiciosCaracteristicasOpciones = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTProductosServiciosCaracteristicasOpciones") = value + Dim AppNombre As String = $"GlobalDTProductosServiciosCaracteristicasOpciones-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property Property GlobalDTInvMetodosInventario() As DataTable From f635988991d414bcbcdcfbdc7f0606c9c818c317 Mon Sep 17 00:00:00 2001 From: MLopez Date: Fri, 24 Feb 2023 17:14:41 -0700 Subject: [PATCH 19/20] =?UTF-8?q?Corregir=20tama=C3=B1o=20botones?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Contabilidad2/CatContaEjercicios.aspx | 57 ++++++++++++++++++++++++--- 1 file changed, 52 insertions(+), 5 deletions(-) diff --git a/Contabilidad2/CatContaEjercicios.aspx b/Contabilidad2/CatContaEjercicios.aspx index 7410bbd41..43e5f2be4 100644 --- a/Contabilidad2/CatContaEjercicios.aspx +++ b/Contabilidad2/CatContaEjercicios.aspx @@ -1,9 +1,53 @@ <%@ Page Title="Contabilidad2 - Catálogo Ejercicios" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatContaEjercicios.aspx.vb" Inherits="Contabilidad2_CatContaEjercicios" %> -<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> + @@ -23,7 +67,7 @@ - @@ -34,17 +78,20 @@ - + - + - + From 74c40041c3cac95a874663f1ece73d702494e92b Mon Sep 17 00:00:00 2001 From: MLopez Date: Fri, 24 Feb 2023 20:44:58 -0700 Subject: [PATCH 20/20] =?UTF-8?q?Ocultar=20bot=C3=B3n=20de=20'Generar=20Sa?= =?UTF-8?q?lida'=20dependiendo=20si=20el=20folio=20ya=20tiene=20un=20movim?= =?UTF-8?q?iento=20de=20salida=20existente=20+=20Col=20Mov.=20Salida?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CAMBIOS BD (VENTAS): PA_Acum_FoliosGarantiaGet, left join Inv_Movimientos + Cols CveMovimiento, Folio --- Acumuladores/CatFoliosGarantia.aspx | 3 ++- Acumuladores/CatFoliosGarantia.aspx.vb | 18 +++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/Acumuladores/CatFoliosGarantia.aspx b/Acumuladores/CatFoliosGarantia.aspx index 9633d73ca..9d44d0e67 100644 --- a/Acumuladores/CatFoliosGarantia.aspx +++ b/Acumuladores/CatFoliosGarantia.aspx @@ -121,7 +121,7 @@
    + diff --git a/Acumuladores/CatFoliosGarantia.aspx.vb b/Acumuladores/CatFoliosGarantia.aspx.vb index 739276730..1ac31b0e6 100644 --- a/Acumuladores/CatFoliosGarantia.aspx.vb +++ b/Acumuladores/CatFoliosGarantia.aspx.vb @@ -20,6 +20,21 @@ Partial Class Acumuladores_CatFoliosGarantia End Property + Private Property CveMovimiento As Integer + Get + If ViewState("CveMovimiento") IsNot Nothing Then + Return ViewState("CveMovimiento").ToString.ToEntero + Else + Return -1 + End If + + End Get + Set(value As Integer) + ViewState("CveMovimiento") = value + End Set + + End Property + Private Property Actualizar As Boolean Get If Not ViewState("Actualizar") Is Nothing Then @@ -219,13 +234,14 @@ Partial Class Acumuladores_CatFoliosGarantia Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) CveFolioGarantia = GvRow.DataKey("CveFolioGarantia") - + CveMovimiento = IIf(GvRow.DataKey("CveMovimiento") <> "", GvRow.DataKey("CveMovimiento"), -1) LblFolio.Text = GvRow.DataKey("FolioGarantia") Using ObjAcum As New ClsAcumuladores If ObjAcum.GetFoliosGarantiasDetalle(CveFolioGarantia, CveEstatusConsecutivo:=DdlEstatusConsecutivo.SelectedValue.ToEntero()) Then GvGarantiasDetalle.DataSource = ObjAcum.DtResultados HplGenerarSalida.NavigateUrl = "/Inventarios/TraspasoAlmacen.aspx?CveFolioGarantia=" & CveFolioGarantia + HplGenerarSalida.Visible = (CveMovimiento = -1) End If End Using GvGarantiasDetalle.DataBind()