SMS - 2024.02.20
This commit is contained in:
@@ -134,6 +134,9 @@
|
||||
<td>
|
||||
<asp:Label Text="" ID="LbCliente" runat="server" />
|
||||
</td>
|
||||
<td style="text-align:right">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Folio:</td>
|
||||
@@ -141,18 +144,23 @@
|
||||
<asp:HyperLink ID="HLFolio" Target="_blank" runat="server" />
|
||||
<%--<asp:Label Text="" ID="LbFolio" runat="server" />--%>
|
||||
</td>
|
||||
<td>
|
||||
<asp:LinkButton ID="BtnArchivoAdjunto" runat="server" Visible="false" Text="" Font-Size="14px" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="trObsGral" runat="server" visible="false">
|
||||
<td>Observaciones Grales:</td>
|
||||
<td>
|
||||
<asp:Label Text="" ID="LbObservaciones" runat="server" />
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr id="trObsAlmacen" runat="server" visible="false">
|
||||
<td>Observaciones Almacén:</td>
|
||||
<td>
|
||||
<asp:Label Text="" ID="LbObservacionesAlmacen" runat="server" />
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr id="trDireccionEnvio" runat="server" visible="false">
|
||||
<td>Dirección Envío:</td>
|
||||
@@ -160,12 +168,16 @@
|
||||
<asp:Label Text="" ID="LblDirEnvio" runat="server" />
|
||||
<asp:LinkButton ID="LnkEditarDir" runat="server" OnClick="LnkEditarDir_Click" AlternateText="Editar Dirección" ToolTip="Editar Dirección" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="BtnArchivoAdjunto" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -350,6 +350,21 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
|
||||
|
||||
|
||||
Private Property Adjunto As String
|
||||
Get
|
||||
If ViewState("Adjunto") Is Nothing Then
|
||||
ViewState("Adjunto") = ""
|
||||
End If
|
||||
Return ViewState("Adjunto").ToString()
|
||||
End Get
|
||||
|
||||
Set(value As String)
|
||||
ViewState("Adjunto") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
@@ -617,7 +632,11 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
CveVentaAD = -2
|
||||
CargaVentaPorSurtir(DdlFolio.SelectedValue.ToEntero())
|
||||
End Sub
|
||||
Private Sub CargaVentaPorSurtir(CveVenta As Integer, Optional CveAlmacen As Integer = -1, Optional CveOS As Integer = -1)
|
||||
Private Sub CargaVentaPorSurtir(CveVenta As Integer, Optional CveAlmacen As Integer = -1, Optional CveOS As Integer = -1)
|
||||
|
||||
Adjunto = ""
|
||||
BtnArchivoAdjunto.Visible = False
|
||||
|
||||
LbSurtida.Visible = False
|
||||
CveContrato = -1
|
||||
CveSubProyecto = -1
|
||||
@@ -701,8 +720,26 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
'ClienteEntregaPersonal(CveCliente)
|
||||
CveSubProyecto = drE("CveSubProyecto").ToString().ToEntero()
|
||||
EsInterno = CBool(DtDatos.Rows(0)("EsInterno").ToString())
|
||||
CveDireccionEnvio = drE("CveDireccionEnvio").ToString.ToEntero
|
||||
|
||||
CveDireccionEnvio = drE("CveDireccionEnvio").ToString.ToEntero
|
||||
|
||||
|
||||
Adjunto = drE("Adjunto").ToString()
|
||||
|
||||
If Adjunto.Trim.Length > 0 Then
|
||||
|
||||
Dim ruta As String = HttpContext.Current.Request.ApplicationPath
|
||||
ruta = String.Format("{0}Ventas", UsuarioActual.Empresa.Ruta)
|
||||
ruta += $"/{Adjunto}"
|
||||
|
||||
If File.Exists(ruta) Then
|
||||
BtnArchivoAdjunto.Visible = True
|
||||
BtnArchivoAdjunto.Text = $"Adjunto: {Adjunto}"
|
||||
End If
|
||||
|
||||
|
||||
|
||||
End If
|
||||
|
||||
If CveDireccionEnvio > 0 Then
|
||||
trDireccionEnvio.Visible = True
|
||||
'carga la dirección de envío
|
||||
@@ -870,6 +907,8 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
|
||||
If CveAlmacen <= 0 Then CargaGvDatos()
|
||||
|
||||
UpVenta.Update()
|
||||
|
||||
End Sub
|
||||
Private Sub CargaTraspasoPorSurtir(CveTraspaso As Integer)
|
||||
LbSurtida.Visible = False
|
||||
@@ -4540,5 +4579,36 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
End Function
|
||||
|
||||
|
||||
Protected Sub BtnArchivoAdjunto_Click(sender As Object, e As System.EventArgs) Handles BtnArchivoAdjunto.Click
|
||||
Dim ruta As String = HttpContext.Current.Request.ApplicationPath
|
||||
ruta = String.Format("{0}Ventas", UsuarioActual.Empresa.Ruta)
|
||||
ruta += $"/{Adjunto}"
|
||||
|
||||
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}", Archivo.Name))
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user