Cambio entre portales (portal del proveedor)

This commit is contained in:
2020-09-28 18:33:51 -07:00
parent ede6f99109
commit 53bf071079
4 changed files with 191 additions and 13 deletions

View File

@@ -12,8 +12,6 @@ Partial Class PopUpSeleccionarEmpresa
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
CType(Me.Master, BaseMasterPage).EsPopup = True
'CType(Me.Master, BaseMasterPage).PopupWidth = HdnAncho.Value.ToEntero
'RegistraScript("alertSize();")
GetEmpresas()
End If
End Sub
@@ -26,10 +24,14 @@ Partial Class PopUpSeleccionarEmpresa
LtlTotalRegistros.Text = Dt.Rows.Count.ToString.FormatoNumero(0)
GvEmpresas.DataSource = Dt.FiltraParametros("CvePlataforma = 1 OR (CvePlataforma = 3 AND CveCliente IS NULL)", "Empresa")
GvPortalRastreo.DataSource = Dt.FiltraParametros("CvePlataforma = 3 AND CveCliente IS NOT NULL", "Empresa")
GvPortalCliente.DataSource = Dt.FiltraParametros("CvePlataforma = 6 AND CveCliente IS NOT NULL", "Empresa")
GvPortalCliente.DataSource = Dt.FiltraParametros("CvePlataforma = 6 AND CveCliente IS NOT NULL", "Empresa")
GvPortalProveedor.DataSource = Dt.FiltraParametros("CvePlataforma = 7 AND CveProveedor IS NOT NULL", "Empresa")
Else
LtlTotalRegistros.Text = "0"
GvEmpresas.DataSource = Nothing
GvPortalRastreo.DataSource = Nothing
GvPortalCliente.DataSource = Nothing
GvPortalProveedor.DataSource = Nothing
Alert("No se encontraron registros con los parametros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia)
End If
End If
@@ -37,6 +39,7 @@ Partial Class PopUpSeleccionarEmpresa
GvEmpresas.DataBind()
GvPortalRastreo.DataBind()
GvPortalCliente.DataBind()
GvPortalProveedor.DataBind()
UPDatos.Update()
@@ -116,7 +119,6 @@ Partial Class PopUpSeleccionarEmpresa
End If
End Sub
Protected Sub GvPortalCliente_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs) Handles GvPortalCliente.RowCommand
If e.CommandName = "Cambia" Then
Dim gvr As GridViewRow = DirectCast(DirectCast(e.CommandSource, LinkButton).BindingContainer, GridViewRow)
@@ -125,7 +127,7 @@ Partial Class PopUpSeleccionarEmpresa
Dim ObjUsuario As New ClsSisUsuarios
Dim Usuario As Usuario = Nothing
Usuario = ObjUsuario.ValidaUsuarioPortalCliente(gvr.DataKey("CveCliente"), gvr.DataKey("Usuario"), gvr.DataKey("Contraseña"))
Usuario = ObjUsuario.ValidaUsuarioPortalCliente(gvr.DataKey("CveCliente").ToEntero(), gvr.DataKey("Usuario"), gvr.DataKey("Contraseña"))
ObjUsuario.Dispose()
@@ -155,7 +157,48 @@ Partial Class PopUpSeleccionarEmpresa
End If
End If
End Sub
End Sub
Protected Sub GvPortalProveedor_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs) Handles GvPortalProveedor.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.ValidaUsuarioPortalProveedor(gvr.DataKey("CveProveedor").ToEntero(), 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 = 7
UsuarioActual.CveEmpresa = gvr.DataKey("CveEmpresa").ToEntero()
ADSSession.ADSSessionConfig.SessionManager(ADSSession.OpcionSession.CambiarEmpresa, Nothing, UsuarioActual.CveEmpresa)
CreaObjetoEmpresa(Usuario)
'si la contraseña es la prederminada, pide la nueva contraseña
'FormsAuthentication.RedirectFromLoginPage(Encripta(Usuario.CveUsuario.ToString), False)
RegistraScript("Ir5();")
End If
End If
dt.Dispose()
End If
End If
End If
End Sub
#Region "F U N C I O N E S"
Protected Sub BtnSetWindows_Click(sender As Object, e As System.EventArgs) Handles BtnSetWindows.Click
RegistraScript(String.Format("$get('tdContenido').style.height='{0}px'; $get('tdContenido').style.width='{1}px'", HdnAlto.Value.ToEntero - 30, HdnAncho.Value.ToEntero - 30))
End Sub
@@ -181,8 +224,6 @@ Partial Class PopUpSeleccionarEmpresa
End If
ObjEmpresa.Dispose()
End Sub
Private Sub GuardaLogR(Mensaje As String)
Dim ArchivoW As IO.StreamWriter
Dim MensajeLog As String = ""
@@ -209,6 +250,7 @@ Partial Class PopUpSeleccionarEmpresa
End Try
ArchivoW.Close()
ArchivoW.Dispose()
End Sub
End Sub
#End Region
End Class