From 37ef70eeabbdf0c00bd73024dd76be68f1ac2c67 Mon Sep 17 00:00:00 2001 From: janeth arvizu Date: Wed, 21 Aug 2019 14:17:53 -0700 Subject: [PATCH] =?UTF-8?q?Historial=20de=20Modificaci=C3=B3n=20de=20IE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bancos/IE.aspx | 2 +- Bancos/IE.aspx.vb | 71 +++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 64 insertions(+), 9 deletions(-) diff --git a/Bancos/IE.aspx b/Bancos/IE.aspx index e1d841d00..794a5b00b 100644 --- a/Bancos/IE.aspx +++ b/Bancos/IE.aspx @@ -962,7 +962,7 @@ - + diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index 986e9c64a..73a07f5c1 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -424,6 +424,31 @@ Partial Class Bancos_IE End Property + Private Property CuentaOld As String + Get + Return CType(ViewState("CuentaOld"), String) + End Get + Set(value As String) + ViewState("CuentaOld") = value + End Set + End Property + Private Property FechaOld As String + Get + Return CType(ViewState("FechaOld"), String) + End Get + Set(value As String) + ViewState("FechaOld") = value + End Set + End Property + + Private Property FolioOld As String + Get + Return CType(ViewState("FolioOld"), String) + End Get + Set(value As String) + ViewState("FolioOld") = value + End Set + End Property @@ -1086,6 +1111,10 @@ Partial Class Bancos_IE End If + ' DATOS PARA LA BITACORA + CuentaOld = LblCuenta.Text + FechaOld = TxtFechaDocumento.Text + FolioOld = TxtFolio.Text End If @@ -3683,20 +3712,46 @@ Partial Class Bancos_IE Protected Sub BtnActualizar_Click(sender As Object, e As EventArgs) Handles BtnActualizar.Click Dim IE As New ClsBancos + IE.IniciaTransacSQL() + Dim ObjGral As New ClsGenerales + ObjGral.IniciaTransacSQL() Dim FechaAplicado As DateTime? = Nothing - + Dim OcurrioError As Boolean = False Dim CveCuentaDepositoUpdate As Integer = If(DdlCuentaDeposito.SelectedValue.ToEntero.ToEntero = 0, -1, DdlCuentaDeposito.SelectedValue.ToEntero.ToEntero) If IE.UpdateBancos_IE(TxtFechaDocumento.Text.ToDate, FechaAplicado, CveIE, TxtFolio.Text, CveCuentaDeposito:=CveCuentaDepositoUpdate, CveCuenta:=DdlCuenta.SelectedValue.ToEntero, - Observaciones:=TxtObservaciones.Text) Then - Alert("La Actualización del documento se realizó correctamente", TipoMensaje.MsgInformacion, $"document.location.href=""IE.aspx?CveIE={CveIE}""") - End If - + Observaciones:=TxtObservaciones.Text) Then + 'Agrega a la Bitacora + If CuentaOld <> DdlCuenta.SelectedItem.Text Then + If Not ObjGral.AddHistorialBitacora(Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, CveIE, DdlCuenta.SelectedItem.Text, CuentaOld, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0, "Cuenta", "Banco", TxtFolio.Text + " / " + Cuenta) Then + OcurrioError = True + End If + End If + If FechaOld <> TxtFechaDocumento.Text.Trim Then + If Not ObjGral.AddHistorialBitacora(Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, CveIE, TxtFechaDocumento.Text.Trim, FechaOld, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0, "Fecha", "Banco", TxtFolio.Text + " / " + Cuenta) Then + OcurrioError = True + End If + End If + If FolioOld <> TxtFolio.Text.Trim Then + If Not ObjGral.AddHistorialBitacora(Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, CveIE, TxtFolio.Text.Trim, FolioOld, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0, "Número", "Banco", TxtFolio.Text + " / " + Cuenta) Then + OcurrioError = True + End If + End If + Else + OcurrioError = True + End If + + If OcurrioError Then + IE.RollBack() + ObjGral.RollBack() + Else + IE.Commit() + ObjGral.Commit() + Alert("La Actualización del documento se realizó correctamente", TipoMensaje.MsgInformacion, $"document.location.href=""IE.aspx?CveIE={CveIE}""") + End If IE.Dispose() - - - + ObjGral.Dispose() End Sub Protected Sub ImgUpdateCuentaDeposito_Click(sender As Object, e As ImageClickEventArgs)