Daniel Covington 6 месяцев назад
Родитель
Сommit
e36baaac73
3 измененных файлов: 40 добавлений и 19 удалений
  1. +20
    -0
      App/Controllers/Kit/KitController.asp
  2. +3
    -0
      App/Views/Kit/SwitchBoardEdit.asp
  3. +17
    -19
      ImportService/TrackingDataImport.vbs

+ 20
- 0
App/Controllers/Kit/KitController.asp Просмотреть файл

@@ -113,7 +113,27 @@ Class KitController
HTMLSecurity.SetAntiCSRFToken "KitEditForm"
%> <!--#include file="../../Views/Kit/SwitchBoardEdit.asp"--> <%
End Sub
Public Sub DownloadTrackingkitSnailWorks
dim id : id = Request.QueryString("Id")
dim Labels : Set Labels = KitLabelsRepository.Find(Array("KitID=?",id),empty)


'Response.Buffer = False
Dim objStream:Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Type = 1 'adTypeBinary
objStream.Open
objStream.LoadFromFile(server.mappath("/uploads/MI Jurisdictions with IMB.csv"))
'Response.Flush
Response.ContentType = "application/octet-stream"
Response.Addheader "Content-Disposition", "attachment; filename=" & "MI Jurisdictions with IMB.csv"
Response.BinaryWrite objStream.Read
'Response.End
objStream.Close
Set objStream = Nothing


End Sub
Public Sub Edit

dim id : id = Request.QueryString("Id")


+ 3
- 0
App/Views/Kit/SwitchBoardEdit.asp Просмотреть файл

@@ -2,6 +2,7 @@
<%= HTML.Hidden("nonce", HTMLSecurity.GetAntiCSRFToken("KitEditForm")) %>
<%= HTML.Hidden("Id", Model.Kit.ID) %>
<div class="row">

<div class="col-md-6">
<h2>Job Number: <%= Model.Kit.JobNumber %></h2>
<p><strong>Jurisdiction:</strong> <%= Model.Kit.Jurisdiction %></p>
@@ -9,6 +10,8 @@
<p><strong>Created On:</strong> <%= Model.Kit.CreatedOn %></p>
<p><strong>Labels Printed On :</strong> <%= Model.Kit.LabelsPrinted %></p>
<p><strong>Exported to SnailWorks On:</strong> <%= Model.Kit.ExportedToSnailWorks %></p>
<%= HTML.LinkToExt("Download SnailWorks File","Kit", "DownloadTrackingkitSnailWorks", Array("Id",Model.Kit.ID,"_P","1"),Array("class","btn btn-primary")) %>
<button class="btn btn-primary" id="DP">Download Labels Pdf</button>
<button class="btn btn-primary" id="toggleChild">Show Label Records</button>
</div>
</div>


+ 17
- 19
ImportService/TrackingDataImport.vbs Просмотреть файл

