Sfoglia il codice sorgente

Changing where files go

pull/8/head
Daniel Covington 4 mesi fa
parent
commit
6fc8395f40
3 ha cambiato i file con 32 aggiunte e 37 eliminazioni
  1. +30
    -36
      App/Controllers/Kit/KitController.asp
  2. +1
    -0
      App/app.config.asp
  3. +1
    -1
      MVC/activeXdepedancies.asp

+ 30
- 36
App/Controllers/Kit/KitController.asp Vedi File

@@ -104,7 +104,7 @@ Class KitController
End Sub End Sub


Public Sub SwitchBoardEdit Public Sub SwitchBoardEdit
Flash.ShowSuccessIfPresent
dim id : id = Request.QueryString("Id") dim id : id = Request.QueryString("Id")
set Model = new SwitchBoard_ViewModel_Class set Model = new SwitchBoard_ViewModel_Class
@@ -114,13 +114,10 @@ Class KitController
HTMLSecurity.SetAntiCSRFToken "KitEditForm" HTMLSecurity.SetAntiCSRFToken "KitEditForm"
%> <!--#include file="../../Views/Kit/SwitchBoardEdit.asp"--> <% %> <!--#include file="../../Views/Kit/SwitchBoardEdit.asp"--> <%
End Sub End Sub
Public Sub DownloadTrackingkitSnailWorksPDF
dim id : id = Request.QueryString("Id")
dim ExportDirectory:ExportDirectory = "\\kci-syn-cl01\PC Transfer\TrackingDataExport\"
Public Sub ExportTrackingLabels(id)
dim KitInfo : Set KitInfo = KitRepository.FindByID(id) dim KitInfo : Set KitInfo = KitRepository.FindByID(id)
dim JurisdictionInfo : Set JurisdictionInfo = JurisdictionRepository.FindByJCode(KitInfo.Jcode) dim JurisdictionInfo : Set JurisdictionInfo = JurisdictionRepository.FindByJCode(KitInfo.Jcode)
ReportManager.Filename = Request.ServerVariables("APPL_PHYSICAL_PATH") & "Data\Label_Report.rep"
ReportManager.Filename = Request.ServerVariables("APPL_PHYSICAL_PATH") & "Data\Label_Report.rep"
if dev = true Then if dev = true Then


