From ac1235240d0f3bb14cf7f8fe3453f9dc95584f8a Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Tue, 16 Jun 2020 11:47:41 -0700 Subject: [PATCH] Pago Electronico Grupos --- Bancos/IE.aspx.vb | 6 +- Bancos/PagoElectronicoGrupos.aspx.vb | 130 ++++++++++++++++++--------- 2 files changed, 92 insertions(+), 44 deletions(-) diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index c8a70dd0d..9dea8b176 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -4642,7 +4642,7 @@ Partial Class Bancos_IE Dim Dep As New ClsGenerales If Dep.GetCuentasDepositos(CveProveedor:=CveProveedor, CveCliente:=CveCliente, CvePersonal:=CvePersonal) Then - If DdlTipoTransaccion.SelectedValue = "9" Then + If DdlTipoTransaccion.SelectedValue = "9" And CveIE = Nothing Then DdlCuentaDeposito.DataSource = Dep.DtResultados.FiltraParametros("EstatusPagoElectronico = 'True' AND Estatus ='True'") @@ -4653,7 +4653,7 @@ Partial Class Bancos_IE Alert("El Beneficiario no tiene una cuenta activa en BBVA, dela de alta o seleccione otro método de pago", TipoMensaje.MsgAdvertencia) End If - ElseIf DdlTipoTransaccion.SelectedValue = "17" Then + ElseIf DdlTipoTransaccion.SelectedValue = "17" And CveIE = Nothing Then If Dep.DtResultados.Rows.Count > 0 Then @@ -4685,7 +4685,7 @@ Partial Class Bancos_IE Else - If DdlTipoTransaccion.SelectedValue.Contiene("9", "17") Then + If DdlTipoTransaccion.SelectedValue.Contiene("9", "17") And CveIE = Nothing Then BtnGuardar.Enabled = False Alert("El proveedor no tiene cuentas deposito.", TipoMensaje.MsgAdvertencia) diff --git a/Bancos/PagoElectronicoGrupos.aspx.vb b/Bancos/PagoElectronicoGrupos.aspx.vb index 61f4e36a0..8b8bbf24e 100644 --- a/Bancos/PagoElectronicoGrupos.aspx.vb +++ b/Bancos/PagoElectronicoGrupos.aspx.vb @@ -216,6 +216,62 @@ Partial Class Bancos_PagoElectronicoGrupos End Property + Property CveIEPagoActual As Integer + Get + If ViewState("CveIEPagoActual") Is Nothing Then + Return -1 + Else + Return ViewState("CveIEPagoActual").ToString.ToEntero + End If + End Get + Set(value As Integer) + ViewState("CveIEPagoActual") = value + End Set + End Property + + Property CveLayoutEnvioDetalleActual As Integer + Get + If ViewState("CveLayoutEnvioDetalleActual") Is Nothing Then + Return -1 + Else + Return ViewState("CveLayoutEnvioDetalleActual").ToString.ToEntero + End If + End Get + Set(value As Integer) + ViewState("CveLayoutEnvioDetalleActual") = value + End Set + End Property + + Property GvIndexActual As Integer + Get + If ViewState("GvIndexActual") Is Nothing Then + Return -1 + Else + Return ViewState("GvIndexActual").ToString.ToEntero + End If + End Get + Set(value As Integer) + ViewState("GvIndexActual") = value + End Set + + End Property + + + Property DTFoliosPrefijos As DataTable + Get + If ViewState("DTFoliosPrefijos") Is Nothing Then + Return Crate_DTFoliosPrefijos() + Else + Return DirectCast(ViewState("DTFoliosPrefijos"), DataTable) + End If + End Get + Set(value As DataTable) + ViewState("DTFoliosPrefijos") = value + End Set + + End Property + + #End Region Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load @@ -244,6 +300,18 @@ Partial Class Bancos_PagoElectronicoGrupos End Sub + Private Function Crate_DTFoliosPrefijos() As DataTable + + Dim DTFolios As New DataTable + DTFolios.Columns.Add("CveIE", GetType(Integer)) + DTFolios.Columns.Add("Folio", GetType(String)) + DTFolios.AcceptChanges() + + Return DTFolios + + End Function + + #Region " C A R G A - D A T O S " Private Sub CargaCuentas() DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros("UsaLayoutGrupos = 1") @@ -2626,44 +2694,6 @@ Partial Class Bancos_PagoElectronicoGrupos End Sub - Property CveIEPagoActual As Integer - Get - If ViewState("CveIEPagoActual") Is Nothing Then - Return -1 - Else - Return ViewState("CveIEPagoActual").ToString.ToEntero - End If - End Get - Set(value As Integer) - ViewState("CveIEPagoActual") = value - End Set - End Property - - Property CveLayoutEnvioDetalleActual As Integer - Get - If ViewState("CveLayoutEnvioDetalleActual") Is Nothing Then - Return -1 - Else - Return ViewState("CveLayoutEnvioDetalleActual").ToString.ToEntero - End If - End Get - Set(value As Integer) - ViewState("CveLayoutEnvioDetalleActual") = value - End Set - End Property - - Property GvIndexActual As Integer - Get - If ViewState("GvIndexActual") Is Nothing Then - Return -1 - Else - Return ViewState("GvIndexActual").ToString.ToEntero - End If - End Get - Set(value As Integer) - ViewState("GvIndexActual") = value - End Set - End Property @@ -2770,9 +2800,24 @@ Partial Class Bancos_PagoElectronicoGrupos If Not ObjBanco.UpdateLayoutEnviosDetalle(CveLayoutEnvioDetalle, CveLayoutEnvio, CveIE, CveProveedor, 2, "", True) Then ErrorProceso = True + + End If + DTFoliosPrefijos.Clear() + For Each RowGV As GridViewRow In GvEnviadas.Rows + + Dim nRow As DataRow = DTFoliosPrefijos.NewRow + + nRow("CveIE") = RowGV.DataKey("CveIE").ToEntero + nRow("Folio") = RowGV.FCTextBox("TxtFolio").Text.Trim + + DTFoliosPrefijos.Rows.Add(nRow) + + Next + DTFoliosPrefijos.AcceptChanges() + If NuevoFolio <> "-1" Or Comprobante <> "-1" And Not ErrorProceso Then If Not ObjBanco.UpdateBancos_IEFolio(CveIE, NuevoFolio, Comprobante) Then ErrorProceso = True @@ -2797,11 +2842,9 @@ Partial Class Bancos_PagoElectronicoGrupos ErrorProceso = True Alert("Error al guardar comprobante.", TipoMensaje.MsgError) End Try - End If - If ErrorProceso Then ObjBanco.RollBack() Else @@ -2811,8 +2854,13 @@ Partial Class Bancos_PagoElectronicoGrupos CargaEnviados() - End If + For Each RowGV As GridViewRow In GvEnviadas.Rows + RowGV.FCTextBox("TxtFolio").Text = DTFoliosPrefijos.FiltroPrimeroValor("Folio", $"CveIE = {RowGV.DataKey("CveIE").ToEntero}") + Next + UpEnviados.Update() + + End If ObjBanco.Dispose()