Commit inicial Ventas Productivo
This commit is contained in:
109
Sistemas/SessionesActivas.aspx.vb
Normal file
109
Sistemas/SessionesActivas.aspx.vb
Normal file
@@ -0,0 +1,109 @@
|
||||
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class SessionesActivas
|
||||
Inherits System.Web.UI.Page
|
||||
|
||||
|
||||
Private Property RCveUsuario As String
|
||||
Get
|
||||
Return ViewState("RCveUsuario").ToString
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("RCveUsuario") = value
|
||||
End Set
|
||||
End Property
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
|
||||
Dim listacve As New List(Of String)
|
||||
listacve.Add("1815")
|
||||
Notificaciones.AlertaVentana("notificacion", listacve, timeoutseconds:=0)
|
||||
|
||||
RCveUsuario = "0"
|
||||
ClsSisNotificaciones.SendNotificacionERP(100, "Titulo", "Hola Mundo", 1)
|
||||
CargaDatos("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos(filtros As String)
|
||||
Dim objUsuarios As New ClsSisUsuarios
|
||||
objUsuarios.GetUsuarios(-1, -1, -1)
|
||||
Dim dtU As DataTable = objUsuarios.DtResultados
|
||||
dtU.Columns.Add("FechaSLogin", System.Type.GetType("System.DateTime"))
|
||||
dtU.Columns.Add("RemoteIpAddres", System.Type.GetType("System.String"))
|
||||
Dim dtF As DataTable = dtU.Clone
|
||||
Dim objlist As List(Of ADSSession.ADSSessionObj) = ADSSession.ADSSessionConfig.SessionManager(ADSSession.OpcionSession.getListasession)
|
||||
|
||||
For Each user As ADSSession.ADSSessionObj In objlist
|
||||
Dim row As DataRow = dtU.FiltroPrimero($"CveUsuario={user.CveUsuario} AND CveEmpresa={user.CveEmpresa}")
|
||||
If Not IsNothing(row) Then
|
||||
row("FechaSLogin") = user.FechaLogin
|
||||
row("RemoteIpAddres") = user.IpAddres
|
||||
dtF.Rows.Add(row.ItemArray())
|
||||
End If
|
||||
Next
|
||||
dtU.Dispose()
|
||||
Dim GroupBy1 As String() = {"CveEmpresa", "Empresa"}
|
||||
DdlEmpresa.DataSource = dtF.FiltraParametros("", "", {"CveEmpresa", "Empresa"})
|
||||
DdlEmpresa.DataBind()
|
||||
dtF = dtF.GroupByDT(filtros, "", {GroupBy1}, Nothing, Nothing,)
|
||||
GVDatos.DataSource = dtF
|
||||
GVDatos.DataBind()
|
||||
objUsuarios.Dispose()
|
||||
End Sub
|
||||
Protected Sub GVDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
Dim CveUsuario As Integer = e.Row.DataKey("CveUsuario").ToEntero()
|
||||
If CveUsuario > 0 Then
|
||||
Else
|
||||
e.Row.Cells(0).Visible = False
|
||||
e.Row.Cells(1).Visible = False
|
||||
e.Row.Cells(3).Visible = False
|
||||
e.Row.Cells(2).Attributes.Add("colspan", "4")
|
||||
e.Row.CssClass = "Titulos"
|
||||
e.Row.FCLinkButton("LnkEnviarMensaje").Visible = False
|
||||
End If
|
||||
' Dim info As ADSSession.GlobalSessionInfo = ADSSession.MySessionInfo.GlobalSessions.FirstOrDefault(Function(M) M.CveUsuario = e.Row.DataKey("CveUsuario").ToEntero() AndAlso M.CveEmpresa = e.Row.DataKey("CveEmpresa").ToEntero())
|
||||
' If IsNothing(info) Then
|
||||
' e.Row.Visible = False
|
||||
|
||||
' End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkFiltrar_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim filtrosbuilder As New StringBuilder
|
||||
Dim Prefix As String = ""
|
||||
Dim idEmpresas As String = DdlEmpresa.GetSelectedValues("'", "'")
|
||||
If idEmpresas.Length > 0 Then
|
||||
filtrosbuilder.Append(String.Format("{1} CveEmpresa IN({0})", idEmpresas, Prefix))
|
||||
Prefix = " AND "
|
||||
End If
|
||||
CargaDatos(filtrosbuilder.ToString())
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
Protected Sub LnkQuitar_Click(sender As Object, e As EventArgs)
|
||||
'Dim gvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
'ADSSession.MySessionInfo.GlobalSessions.RemoveAll(Function(M) M.CveUsuario = gvRow.DataKey("CveUsuario").ToEntero())
|
||||
'CargaDatos()
|
||||
End Sub
|
||||
Protected Sub LnkEnviarMensaje_Click(sender As Object, e As EventArgs)
|
||||
Dim gvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
RCveUsuario = gvRow.DataKey("CveUsuario")
|
||||
RegistraScript("$(""#DivMensaje"").modal();")
|
||||
End Sub
|
||||
Protected Sub LnkEnviar_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim lista As New List(Of String)
|
||||
lista.Add(RCveUsuario)
|
||||
'Notificaciones.AlertaVentana(TxtMensaje.Text, lista)
|
||||
Notificaciones.AlertaVentana(TxtMensaje.Text, lista, timeoutseconds:=0)
|
||||
RegistraScript($"$(""#DivMensaje"").modal('hide');console.log('{Decripta(Context.User.Identity.Name)}')")
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user