From 0ceafda5acf2ec583431aebb622a716d62dfb113 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Mon, 23 Aug 2021 12:35:07 -0700 Subject: [PATCH] Descargar manual de SIG --- Site.master | 1 + Site.master.vb | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/Site.master b/Site.master index 6c399c64c..24da7ea86 100644 --- a/Site.master +++ b/Site.master @@ -274,6 +274,7 @@
  • Mi Perfil
  • +
  • Cambiar Contraseña
  • Configuración Empresa
  • Cerrar Sesión
  • diff --git a/Site.master.vb b/Site.master.vb index a6f63e6b8..cca4daef4 100644 --- a/Site.master.vb +++ b/Site.master.vb @@ -77,6 +77,7 @@ Partial Class Site If UsuarioActual.Empresa.CvePlataforma = 3 Then lnkFavicon.Href = "/Imagenes/favicongps.ico" tTitulo.Text = "SIGNALS GPS" + LnkDescargarManual.Visible = False Else lnkFavicon.Href = "/Imagenes/favicon.ico" End If @@ -571,6 +572,34 @@ Partial Class Site UpNotificacionesFoliosSAT.Update() RegistraScript(String.Format("$('#{0}').modal();", pnlNotificacionSAT.ClientID)) End Sub + Protected Sub LnkDescargarManual_Click(sender As Object, e As EventArgs) + Dim ruta As String = $"{ModExtensiones.DirectorioEmpresas}Grales\ManualSIG.pdf" + + Dim Archivo As New System.IO.FileInfo(ruta) + + Try + If Archivo IsNot Nothing Then + If Archivo.Exists Then + + HttpContext.Current.Response.Clear() + HttpContext.Current.Response.ClearContent() + HttpContext.Current.Response.ContentType = "application/octet-stream" + HttpContext.Current.Response.AppendHeader("Content-disposition", String.Format("attachment; filename={0}", "Manual Plataforma SIG 2021.pdf")) + HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString()) + HttpContext.Current.Response.TransmitFile(ruta) + Response.Flush() ' send it to the client to download + HttpContext.Current.Response.SuppressContent = True + HttpContext.Current.ApplicationInstance.CompleteRequest() + Response.End() + + Else + Alert("El archivo no existe", TipoMensaje.MsgAdvertencia) + End If + + End If + Catch ex As Exception + End Try + End Sub End Class Public Class TipoCambioActual Public Fecha As Date