-- FNC para activación por código
This commit is contained in:
@@ -970,6 +970,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
|
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" class=" xspadding .nolineheight bordered whitoutcol" style="color: white;">
|
||||||
|
<ContentTemplate>
|
||||||
|
<div id="DivBloqueoAcceso" runat="server" style="width: 100%; text-align: center;" visible="false">
|
||||||
|
<asp:Button ID="BtnBloquearAcceso" ClientIDMode="Static" CssClass="btn red-haze btn-outline btn-circle btn-sm" runat="server" Text="Bloquear Turno" OnClick="BtnBloquearAcceso_Click" />
|
||||||
|
</div>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<asp:UpdatePanel ID="Updatetabs" runat="server" UpdateMode="Conditional">
|
<asp:UpdatePanel ID="Updatetabs" runat="server" UpdateMode="Conditional">
|
||||||
@@ -8676,7 +8683,41 @@
|
|||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<asp:Button ID="BtnShowBloqueoAcceso" runat="server" Text="Show Modal Popup" Style="visibility: hidden; display: none;" />
|
||||||
|
<asp:Button ID="BtnCloseBloqueoAcceso" runat="server" CssClass="btn btn-danger" Style="visibility: hidden; display: none;" Text="Cancelar" />
|
||||||
|
|
||||||
|
<!-- ModalPopupExtender -->
|
||||||
|
<cc1:ModalPopupExtender ID="mpeBloque" runat="server" PopupControlID="PanelBloqueoAcceso" TargetControlID="BtnShowBloqueoAcceso"
|
||||||
|
BackgroundCssClass="modalBackground">
|
||||||
|
</cc1:ModalPopupExtender>
|
||||||
|
|
||||||
|
<asp:Panel ID="PanelBloqueoAcceso" runat="server" CssClass="modalPopup" align="center" Style="display: none">
|
||||||
|
<table border="0" width="250px" cellspacing="1" style="background-color: White; padding-left: 10px;">
|
||||||
|
<tr style="background-color: #3598dc; color: #FFFFFF; font-size: 14px; text-align: center">
|
||||||
|
<td colspan="2">
|
||||||
|
<asp:Label runat="server" Text="<i class='fa fa-lock fa-2 icontxt'></i> Acceso Restringido" /></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="1"> </td>
|
||||||
|
<td colspan="1"> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="1">
|
||||||
|
<asp:Label runat="server" Text="Código de Acceso:" Font-Bold="true" Width="120px" />
|
||||||
|
</td>
|
||||||
|
<td colspan="1" style="text-align: center">
|
||||||
|
<asp:TextBox ID="TxtCodigoAcceso" runat="server" type="password"></asp:TextBox>
|
||||||
|
<asp:RequiredFieldValidator ID="RFVCodigoAcceso" runat="server" ControlToValidate="TxtCodigoAcceso" Display="None" ErrorMessage="<span class='has-error'><span id='username-error' class='help-block'>El campo <b>''Código de Acceso''</b> es necesario.</span></span>" ValidationGroup="GrpValidarCodigo"></asp:RequiredFieldValidator>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2"><span class='has-error'><span id='username-error' class='help-block'>
|
||||||
|
<asp:Literal ID="LtlMensajeBloqueo" runat="server" Text=""></asp:Literal></span></span></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<asp:Button ID="BtnCambiar" runat="server" CssClass="btn btn-success btn-sm" Text="Desbloquear" ValidationGroup="GrpValidarCodigo" OnClick="BtnCambiar_Click" />
|
||||||
|
|
||||||
|
</asp:Panel>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2485,7 +2485,7 @@ Partial Class Ventas
|
|||||||
TxtFechaFRem.Text = NowADS().ToShortDateString
|
TxtFechaFRem.Text = NowADS().ToShortDateString
|
||||||
TxtFechaFPedido.Text = NowADS().ToShortDateString
|
TxtFechaFPedido.Text = NowADS().ToShortDateString
|
||||||
TxtFechaFOC.Text = NowADS().ToShortDateString
|
TxtFechaFOC.Text = NowADS().ToShortDateString
|
||||||
|
ValidaUsuarioAcceso()
|
||||||
|
|
||||||
TrSinExistencia.Visible = UsuarioActual.TienePermisoProceso(276)
|
TrSinExistencia.Visible = UsuarioActual.TienePermisoProceso(276)
|
||||||
|
|
||||||
@@ -3528,7 +3528,135 @@ Partial Class Ventas
|
|||||||
|
|
||||||
End Sub
|
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()
|
Private Sub CargaListasPrecios()
|
||||||
DivPrecioLista.Visible = True
|
DivPrecioLista.Visible = True
|
||||||
|
|||||||
Reference in New Issue
Block a user