@@ -75,10 +75,10 @@ Function ExportInkjetFile(KitID)
objInkjetCSV.EnableQuotes = 1
objInkjetCSV.SetColumnName 0,"Full Name"
objInkjetCSV.SetColumnName 1,"Company"
objInkjetCSV.SetColumnName 2,"Alternate 1 Address"
objInkjetCSV.SetColumnName 3,"Delivery Address"
objInkjetCSV.SetColumnName 4,"City St ZIP+4"
objInkjetCSV.SetColumnName 1,"Address 1"
objInkjetCSV.SetColumnName 2,"Address 2"
objInkjetCSV.SetColumnName 3,"Address 3"
objInkjetCSV.SetColumnName 4,"Address 4"
objInkjetCSV.SetColumnName 5,"IM barcode Characters"
objInkjetCSV.SetColumnName 6,"Precinct"
objInkjetCSV.SetColumnName 7,"Ballot ID"
@@ -86,33 +86,31 @@ Function ExportInkjetFile(KitID)
objInkjetCSV.SetColumnName 9,"Jurisdiction code"
objInkjetCSV.SetColumnName 10,"Election Date"
objInkJetCSV.SetColumnName 11,"Combined Pct_Ballot Num"
objInkJetCSV.SetColumnName 12,"2D Matrix Barcode"
objInkJetCSV.SetColumnName 13,"Title"
objInkJetCSV.SetColumnName 14,"G2 Full Name"
objInkJetCSV.SetColumnName 15,"G2 Company"
objInkJetCSV.SetColumnName 16,"G2 Alternate 1 Address"
objInkJetCSV.SetColumnName 17,"G2 Delivery Address"
objInkJetCSV.SetColumnName 18,"G2 City St ZIP+4"
objInkJetCSV.SetColumnName 19,"G2 IM barcode Characters"
objInkJetCSV.SetColumnName 20,"Matching Code"
objInkJetCSV.SetColumnName 12,"Title"
objInkJetCSV.SetColumnName 13,"G2 Full Name"
objInkJetCSV.SetColumnName 14,"G2 Company"
objInkJetCSV.SetColumnName 15,"G2 Alternate 1 Address"
objInkJetCSV.SetColumnName 16,"G2 Delivery Address"
objInkJetCSV.SetColumnName 17,"G2 City St ZIP+4"
objInkJetCSV.SetColumnName 18,"G2 IM barcode Characters"
objInkJetCSV.SetColumnName 19,"Matching Code"

Dim AddressArray
Dim row:row = 0
While Not KitLabelsRs.EOF
AddressArray = CompressArray(Array(KitLabelsRs("CassADDRESS1").Value,KitLabelsRs("CassADDRESS2").Value,KitLabelsRs("CassADDRESS3").Value,KitLabelsRs("CassADDRESS4").Value,KitLabelsRs("CassADDRESS5").Value))
objInkjetCSV.SetCellByName row,"Full Name",AddressArray(0)
objInkjetCSV.SetCellByName row,"Company",AddressArray(1)
objInkjetCSV.SetCellByName row,"Alternate 1 Address",AddressArray(2)
objInkjetCSV.SetCellByName row,"Delivery Address",AddressArray(3)
objInkjetCSV.SetCellByName row,"City St ZIP+4",AddressArray(4)
objInkjetCSV.SetCellByName row,"Address 1",AddressArray(1)
objInkjetCSV.SetCellByName row,"Address 2",AddressArray(2)
objInkjetCSV.SetCellByName row,"Address 3",AddressArray(3)
objInkjetCSV.SetCellByName row,"Address 4",AddressArray(4)
objInkJetCSV.SetCellByName row,"IM barcode Characters",KitLabelsRs("OutboundIMBDigits").Value
objInkJetCSV.SetCellByName row,"Precinct",KitLabelsRs("PRECINCT").Value
objInkJetCSV.SetCellByName row,"Ballot ID",KitLabelsRs("VOTERID").Value
objInkJetCSV.SetCellByName row,"Ballot Number",TrimLeadingZeros(KitLabelsRs("BALLOT_NUMBER").Value)
objInkJetCSV.SetCellByName row,"Jurisdiction code",KitRs("Jcode").Value
objInkJetCSV.SetCellByName row,"Election Date",ElectionDate
objInkJetCSV.SetCellByName row,"Combined Pct_Ballot Num",KitLabelsRs("PRECINCT").Value & TrimLeadingZeros(KitLabelsRs("BALLOT_NUMBER").Value
objInkJetCSV.SetCellByName row,"2D Matrix Barcode",KitRs("Jcode").Value & KitLabelsRs("BALLOT_NUMBER").Value
objInkJetCSV.SetCellByName row,"Combined Pct_Ballot Num",KitLabelsRs("PRECINCT").Value & TrimLeadingZeros(KitLabelsRs("BALLOT_NUMBER").Value)
objInkjetCSV.SetCellByName row,"Title",ContactRs("Title").Value
objInkJetCSV.SetCellByName row,"G2 Full Name",JurisdictionRs("Name").Value
objInkJetCSV.SetCellByName row,"G2 Company",JurisdictionRs("Mailing_Address").Value


Загрузка…
Отмена
Сохранить

Powered by TurnKey Linux.