diff --git a/App_Code/Notificaciones.vb b/App_Code/Notificaciones.vb index e6c5a9ab4..a0e44a996 100644 --- a/App_Code/Notificaciones.vb +++ b/App_Code/Notificaciones.vb @@ -1,75 +1,75 @@ -Option Strict Off -Imports System.Collections.Concurrent -Imports Extensiones -Imports Microsoft.AspNet.SignalR - -Public Enum TipoNotificacion As Integer - - ToastInformacion = 5 'succes - ToastInformacionB = 6 'info - ToastError = 7 'error - ToastAdventencia = 8 'Warning - - AlertaVentana = 2 - AlertaVentanaNoOcultar = 1 -End Enum -Public Class Notificaciones +Option Strict Off +Imports System.Collections.Concurrent +Imports Extensiones +Imports Microsoft.AspNet.SignalR + +Public Enum TipoNotificacion As Integer + + ToastInformacion = 5 'succes + ToastInformacionB = 6 'info + ToastError = 7 'error + ToastAdventencia = 8 'Warning + + AlertaVentana = 2 + AlertaVentanaNoOcultar = 1 +End Enum +Public Class Notificaciones Inherits Hub - Public Shared UsuariosConexiones As ConcurrentDictionary(Of String, String) = New ConcurrentDictionary(Of String, String) - + Public Shared UsuariosConexiones As ConcurrentDictionary(Of String, String) = New ConcurrentDictionary(Of String, String) + Public Overrides Function OnConnected() As System.Threading.Tasks.Task - NotificarConexion() - Return MyBase.OnConnected() - End Function - - Public Overrides Function OnReconnected() As System.Threading.Tasks.Task - NotificarConexion() - Return MyBase.OnReconnected() - End Function - Public Overrides Function OnDisconnected(stopCalled As Boolean) As Threading.Tasks.Task - Return MyBase.OnDisconnected(stopCalled) + NotificarConexion() + Return MyBase.OnConnected() End Function - Public Sub NotificarConexion() - If Context.User.Identity.IsAuthenticated Then - Dim ConnectionId As String = Context.ConnectionId - Dim CveUsuario As String = Context.User.Identity.Name - If UsuariosConexiones.ContainsKey(CveUsuario) Then - If UsuariosConexiones(CveUsuario) <> Context.ConnectionId Then - UsuariosConexiones.TryUpdate(CveUsuario, Context.ConnectionId, UsuariosConexiones(CveUsuario)) - End If - Else - If CveUsuario.ToEntero > 0 Then - UsuariosConexiones.TryAdd(CveUsuario, ConnectionId) - End If - End If - End If + Public Overrides Function OnReconnected() As System.Threading.Tasks.Task + NotificarConexion() + Return MyBase.OnReconnected() + End Function + Public Overrides Function OnDisconnected(stopCalled As Boolean) As Threading.Tasks.Task + Return MyBase.OnDisconnected(stopCalled) + End Function + + Public Sub NotificarConexion() + If Context.User.Identity.IsAuthenticated Then + Dim ConnectionId As String = Context.ConnectionId + Dim CveUsuario As String = Context.User.Identity.Name + If UsuariosConexiones.ContainsKey(CveUsuario) Then + If UsuariosConexiones(CveUsuario) <> Context.ConnectionId Then + UsuariosConexiones.TryUpdate(CveUsuario, Context.ConnectionId, UsuariosConexiones(CveUsuario)) + End If + Else + If CveUsuario.ToEntero > 0 Then + UsuariosConexiones.TryAdd(CveUsuario, ConnectionId) + End If + End If + End If End Sub - Public Sub TestMessage(message As String) - Clients.All.testMessage(message) - End Sub - - Public Sub AlertaVentana(Message As String, Para As String, Optional Titulo As String = "", Optional timeoutseconds As Integer = 5, Optional Tipo As TipoNotificacion = TipoNotificacion.AlertaVentanaNoOcultar) - Dim lPara As New List(Of String) - lPara.Add(Para) - AlertaVentana(Message, lPara, Titulo, timeoutseconds, Tipo) - End Sub - Public Sub AlertaVentana(Message As String, Para As List(Of String), Optional Titulo As String = "", Optional timeoutseconds As Integer = 5, Optional Tipo As TipoNotificacion = TipoNotificacion.AlertaVentanaNoOcultar) - If (Para IsNot Nothing) AndAlso Para.Count > 0 Then - Dim Clients As Hubs.IHubConnectionContext(Of Object) = GlobalHost.ConnectionManager.GetHubContext(Of Notificaciones)().Clients - Clients.Users(Para).AlertaVentana(Titulo, Message, DirectCast(Tipo, Integer), timeoutseconds) - End If - End Sub - -End Class -Public Class MyhubUserIdProvider - Implements IUserIdProvider - - - Private Function IUserIdProvider_GetUserId(request As IRequest) As String Implements IUserIdProvider.GetUserId - Dim userId = Decripta(request.User.Identity.Name) 'MyCustomUserClass.FindUserId(request.User.Identity.Name) - Return userId.ToString() - End Function -End Class + Public Sub TestMessage(message As String) + Clients.All.testMessage(message) + End Sub + + Public Sub AlertaVentana(Message As String, Para As String, Optional Titulo As String = "", Optional timeoutseconds As Integer = 5, Optional Tipo As TipoNotificacion = TipoNotificacion.AlertaVentanaNoOcultar) + Dim lPara As New List(Of String) + lPara.Add(Para) + AlertaVentana(Message, lPara, Titulo, timeoutseconds, Tipo) + End Sub + Public Sub AlertaVentana(Message As String, Para As List(Of String), Optional Titulo As String = "", Optional timeoutseconds As Integer = 5, Optional Tipo As TipoNotificacion = TipoNotificacion.AlertaVentanaNoOcultar) + If (Para IsNot Nothing) AndAlso Para.Count > 0 Then + Dim Clients As Hubs.IHubConnectionContext(Of Object) = GlobalHost.ConnectionManager.GetHubContext(Of Notificaciones)().Clients + Clients.Users(Para).AlertaVentana(Titulo, Message, DirectCast(Tipo, Integer), timeoutseconds) + End If + End Sub + +End Class +Public Class MyhubUserIdProvider + Implements IUserIdProvider + + + Private Function IUserIdProvider_GetUserId(request As IRequest) As String Implements IUserIdProvider.GetUserId + Dim userId = Decripta(request.User.Identity.Name) 'MyCustomUserClass.FindUserId(request.User.Identity.Name) + Return userId.ToString() + End Function +End Class diff --git a/Bancos/DepositosCaja.aspx.vb b/Bancos/DepositosCaja.aspx.vb index 805486a15..2f1a1fdcd 100644 --- a/Bancos/DepositosCaja.aspx.vb +++ b/Bancos/DepositosCaja.aspx.vb @@ -289,8 +289,13 @@ Partial Class Bancos_DepositosCaja End If End If + Dim CveTransaccionBanco As Integer = DdlTipoDeposito.SelectedValue.ToEntero + If CveTransaccionBanco = -1 Then + CveTransaccionBanco = 13 + End If + If TotalImporte < 0 Then 'que es una devolución, entonces como es negativo, se cambia el concetpo de bancos, por condición de trigger CveTransaccionBanco = 6 End If diff --git a/Bancos/RepCortes.aspx b/Bancos/RepCortes.aspx index 9f9830a38..65f77f716 100644 --- a/Bancos/RepCortes.aspx +++ b/Bancos/RepCortes.aspx @@ -364,7 +364,7 @@