|
|
@@ -104,8 +104,9 @@ Class KitController |
|
|
|
End Sub |
|
|
|
|
|
|
|
Public Sub SwitchBoardEdit |
|
|
|
|
|
|
|
|
|
|
|
dim id : id = Request.QueryString("Id") |
|
|
|
|
|
|
|
set Model = new SwitchBoard_ViewModel_Class |
|
|
|
set Model.Kit = KitRepository.SwitchBoardEditFindById(id) |
|
|
|
set Model.Labels = KitLabelsRepository.Find(Array("KitId =?",id),empty) |
|
|
@@ -113,12 +114,47 @@ Class KitController |
|
|
|
HTMLSecurity.SetAntiCSRFToken "KitEditForm" |
|
|
|
%> <!--#include file="../../Views/Kit/SwitchBoardEdit.asp"--> <% |
|
|
|
End Sub |
|
|
|
Public Sub DownloadTrackingkitSnailWorksPDF |
|
|
|
|
|
|
|
dim id : id = Request.QueryString("Id") |
|
|
|
ReportManager.Filename = Request.ServerVariables("APPL_PHYSICAL_PATH") & "Data\Label_Report.rep" |
|
|
|
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;" |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
ReportManager.SetDatabaseConnectionString "TRACKINGKITLABELS","Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Engine Type=5;Data Source=C:\inetpub\Data\webdata - Copy.mdb;" |
|
|
|
|
|
|
|
End If |
|
|
|
ReportManager.Preview = false |
|
|
|
ReportManager.ShowProgress = false |
|
|
|
ReportManager.ShowPrintDialog = false |
|
|
|
|
|
|
|
ReportManager.SetParamValue "PBKITID", CInt(id) |
|
|
|
|
|
|
|
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 |
|
|
|
|
|
|
|
|
|
|
|
End Sub |
|
|
|
|
|
|
|
Public Sub DownloadTrackingkitSnailWorks |
|
|
|
|
|
|
|
dim id : id = Request.QueryString("Id") |
|
|
|
dim export: set export = SnailWorksRepository.GetSnailWorksExportById(id) |
|
|
|
|
|
|
|
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) |
|
|
|
With objExportFile |
|
|
|
.Write """" & export.Header.RecordType & """," |
|
|
|