From 28eba630e391756b8d96bd0ed2c22d816331fba6 Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 18 Jun 2020 21:22:22 -0700 Subject: [PATCH] -globaldtcuentas depositos, cveempresa --- App_Code/ClsGenerales.vb | 11 ++++++----- App_Code/ClsPaginas.vb | 30 +++++++++++++++++++++++++++++- 2 files changed, 35 insertions(+), 6 deletions(-) diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index f2506fff7..8d999ba99 100644 --- a/App_Code/ClsGenerales.vb +++ b/App_Code/ClsGenerales.vb @@ -1363,12 +1363,12 @@ Public Class ClsGenerales End Try Return Retorno - End Function + End Function #End Region - ' IDisposable - + ' IDisposable + #Region "G E N E R A L E S - C U E N T A S B A N C A R I A S " - Public Function GetCuentasDepositos(Optional CveProveedor As Integer = -1, Optional CveCliente As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveColectiva As Integer = -1, Optional CveCuentaDeposito As Integer = -1) As Boolean + Public Function GetCuentasDepositos(Optional CveProveedor As Integer = -1, Optional CveCliente As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveColectiva As Integer = -1, Optional CveCuentaDeposito As Integer = -1, Optional CveEmpresa As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Gral_CuentasDepositosGet") With SqlAdapter.SelectCommand.Parameters @@ -1376,7 +1376,8 @@ Public Class ClsGenerales .Add("@CveCliente", SqlDbType.Int).Value = CveCliente .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal .Add("@CveColectiva", SqlDbType.Int).Value = CveColectiva - .Add("@CveCuentaDeposito", SqlDbType.Int).Value = CveCuentaDeposito + .Add("@CveCuentaDeposito", SqlDbType.Int).Value = CveCuentaDeposito + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa End With Try diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index c856c52ed..479609e6b 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -442,6 +442,34 @@ Public Class ClsPaginas Application("GlobalDTProveedoresCuentas") = value End Set End Property + + Property GlobalDTCuentasDepositosClientes(CveEmpresa As Integer, Optional CveCliente As Integer = -1, Optional Estatus As Boolean = True) As DataTable + Get + Dim AppNombre As String = String.Format("GlobalDTCuentasDepositosClientes-{0}", CveEmpresa) + 'sino existe, recarga los datos + If DirectCast(Application(AppNombre), DataTable) Is Nothing Then + Dim P As New ClsGenerales + If P.GetCuentasDepositos(CveEmpresa:=CveEmpresa, CveCliente:=-2) Then Application(AppNombre) = P.DtResultados + P.Dispose() + End If + + Dim Str As New StringBuilder + Str.AppendFormat("CveEmpresa = {0}", CveEmpresa) + If CveCliente <> -1 Then Str.AppendFormat(" AND CveCliente = {0}", CveCliente) + If Estatus = True Then Str.AppendFormat(" AND Estatus = 1 ") + + Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows) + + GlobalDTCuentasDepositosClientes = Dv.ToTable + Dv.Dispose() + + + End Get + Set(value As DataTable) + Dim AppNombre As String = String.Format("GlobalDTCuentasDepositosClientes-{0}", CveEmpresa) + Application(AppNombre) = value + End Set + End Property Property GlobalDTProveedorClasificacion(CveEmpresa As Integer) As DataTable Get Dim AppNombre As String = String.Format("GlobalDTProveedorClasificacion-{0}", CveEmpresa) @@ -7253,7 +7281,7 @@ Public Class ClsPaginas If UsuarioActual.CveEmpresa.Contiene(13, 83) Then Dim ObjCuentasBancos As New ClsGenerales() - If ObjCuentasBancos.GetCuentasDepositos(ObjOC.CveProveedor) Then + If ObjCuentasBancos.GetCuentasDepositos(CveProveedor:=ObjOC.CveProveedor) Then Dim CuentasActivas As DataTable = ObjCuentasBancos.DtResultados.FiltraParametros("EstatusTexto = 'Activo'") Dim CuentasStr As New StringBuilder("") For Each CuentasBancarios As DataRow In CuentasActivas.Rows