Commit inicial Ventas Productivo
This commit is contained in:
34
Planeacion/CargarArchivo.aspx.vb
Normal file
34
Planeacion/CargarArchivo.aspx.vb
Normal file
@@ -0,0 +1,34 @@
|
||||
Imports System.IO
|
||||
Partial Class CargarArchivo
|
||||
Inherits ClsPaginas
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
Session("FileUpload") = ""
|
||||
CType(Me.Master, BaseMasterPage).EsPopup = True
|
||||
CType(Me.Master, BaseMasterPage).PopupWidth = 350
|
||||
|
||||
If Request("Tipo") IsNot Nothing AndAlso Request("Tipo").Length > 0 Then
|
||||
HdnTipo.Value = Request("Tipo")
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub AFU_UploadedComplete(ByVal sender As Object, ByVal e As AjaxControlToolkit.AsyncFileUploadEventArgs) Handles AFU.UploadedComplete
|
||||
If AFU.HasFile Then
|
||||
If Not Directory.Exists(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp") Then
|
||||
Directory.CreateDirectory(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp")
|
||||
End If
|
||||
Dim UploadFolder As String = Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\"
|
||||
Dim Extension As String = System.IO.Path.GetExtension(AFU.PostedFile.FileName)
|
||||
|
||||
If System.IO.File.Exists(UploadFolder & UsuarioActual.CveUsuario.ToString & Extension) Then
|
||||
System.IO.File.Delete(UploadFolder & UsuarioActual.CveUsuario.ToString & Extension)
|
||||
End If
|
||||
|
||||
AFU.SaveAs(UploadFolder & UsuarioActual.CveUsuario.ToString & Extension)
|
||||
Session("FileUpload") = UsuarioActual.CveUsuario.ToString & Extension
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user