Descargar manual de SIG

This commit is contained in:
2021-08-23 12:35:07 -07:00
parent de3e9a098a
commit 0ceafda5ac
2 changed files with 30 additions and 0 deletions

View File

@@ -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