SMS - 2024.02.20

This commit is contained in:
rakcsle
2024-02-20 17:06:32 -07:00
parent 7347bad03b
commit d793403bd9
9 changed files with 284 additions and 176 deletions

View File

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