From 0542461e25e0f86f88751234533ed87fcb810281 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Mon, 27 May 2024 18:43:19 -0700 Subject: [PATCH] --FIX.Validaciones en notificaciones --- App_Code/ClsSisNotificaciones.vb | 5 ++++- Sistemas/SessionesActivas.aspx | 2 +- Sistemas/SessionesActivas.aspx.vb | 4 +++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/App_Code/ClsSisNotificaciones.vb b/App_Code/ClsSisNotificaciones.vb index 3ef308c1f..91485aa7d 100644 --- a/App_Code/ClsSisNotificaciones.vb +++ b/App_Code/ClsSisNotificaciones.vb @@ -152,7 +152,10 @@ Public Class ClsSisNotificaciones #Region "N O T I F I C A C I O N E S" Public Shared Sub EnviarAlerta(Titulo As String, Mensaje As String, CveUsuario As String, Optional Tipo As TipoNotificacion = TipoNotificacion.AlertaVentanaNoOcultar, Optional TimeOut As Integer = 0) Dim hub = GlobalHost.ConnectionManager.GetHubContext(Of Notificaciones)() - hub.Clients.Client(Notificaciones.UsuariosConexiones(CveUsuario)).alertaVentana(Titulo, Mensaje, DirectCast(Tipo, Integer), TimeOut) + 'VERIFICA SI EXISTE LA CONEXION DEL USUARIO + If Notificaciones.UsuariosConexiones.Keys.Any(Function(key) key = CveUsuario) Then + hub.Clients.Client(Notificaciones.UsuariosConexiones(CveUsuario)).alertaVentana(Titulo, Mensaje, DirectCast(Tipo, Integer), TimeOut) + End If End Sub diff --git a/Sistemas/SessionesActivas.aspx b/Sistemas/SessionesActivas.aspx index a61a989a3..312a880fb 100644 --- a/Sistemas/SessionesActivas.aspx +++ b/Sistemas/SessionesActivas.aspx @@ -1,4 +1,4 @@ -<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="SessionesActivas.aspx.vb" Inherits="SessionesActivas" %> +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="SessionesActivas.aspx.vb" Inherits="SessionesActivas" EnableEventValidation="false" %> diff --git a/Sistemas/SessionesActivas.aspx.vb b/Sistemas/SessionesActivas.aspx.vb index 65f8bb5f8..8e1823580 100644 --- a/Sistemas/SessionesActivas.aspx.vb +++ b/Sistemas/SessionesActivas.aspx.vb @@ -190,7 +190,9 @@ Partial Class SessionesActivas RegistraScript("$(""#DivMensaje"").modal();") End Sub Protected Sub LnkEnviar_Click(sender As Object, e As EventArgs) - ClsSisNotificaciones.EnviarAlerta("Aviso", TxtMensaje.Text.Trim(), RCveUsuario, Tipo:=TipoNotificacion.ToastInformacionB) + + Dim mensaje = TxtMensaje.Text.Trim() + "
Liga" + ClsSisNotificaciones.EnviarAlerta("Aviso", mensaje, RCveUsuario, Tipo:=TipoNotificacion.ToastInformacionB) RegistraScript($"$(""#DivMensaje"").modal('hide');console.log('{Decripta(Context.User.Identity.Name)}')") End Sub