--FIX SigAyuda

This commit is contained in:
2024-09-27 18:59:06 -07:00
parent a52539c577
commit 7998e231f7
2 changed files with 28 additions and 5 deletions

View File

@@ -116,15 +116,15 @@
</div> </div>
<asp:UpdatePanel ID="UpAdjunto" runat="server" UpdateMode="Conditional" class="task-status"> <asp:UpdatePanel ID="UpAdjunto" runat="server" UpdateMode="Conditional" class="task-status">
<ContentTemplate> <ContentTemplate>
<a class="done" id="linkDescargaRol" runat="server"> <asp:LinkButton ID="LnkDescargarManualRol" runat="server" class="done" Text=" <i class='fa fa-download fa-3'></i>" OnClick="LnkDescargarManualRol_Click"></asp:LinkButton>
<i class="fa fa-download fa-3"></i>
</a>
</ContentTemplate> </ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="LnkDescargarManualRol" />
</Triggers>
</asp:UpdatePanel> </asp:UpdatePanel>
<div class="task-content"> <div class="task-content">
<h4 class="uppercase bold">Manual del Rol <h4 class="uppercase bold">Manual del Rol
</h4> </h4>
</div> </div>
</li> </li>
</ul> </ul>

View File

@@ -28,7 +28,6 @@ Partial Class Metronic_SigAyuda
If ObjRoles.DtResultados IsNot Nothing AndAlso ObjRoles.DtResultados.Rows.Count = 1 Then If ObjRoles.DtResultados IsNot Nothing AndAlso ObjRoles.DtResultados.Rows.Count = 1 Then
Me.Adjunto = ObjRoles.DtResultados.Rows(0)("Adjunto").ToString() Me.Adjunto = ObjRoles.DtResultados.Rows(0)("Adjunto").ToString()
If Not String.IsNullOrEmpty(Me.Adjunto) Then If Not String.IsNullOrEmpty(Me.Adjunto) Then
linkDescargaRol.HRef = $"javascript:downFile('{Me.Adjunto}');"
DivPerfil.Visible = True DivPerfil.Visible = True
End If End If
End If End If
@@ -39,6 +38,26 @@ Partial Class Metronic_SigAyuda
UpAdjunto.Update() UpAdjunto.Update()
End If End If
End Sub 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) Protected Sub btnDownload_Click(sender As Object, e As EventArgs)
Try Try
Dim docto As String = TxtDocto.Text.Replace("/", "\") Dim docto As String = TxtDocto.Text.Replace("/", "\")
@@ -67,4 +86,8 @@ Partial Class Metronic_SigAyuda
End Sub End Sub
Protected Sub LnkDescargarManualRol_Click(sender As Object, e As EventArgs)
DescargaArchivoDirecto($"{UsuarioActual.Empresa.Ruta}Roles/{Me.Adjunto}")
End Sub
End Class End Class