Redireccionar Usuarios de SIG a GPS

This commit is contained in:
2022-09-21 14:03:51 -07:00
parent 7492d5dce6
commit a96b7f5cd5
3 changed files with 17 additions and 40 deletions

View File

@@ -90,7 +90,7 @@
</div> </div>
<div class="copyright"> <div class="copyright">
<asp:Literal ID="Ltlcopyright" runat="server">2019 © AD Sistemas.</asp:Literal> <asp:Literal ID="Ltlcopyright" runat="server">2022 © AD Sistemas.</asp:Literal>
</div> </div>
<%--<div class="col-lg-offset-4 col-md-offset-4 col-sm-offset-3 col-lg-4 col-md-4 col-sm-6 col-xs-12 text-right"> <%--<div class="col-lg-offset-4 col-md-offset-4 col-sm-offset-3 col-lg-4 col-md-4 col-sm-6 col-xs-12 text-right">
<asp:LinkButton ID="linkRegistrar" runat="server" CssClass="restaurar-password" OnClientClick="window.location.href='ActivarUsuario.aspx'">Registrar</asp:LinkButton> <asp:LinkButton ID="linkRegistrar" runat="server" CssClass="restaurar-password" OnClientClick="window.location.href='ActivarUsuario.aspx'">Registrar</asp:LinkButton>

View File

@@ -46,14 +46,14 @@
<AlternatingRowStyle CssClass="TextoAlterno" /> <AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView> </asp:GridView>
<asp:GridView ID="GvPortalRastreo" runat="server" DataKeyNames="CveUsuario, CveCliente, Contraseña, Usuario" AutoGenerateColumns="false" ShowHeaderWhenEmpty="false" <asp:GridView ID="GvPortalRastreo" runat="server" DataKeyNames="CveUsuario, CveCliente, Contraseña, Usuario,CveEmpresa" AutoGenerateColumns="false" ShowHeaderWhenEmpty="false" OnRowDataBound="GvPortalRastreo_RowDataBound"
Width="100%" ToolTip="Listado de Empresas a las que tiene acceso." CssClass="table table-striped table-advance table-hover GVSearch" Width="100%" ToolTip="Listado de Empresas a las que tiene acceso." CssClass="table table-striped table-advance table-hover GVSearch"
Style="margin-top: -10px; text-align: center;" GridLines="None"> Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns> <Columns>
<asp:TemplateField> <asp:TemplateField>
<HeaderTemplate>Portal Rastreo</HeaderTemplate> <HeaderTemplate>Portal Rastreo</HeaderTemplate>
<ItemTemplate> <ItemTemplate>
<asp:LinkButton ID="LnkEmp" runat="server" CssClass="Texto" Text='<%# Eval("Cliente")%>' CommandArgument='<%# Eval("CveCliente") %>' CommandName="Cambia"></asp:LinkButton> <asp:HyperLink ID="HlpPortal" runat="server" CssClass="Texto" Target="_blank" Text='<%# Eval("Cliente")%>' ></asp:HyperLink>
</ItemTemplate> </ItemTemplate>
<ItemStyle HorizontalAlign="Left" /> <ItemStyle HorizontalAlign="Left" />
<HeaderStyle HorizontalAlign="Left" /> <HeaderStyle HorizontalAlign="Left" />
@@ -113,8 +113,9 @@
$('#BtnSeleccionar').click(); $('#BtnSeleccionar').click();
} }
function Ir2() { function Ir2(url) {
gotourl('/PortalGPS/InicioGPS.aspx'); //gotourl('/PortalGPS/InicioGPS.aspx');
gotourl(url);
} }
function Ir3() { function Ir3() {

View File

@@ -94,41 +94,6 @@ Partial Class PopUpSeleccionarEmpresa
End If End If
End Sub End Sub
Protected Sub GvPortalRastreo_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs) Handles GvPortalRastreo.RowCommand
If e.CommandName = "Cambia" Then
Dim gvr As GridViewRow = DirectCast(DirectCast(e.CommandSource, LinkButton).BindingContainer, GridViewRow)
If gvr IsNot Nothing Then
Dim ObjUsuario As New ClsSisUsuarios
Dim Usuario As Usuario = Nothing
Usuario = ObjUsuario.ValidaUsuarioGPS2(gvr.DataKey("CveCliente"), gvr.DataKey("Usuario"), gvr.DataKey("Contraseña"))
ObjUsuario.Dispose()
If Usuario IsNot Nothing Then
Dim dt As Data.DataTable = GlobalDTUsuarios(Usuario.CveUsuario)
Dim ModoSimulacion As Boolean = ADSSession.ADSSessionConfig.sessionUser.ModoSimulacion
Usuario.ModoSimulacion = ModoSimulacion
ADSSession.ADSSessionConfig.sessionUser = Usuario
ADSSession.ADSSessionConfig.sessionDpage = False
If dt IsNot Nothing Then
If dt.Rows.Count >= 1 Then
If dt.Rows.Count > 1 Then Usuario.MultipleEmpresa = True
Usuario.CvePlataforma = 3
CreaObjetoEmpresa(Usuario)
'si la contraseña es la prederminada, pide la nueva contraseña
'FormsAuthentication.RedirectFromLoginPage(Encripta(Usuario.CveUsuario.ToString), False)
RegistraScript("Ir2();")
End If
End If
dt.Dispose()
End If
End If
End If
End Sub
Protected Sub GvPortalCliente_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs) Handles GvPortalCliente.RowCommand Protected Sub GvPortalCliente_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs) Handles GvPortalCliente.RowCommand
If e.CommandName = "Cambia" Then If e.CommandName = "Cambia" Then
Dim gvr As GridViewRow = DirectCast(DirectCast(e.CommandSource, LinkButton).BindingContainer, GridViewRow) Dim gvr As GridViewRow = DirectCast(DirectCast(e.CommandSource, LinkButton).BindingContainer, GridViewRow)
@@ -263,4 +228,15 @@ Partial Class PopUpSeleccionarEmpresa
End Sub End Sub
#End Region #End Region
Protected Sub GvPortalRastreo_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
Dim Parametros As String = Encripta($"OPCION=PORTALGPS&CVEEMPRESA={e.Row.DBCampo("CveEmpresa")}&CVECLIENTE={e.Row.DBCampo("CveCliente")}&CVEUSUARIO={UsuarioActual.CveUsuario}&TICKS={Now.Ticks}")
Dim SitioGPS As String = "https://gps.signalsgps.com/"
Dim URLGPS As String = $"{SitioGPS}LogIn.aspx?P={Parametros}"
e.Row.FCHyperLink("HlpPortal").NavigateUrl = URLGPS
End If
End Sub
End Class End Class