--FIX ejecucion multiple de eventos

This commit is contained in:
JPerez
2025-07-16 14:36:55 -07:00
parent 543d7a4c70
commit 8f79b5ab83
2 changed files with 586 additions and 835 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -16,7 +16,7 @@ Partial Class Compras_Proveedores
#Region "P R O P I E D A D E S"
Private ReadOnly Property CveProveedor As Integer
Get
Return ViewState("CveProveedor").ToString.ToEntero
Return IfNull(ViewState("CveProveedor"), -1).ToString.ToEntero()
End Get
End Property
Public ReadOnly Property ProveedorID As Integer
@@ -606,8 +606,6 @@ Partial Class Compras_Proveedores
If UsuarioActual.TienePermisoProceso(88) Then BtnGuardar.Visible = True 'agregar/Nuevo proveedor
ScriptManager.RegisterStartupScript(Me, Me.GetType, "Ll", "pageLoad();", True)
If UsuarioActual.Empresa.CvePlataforma = 2 Then
DivFiscal.Visible = False
'divportalusuarios.Visible = False
@@ -5932,9 +5930,19 @@ Partial Class Compras_Proveedores
End Sub
Protected Sub BtnCargaHistorial_Click(sender As Object, e As EventArgs) Handles BtnCargaHistorial.Click
If ViewState("YaEjecutadoHistorial") IsNot Nothing AndAlso CBool(ViewState("YaEjecutadoHistorial")) Then
' Ya se ejecutó, evita doble acción
Exit Sub
End If
' Marca que ya se ejecutó
ViewState("YaEjecutadoHistorial") = True
If CveProveedor > 0 Then
CargaHistorial(CveProveedorSucursal) ' <-- Tu método de carga
UpnHistorial.Update() ' <-- UpdatePanel de Historial
UpBtnsTab.Update()
End If
End Sub