This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2020-03-18 13:22:49 -07:00
parent b7256ba33b
commit 8d3f61263b
6 changed files with 57 additions and 4 deletions

View File

@@ -3421,7 +3421,11 @@ Public Class ClsPaginas
pages.Add("/Compras/PopUpVerFactura.aspx") pages.Add("/Compras/PopUpVerFactura.aspx")
Return pages Return pages
End Function End Function
Dim sw As Diagnostics.Stopwatch
Protected Overridable Sub Page_PreInit(sender As Object, e As EventArgs) Handles Me.PreInit Protected Overridable Sub Page_PreInit(sender As Object, e As EventArgs) Handles Me.PreInit
sw = New Diagnostics.Stopwatch
sw.Start()
If Not User.Identity.IsAuthenticated OrElse UsuarioActual Is Nothing Then If Not User.Identity.IsAuthenticated OrElse UsuarioActual Is Nothing Then
Dim AuthorizeRequest As Boolean = False Dim AuthorizeRequest As Boolean = False
Dim HuboError = False Dim HuboError = False
@@ -4922,6 +4926,13 @@ Public Class ClsPaginas
End If End If
End Sub End Sub
Protected Overridable Sub Page_PreRender(sender As Object, e As EventArgs) Handles Me.PreRender Protected Overridable Sub Page_PreRender(sender As Object, e As EventArgs) Handles Me.PreRender
If sw IsNot Nothing AndAlso Not (Not User.Identity.IsAuthenticated OrElse UsuarioActual Is Nothing) Then
sw.Stop()
Using ObjUsuario As New ClsSisUsuarios
ObjUsuario.AddBitacora(CveModulo, "", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Request.Url.ToString(), sw.ElapsedMilliseconds)
End Using
End If
If Not IsNothing(ViewState("strToastMsglargonoreplace")) AndAlso ViewState("strToastMsglargonoreplace").ToString.Length > 0 Then If Not IsNothing(ViewState("strToastMsglargonoreplace")) AndAlso ViewState("strToastMsglargonoreplace").ToString.Length > 0 Then
RegistraScript(ViewState("strToastMsglargonoreplace").ToString(), "esteseraunticklargoparaquenosesobrescribaconotro") RegistraScript(ViewState("strToastMsglargonoreplace").ToString(), "esteseraunticklargoparaquenosesobrescribaconotro")
ViewState("strToastMsglargonoreplace") = Nothing ViewState("strToastMsglargonoreplace") = Nothing

View File

@@ -891,7 +891,7 @@ Public Class ClsSisUsuarios
Return Retorno Return Retorno
End Function End Function
Public Function AddBitacora(CveModulo As Integer, Accion As String, Resultado As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean Public Function AddBitacora(CveModulo As Integer, Accion As String, Resultado As String, CveUsuario As Integer, CveEmpresa As Integer, Optional URL As String = "-1", Optional TiempodeEjecucion As Long = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Sis_UsuariosBitacoraAdd") DataAdapter("PA_Sis_UsuariosBitacoraAdd")
@@ -901,6 +901,8 @@ Public Class ClsSisUsuarios
.Add("@Resultado", SqlDbType.VarChar).Value = Resultado .Add("@Resultado", SqlDbType.VarChar).Value = Resultado
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@URL", SqlDbType.VarChar).Value = URL
.Add("@TiempodeEjecucion", SqlDbType.BigInt).Value = TiempodeEjecucion
End With End With
Try Try

View File

@@ -17,6 +17,7 @@ Public Class LogicNominas
Dim sw As Diagnostics.Stopwatch = Nothing Dim sw As Diagnostics.Stopwatch = Nothing
If guardarLogTimbrado Then If guardarLogTimbrado Then
sw = New Diagnostics.Stopwatch sw = New Diagnostics.Stopwatch
sw.Start() sw.Start()
End If End If
Dim cfdi As CFDITimbre = PreTimbrar(CveNomina, UsuarioActual) 'CvePersonal, CvePeriodo, Dim cfdi As CFDITimbre = PreTimbrar(CveNomina, UsuarioActual) 'CvePersonal, CvePeriodo,

View File

@@ -82,7 +82,7 @@
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Post"> <asp:TemplateField HeaderText="Post">
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LtlPost" runat="server" Text='<%# Eval("LastPostback", "{0:dd/MM/yyyy HH:mm}")%>'></asp:Literal> <asp:Literal ID="LtlPost" runat="server" Text='<%# Eval("LastPostback")%>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField> <asp:TemplateField>

View File

@@ -14,9 +14,46 @@ Partial Class SessionesActivas
ViewState("RCveUsuario") = value ViewState("RCveUsuario") = value
End Set End Set
End Property End Property
ReadOnly Property UsuarioActual() As Usuario
Get
Try
'UsuarioActual = DirectCast(Session("UsuarioSIG"), Usuario)
UsuarioActual = CType(Context.Session("UsuarioSIG"), Usuario)
Catch ex As Exception
Usuario.CerrarSession()
Return Nothing
End Try
End Get
End Property
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then If Not IsPostBack Then
If Not User.Identity.IsAuthenticated OrElse UsuarioActual Is Nothing Then
Dim AuthorizeRequest As Boolean = False
Dim HuboError = False
Dim statusCode = 401
AuthorizeRequest = False
Response.StatusCode = statusCode
If Not AuthorizeRequest Then
Usuario.CerrarSession()
Response.End()
End If
End If
If UsuarioActual.CveRol <> 1 Then
Dim AuthorizeRequest As Boolean = False
Dim HuboError = False
Dim statusCode = 401
AuthorizeRequest = False
Response.StatusCode = statusCode
If Not AuthorizeRequest Then
Usuario.CerrarSession()
Response.End()
End If
End If
' Dim listacve As New List(Of String) ' Dim listacve As New List(Of String)
' listacve.Add("1815") ' listacve.Add("1815")
' Notificaciones.AlertaVentana("notificacion", listacve, timeoutseconds:=0) ' Notificaciones.AlertaVentana("notificacion", listacve, timeoutseconds:=0)

View File

@@ -26,6 +26,8 @@