ReportManager.SetDatabaseConnectionString "TRACKINGKITLABELS","Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Engine Type=5;Data Source=" & Request.ServerVariables("APPL_PHYSICAL_PATH") & "Data\webdata - Copy.mdb;" ReportManager.SetDatabaseConnectionString "TRACKINGKITLABELS","Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Engine Type=5;Data Source=" & Request.ServerVariables("APPL_PHYSICAL_PATH") & "Data\webdata - Copy.mdb;"
@@ -136,32 +133,35 @@ Class KitController
ReportManager.SetParamValue "PBKITID", CInt(id) ReportManager.SetParamValue "PBKITID", CInt(id)
if FSO.FolderExists(ExportDirectory & JurisdictionInfo.JCode & "-" & JurisdictionInfo.Name) = False then if FSO.FolderExists(ExportDirectory & JurisdictionInfo.JCode & "-" & JurisdictionInfo.Name) = False then
FSO.CreateFolder(ExportDirectory & JurisdictionInfo.JCode & "-" & JurisdictionInfo.Name) FSO.CreateFolder(ExportDirectory & JurisdictionInfo.JCode & "-" & JurisdictionInfo.Name)
end if end if
ReportManager.SaveToPdf ExportDirectory & JurisdictionInfo.JCode & "-" & JurisdictionInfo.Name & "\" & JurisdictionInfo.JCode & "-" & JurisdictionInfo.Name & "_labels.pdf",1
'ReportManager.SaveToPdf Request.ServerVariables("APPL_PHYSICAL_PATH") & "Data\" & id & ".pdf",1
Dim objStream:Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Type = 1 'adTypeBinary
objStream.Open
objStream.LoadFromFile(Request.ServerVariables("APPL_PHYSICAL_PATH") & "Data\" & id & ".pdf")
Response.ContentType = "application/octet-stream"
Response.Addheader "Content-Disposition", "attachment; filename=" & id & ".pdf"
Response.BinaryWrite objStream.Read
objStream.Close
Set objStream = Nothing


if FSO.FileExists(ExportDirectory & JurisdictionInfo.JCode & "-" & JurisdictionInfo.Name & "\" & JurisdictionInfo.JCode & "-" & JurisdictionInfo.Name & "_labels.pdf") then
FSO.DeleteFile(ExportDirectory & JurisdictionInfo.JCode & "-" & JurisdictionInfo.Name & "\" & JurisdictionInfo.JCode & "-" & JurisdictionInfo.Name & "_labels.pdf")
end if
ReportManager.SaveToPdf Request.ServerVariables("APPL_PHYSICAL_PATH") & "\Data\" & JurisdictionInfo.JCode & "-" & JurisdictionInfo.Name & " Labels.pdf",1
FSO.MoveFile Request.ServerVariables("APPL_PHYSICAL_PATH") & "\Data\" & JurisdictionInfo.JCode & "-" & JurisdictionInfo.Name & " Labels.pdf" , ExportDirectory & JurisdictionInfo.JCode & "-" & JurisdictionInfo.Name & "\" & JurisdictionInfo.JCode & "-" & JurisdictionInfo.Name & "_labels.pdf"
End Sub End Sub


Public Sub DownloadTrackingkitSnailWorks
dim ExportDirectory:ExportDirectory = "\\kci-syn-cl01\PC Transfer\TrackingDataExport\"
dim id : id = Request.QueryString("Id")
Public Sub ExportSnailWorksTracking(id)
dim KitInfo : Set KitInfo = KitRepository.FindByID(id)
dim JurisdictionInfo : Set JurisdictionInfo = JurisdictionRepository.FindByJCode(KitInfo.Jcode)
if FSO.FolderExists(ExportDirectory & JurisdictionInfo.JCode & "-" & JurisdictionInfo.Name) = False then
FSO.CreateFolder(ExportDirectory & JurisdictionInfo.JCode & "-" & JurisdictionInfo.Name)
end if


if FSO.FileExists(ExportDirectory & JurisdictionInfo.JCode & "-" & JurisdictionInfo.Name & "\" & JurisdictionInfo.JCode & "-" & JurisdictionInfo.Name & "_SW_EXPORT.csv") then
FSO.DeleteFile(ExportDirectory & JurisdictionInfo.JCode & "-" & JurisdictionInfo.Name & "\" & JurisdictionInfo.JCode & "-" & JurisdictionInfo.Name & "_SW_EXPORT.csv")
end if
dim export: set export = SnailWorksRepository.GetSnailWorksExportById(id) dim export: set export = SnailWorksRepository.GetSnailWorksExportById(id)
if export.DetailRecords.Count > 0 Then if export.DetailRecords.Count > 0 Then
If Not Server.CreateObject("Scripting.FileSystemObject").FolderExists(server.mappath("/uploads/")) Then : Server.CreateObject("Scripting.FileSystemObject").CreateFolder(server.mappath("/uploads/")):End If
dim objExportFile: Set objExportFile = Server.CreateObject("Scripting.FileSystemObject").CreateTextFile(server.mappath("/uploads/" & id & ".csv"),2)
dim objExportFile: Set objExportFile = FSO.CreateTextFile(ExportDirectory & JurisdictionInfo.JCode & "-" & JurisdictionInfo.Name & "\" & JurisdictionInfo.JCode & "-" & JurisdictionInfo.Name & "_SW_EXPORT.csv",2)
With objExportFile With objExportFile
.Write """" & export.Header.RecordType & """," .Write """" & export.Header.RecordType & ""","
.Write """" & export.Header.Version & """," .Write """" & export.Header.Version & ""","
@@ -223,19 +223,12 @@ Class KitController
.Write """" & records.IMTB & """" & vbCRLF .Write """" & records.IMTB & """" & vbCRLF
Wend Wend
End With End With
objExportFile.Close
Dim objStream:Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Type = 1 'adTypeBinary
objStream.Open
objStream.LoadFromFile(server.mappath("/uploads/" & id & ".csv"))
Response.ContentType = "application/octet-stream"
Response.Addheader "Content-Disposition", "attachment; filename=" & id & ".csv"
Response.BinaryWrite objStream.Read
objStream.Close
Set objStream = Nothing
End If End If


End Sub End Sub



Public Sub Edit Public Sub Edit


dim id : id = Request.QueryString("Id") dim id : id = Request.QueryString("Id")
@@ -302,7 +295,6 @@ Class KitController
'Else 'Else
' set Model = new Create_ViewModel_Class ' set Model = new Create_ViewModel_Class
'End If 'End If

HTMLSecurity.SetAntiCSRFToken "KitCreateForm" HTMLSecurity.SetAntiCSRFToken "KitCreateForm"


%> <!--#include file="../../Views/Kit/Create.asp"--> <% %> <!--#include file="../../Views/Kit/Create.asp"--> <%
@@ -326,6 +318,8 @@ Class KitController
KitRepository.AddNew new_Kit_model KitRepository.AddNew new_Kit_model
KitLabelsRepository.BulkAdd new_Kit_model.ID,Request.Form("Amount") KitLabelsRepository.BulkAdd new_Kit_model.ID,Request.Form("Amount")
' FormCache.ClearForm "NewKit" ' FormCache.ClearForm "NewKit"
ExportTrackingLabels(new_Kit_model.ID)
ExportSnailWorksTracking(new_Kit_model.ID)
Flash.Success = "Kit added." Flash.Success = "Kit added."
MVC.RedirectToAction "Index" MVC.RedirectToAction "Index"
'End If 'End If


+ 1
- 0
App/app.config.asp Vedi File

@@ -8,6 +8,7 @@ tabulatorCss = "/dist/css/tabulator_bootstrap5.css"
appBootStrapJs = "https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js' integrity='sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM' crossorigin='anonymous" appBootStrapJs = "https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js' integrity='sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM' crossorigin='anonymous"
jqueryJs = "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js' integrity='sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==' crossorigin='anonymous' referrerpolicy='no-referrer" jqueryJs = "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js' integrity='sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==' crossorigin='anonymous' referrerpolicy='no-referrer"
dev = true dev = true
dim ExportDirectory:ExportDirectory = "\\kci-syn-cl01\PC Transfer\TrackingDataExport\"
'======================================================================================================================= '=======================================================================================================================
' Set Global Variables Here ' Set Global Variables Here
'======================================================================================================================= '=======================================================================================================================


+ 1
- 1
MVC/activeXdepedancies.asp Vedi File

@@ -18,7 +18,7 @@
dim m_FSO dim m_FSO
Private Function FSO Private Function FSO
if not isobject(m_FSO) then if not isobject(m_FSO) then
set m_FSO = server.CreateObject(CreateObject("Scripting.FileSystemObject")
set m_FSO = server.CreateObject("Scripting.FileSystemObject")
end if end if
set FSO = m_FSO set FSO = m_FSO
End Function End Function

Loading…
Annulla
Salva

Powered by TurnKey Linux.