--FIX.Validaciones en notificaciones

This commit is contained in:
2024-05-27 18:43:19 -07:00
parent cae653e844
commit 0542461e25
3 changed files with 8 additions and 3 deletions

View File

@@ -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

View File

@@ -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" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>

View File

@@ -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() + "<br/> <a target='_blank' href='https://www.w3schools.com'>Liga</a>"
ClsSisNotificaciones.EnviarAlerta("Aviso", mensaje, RCveUsuario, Tipo:=TipoNotificacion.ToastInformacionB)
RegistraScript($"$(""#DivMensaje"").modal('hide');console.log('{Decripta(Context.User.Identity.Name)}')")
End Sub