last postaback en usuarios
This commit is contained in:
@@ -3502,7 +3502,9 @@ Public Class ClsPaginas
|
||||
End If
|
||||
If UsuarioActual.CveEmpresa = 42 Then
|
||||
Me.MasterPageFile = "~/Masters/Site42.master"
|
||||
End If
|
||||
End If
|
||||
|
||||
ADSSession.ADSSessionConfig.SessionManager(ADSSession.OpcionSession.CambiarModulo, Nothing, -1, "", Request.Url.ToString())
|
||||
'If Me.Request.ServerVariables("http_user_agent").ToLower.Contains("safari") AndAlso Page.ClientTarget <> "uplevel" Then Page.ClientTarget = "uplevel" 'Código agregado para que muestre bién el menu, en chrome
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -115,6 +115,7 @@ Namespace ADSSession
|
||||
getListasession = 3 'solo lectura
|
||||
CambiarEmpresa = 4
|
||||
getSession = 5
|
||||
CambiarModulo = 6
|
||||
End Enum
|
||||
Public Enum OpcionHub As Integer
|
||||
agregar = 1
|
||||
@@ -158,7 +159,7 @@ Namespace ADSSession
|
||||
HttpContext.Current.Session(strsessionDpage) = value
|
||||
End Set
|
||||
End Property
|
||||
Public Shared Function SessionManager(opcion As OpcionSession, Optional obj As ADSSessionObj = Nothing, Optional CveEmpresa As Integer = -1, Optional SessionID As String = Nothing) As Object
|
||||
Public Shared Function SessionManager(opcion As OpcionSession, Optional obj As ADSSessionObj = Nothing, Optional CveEmpresa As Integer = -1, Optional SessionID As String = Nothing, Optional modulo As String = "") As Object
|
||||
SyncLock strsessionid 'todo el codigo que este dentro de este corchete no se ejecutara mas de una vez al mismo tiempo en el servidor
|
||||
If _dicSessionobj Is Nothing Then
|
||||
_dicSessionobj = New ConcurrentDictionary(Of String, ADSSessionObj)
|
||||
@@ -194,6 +195,18 @@ Namespace ADSSession
|
||||
obj.CveEmpresa = CveEmpresa
|
||||
End If
|
||||
retorno = obj
|
||||
|
||||
Case OpcionSession.CambiarModulo
|
||||
If Not IsNothing(HttpContext.Current) AndAlso Not IsNothing(HttpContext.Current.Session) AndAlso Not IsNothing(HttpContext.Current.Session(strsessionid)) Then
|
||||
obj = DirectCast(HttpContext.Current.Session(strsessionid), ADSSessionObj)
|
||||
obj.Modulo = modulo
|
||||
obj.LastPostback = DateTime.Now
|
||||
If _dicSessionobj.TryGetValue(obj.SessionID, obj) Then
|
||||
obj.Modulo = modulo
|
||||
obj.LastPostback = DateTime.Now
|
||||
End If
|
||||
retorno = obj
|
||||
End If
|
||||
End Select
|
||||
Catch ex As Exception
|
||||
retorno = Nothing
|
||||
@@ -227,6 +240,8 @@ Namespace ADSSession
|
||||
End Sub
|
||||
Public Property CveUsuario As Integer
|
||||
Public Property CveEmpresa As Integer
|
||||
Public Property Modulo As String
|
||||
Public Property LastPostback As DateTime
|
||||
Protected Property _SessionID As String
|
||||
Private Property _ipAdrres As String
|
||||
Public ReadOnly Property IpAddres As String
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Fecha Login">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("FechaSLogin")%>'></asp:Literal>
|
||||
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("FechaSLogin", "{0:dd/MM/yyyy HH:mm}")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="IP">
|
||||
@@ -75,6 +75,16 @@
|
||||
<asp:Literal ID="LtlRemoteIpAddres" runat="server" Text='<%# Eval("RemoteIpAddres")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Modulo">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlModulo" runat="server" Text='<%# Eval("Modulo")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Post">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlPost" runat="server" Text='<%# Eval("LastPostback", "{0:dd/MM/yyyy HH:mm}")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="LnkEnviarMensaje" OnClick="LnkEnviarMensaje_Click" CssClass="btn btn-circle btn-sm blue" runat="server" Text="<i class='fa fa-comments-o'></i>"></asp:LinkButton>
|
||||
|
||||
@@ -33,6 +33,8 @@ Partial Class SessionesActivas
|
||||
Dim dtU As DataTable = objUsuarios.DtResultados
|
||||
dtU.Columns.Add("FechaSLogin", System.Type.GetType("System.DateTime"))
|
||||
dtU.Columns.Add("RemoteIpAddres", System.Type.GetType("System.String"))
|
||||
dtU.Columns.Add("LastPostback", System.Type.GetType("System.DateTime"))
|
||||
dtU.Columns.Add("Modulo", System.Type.GetType("System.String"))
|
||||
Dim dtF As DataTable = dtU.Clone
|
||||
Dim objlist As List(Of ADSSession.ADSSessionObj) = ADSSession.ADSSessionConfig.SessionManager(ADSSession.OpcionSession.getListasession)
|
||||
|
||||
@@ -41,6 +43,8 @@ Partial Class SessionesActivas
|
||||
If Not IsNothing(row) Then
|
||||
row("FechaSLogin") = user.FechaLogin
|
||||
row("RemoteIpAddres") = user.IpAddres
|
||||
row("LastPostback") = user.LastPostback
|
||||
row("Modulo") = user.Modulo
|
||||
dtF.Rows.Add(row.ItemArray())
|
||||
End If
|
||||
Next
|
||||
|
||||
Reference in New Issue
Block a user