diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx
index 40122ad0c..3381c0922 100644
--- a/Ventas/Ventas.aspx
+++ b/Ventas/Ventas.aspx
@@ -970,6 +970,13 @@
+
+
+
+
+
@@ -8676,7 +8683,41 @@
+
+
+
+
+
+
+
+
+
+ |
+ |
+
+
+ | |
+ |
+
+
+ |
+
+ |
+
+
+
+ |
+
+
+ |
+ |
+
+
+
+
+
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb
index 4a634eae8..194f5f454 100644
--- a/Ventas/Ventas.aspx.vb
+++ b/Ventas/Ventas.aspx.vb
@@ -2485,7 +2485,7 @@ Partial Class Ventas
TxtFechaFRem.Text = NowADS().ToShortDateString
TxtFechaFPedido.Text = NowADS().ToShortDateString
TxtFechaFOC.Text = NowADS().ToShortDateString
-
+ ValidaUsuarioAcceso()
TrSinExistencia.Visible = UsuarioActual.TienePermisoProceso(276)
@@ -3528,7 +3528,135 @@ Partial Class Ventas
End Sub
+#Region "Bloqueo Pantalla"
+ Private Sub ValidaUsuarioAcceso()
+ 'VERIFICAR SI LA SESION SE ENCUENTRA BLOQUEADA
+ If UsuarioActual.Empresa.Funcionalidad(599) = "1" Then
+ Dim DrUsuario As DataRow = GlobalDTUsuarios(CveUsuario:=UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).Rows(0)
+ If DrUsuario("CodigoAcceso").ToString() <> "" Then
+ If UsuarioActual.SesionBloqueada Then
+ DivBloqueoacceso.Visible = False
+ Dim strScript As New StringBuilder
+ strScript.Append("window.onload = function MuestraBloqueo() { document.getElementById(""C_BtnShowBloqueoAcceso"").click(); setTimeout(function(){ $('#C_TxtCodigoAcceso').focus(); ")
+ If UsuarioActual.ErrorDesbloqueo Then
+ LtlMensajeBloqueo.Text = UsuarioActual.MsgErrorDesbloqueo
+ 'strScript.AppendFormat("alert('{0}');", UsuarioActual.MsgErrorDesbloqueo)
+ End If
+ strScript.Append("}, 500); }")
+ RegistraScript(strScript.ToString())
+
+ UsuarioActual.SesionBloqueada = True
+ UsuarioActual.ErrorDesbloqueo = False
+ UsuarioActual.MsgErrorDesbloqueo = ""
+
+ BtnEmitirImprimir.Visible = False
+ Exit Sub
+ Else
+ DivBloqueoacceso.Visible = True
+ End If
+ Else
+ DivBloqueoacceso.Visible = False
+ End If
+ Else
+ DivBloqueoacceso.Visible = False
+ End If
+ End Sub
+
+ Protected Sub BtnCambiar_Click(sender As Object, e As EventArgs)
+
+ UsuarioActual.ErrorDesbloqueo = False
+ UsuarioActual.MsgErrorDesbloqueo = ""
+
+ If String.IsNullOrEmpty(TxtCodigoAcceso.Text.Trim) Then
+ UsuarioActual.SesionBloqueada = True
+ UsuarioActual.ErrorDesbloqueo = True
+ UsuarioActual.MsgErrorDesbloqueo = "Es necesario un código de acceso"
+
+ Response.Redirect($"~/Ventas/Ventas.aspx")
+ Exit Sub
+ End If
+
+ Dim CveUsuarioNuevo As Integer = -1
+
+ Using ObjUsuarios As New ClsSisUsuarios
+ CveUsuarioNuevo = ObjUsuarios.ValidaUsuarioCodigoAcceso(TxtCodigoAcceso.Text.Trim, UsuarioActual.CveEmpresa)
+ End Using
+
+ Dim DrUsuario As DataRow = Nothing
+
+ If CveUsuarioNuevo > 0 Then
+ DrUsuario = GlobalDTUsuarios(CveUsuarioNuevo, UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 1", "", {"CveUsuario", "Usuario", "Nombre", "Contraseña", "CveEmpresa", "Rol"}).Rows(0)
+ End If
+
+ If DrUsuario IsNot Nothing Then
+
+ Dim tUsuario, tContraseña As String
+ Dim tCveEmpresa As Integer
+ tUsuario = DrUsuario("Usuario").ToString
+ tContraseña = DrUsuario("Contraseña").ToString
+ tCveEmpresa = DrUsuario("CveEmpresa").ToString.ToEntero
+
+ Dim ObjUsuario As New ClsSisUsuarios
+ Dim Usuario As Usuario
+
+ Usuario = ObjUsuario.ValidaUsuario(tUsuario, tContraseña, IMEI, tCveEmpresa)
+
+ ObjUsuario.Dispose()
+
+ If Usuario IsNot Nothing Then
+ Dim dt As Data.DataTable = GlobalDTUsuarios(Usuario.CveUsuario)
+ ADSSession.ADSSessionConfig.sessionUser = Usuario
+ ADSSession.ADSSessionConfig.sessionUser.CvePlataforma = 1
+ ADSSession.ADSSessionConfig.sessionDpage = False
+ ADSSession.ADSSessionConfig.sessionUser.ModoSimulacion = False
+
+ If dt IsNot Nothing Then
+ If dt.Rows.Count >= 1 Then
+ If dt.Rows.Count > 1 Then ADSSession.ADSSessionConfig.sessionUser.MultipleEmpresa = True
+ End If
+ End If
+ dt.Dispose()
+
+ Dim ObjEmpresa As New ClsSisEmpresas()
+ If ObjEmpresa.GetEmpresas(tCveEmpresa, "-1", "-1", "-1", "-1") Then
+ If ObjEmpresa.GetEmpresasFuncionalidades(tCveEmpresa) Then
+ Dim dttmp As Data.DataTable = ObjEmpresa.DtResultados
+
+ Dim EmpresasFuncionalidades As New HybridDictionary
+ For Each Row As Data.DataRow In dttmp.Rows
+ EmpresasFuncionalidades.Add(Convert.ToInt32(Row("CveFuncionalidad")), Row("Valor").ToString)
+ Next
+ ObjEmpresa.Empresa.SetFuncionalidades(EmpresasFuncionalidades)
+
+ End If
+
+ UsuarioActual.Empresa = ObjEmpresa.Empresa
+ ADSSession.ADSSessionConfig.sessionUser.CveEmpresa = ObjEmpresa.Empresa.CveEmpresa
+
+ ADSSession.ADSSessionConfig.SessionManager(ADSSession.OpcionSession.CambiarEmpresa, Nothing, ObjEmpresa.Empresa.CveEmpresa)
+ End If
+ ObjEmpresa.Dispose()
+
+ End If
+
+ Response.Redirect($"~/Ventas/Ventas.aspx")
+ Else
+ UsuarioActual.SesionBloqueada = True
+ UsuarioActual.ErrorDesbloqueo = True
+ UsuarioActual.MsgErrorDesbloqueo = "El código de acceso no es correcto"
+
+ Response.Redirect($"~/Ventas/Ventas.aspx")
+ End If
+
+
+ End Sub
+ Protected Sub BtnBloquearAcceso_Click(sender As Object, e As EventArgs)
+ UsuarioActual.SesionBloqueada = True
+
+ Response.Redirect($"~/Ventas/Ventas.aspx")
+ End Sub
+#End Region
Private Sub CargaListasPrecios()
DivPrecioLista.Visible = True