--FIX SigAyuda
This commit is contained in:
@@ -116,15 +116,15 @@
|
||||
</div>
|
||||
<asp:UpdatePanel ID="UpAdjunto" runat="server" UpdateMode="Conditional" class="task-status">
|
||||
<ContentTemplate>
|
||||
<a class="done" id="linkDescargaRol" runat="server">
|
||||
<i class="fa fa-download fa-3"></i>
|
||||
</a>
|
||||
<asp:LinkButton ID="LnkDescargarManualRol" runat="server" class="done" Text=" <i class='fa fa-download fa-3'></i>" OnClick="LnkDescargarManualRol_Click"></asp:LinkButton>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="LnkDescargarManualRol" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
<div class="task-content">
|
||||
<h4 class="uppercase bold">Manual del Rol
|
||||
</h4>
|
||||
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -28,7 +28,6 @@ Partial Class Metronic_SigAyuda
|
||||
If ObjRoles.DtResultados IsNot Nothing AndAlso ObjRoles.DtResultados.Rows.Count = 1 Then
|
||||
Me.Adjunto = ObjRoles.DtResultados.Rows(0)("Adjunto").ToString()
|
||||
If Not String.IsNullOrEmpty(Me.Adjunto) Then
|
||||
linkDescargaRol.HRef = $"javascript:downFile('{Me.Adjunto}');"
|
||||
DivPerfil.Visible = True
|
||||
End If
|
||||
End If
|
||||
@@ -39,6 +38,26 @@ Partial Class Metronic_SigAyuda
|
||||
UpAdjunto.Update()
|
||||
End If
|
||||
End Sub
|
||||
Private Sub DescargaArchivoDirecto(RutaArchivo As String)
|
||||
If RutaArchivo <> "" Then
|
||||
|
||||
'Dim Path As String = String.Format("{0}\{1}", UsuarioActual.Empresa.Ruta, RutaArchivo)
|
||||
Dim Archivo As New System.IO.FileInfo(RutaArchivo)
|
||||
|
||||
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}", Archivo.Name))
|
||||
HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString())
|
||||
HttpContext.Current.Response.TransmitFile(RutaArchivo)
|
||||
'HttpContext.Current.Response.Flush()
|
||||
HttpContext.Current.Response.End()
|
||||
End If
|
||||
Archivo = Nothing
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub btnDownload_Click(sender As Object, e As EventArgs)
|
||||
Try
|
||||
Dim docto As String = TxtDocto.Text.Replace("/", "\")
|
||||
@@ -67,4 +86,8 @@ Partial Class Metronic_SigAyuda
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Protected Sub LnkDescargarManualRol_Click(sender As Object, e As EventArgs)
|
||||
DescargaArchivoDirecto($"{UsuarioActual.Empresa.Ruta}Roles/{Me.Adjunto}")
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user