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