| @@ -25,15 +25,26 @@ Class KitController | |||
| dim page_num : page_num = Choice(Len(Request.Querystring("page_num")) > 0, Request.Querystring("page_num"), 1) | |||
| dim page_count, record_count | |||
| set Model = new SwitchBoard_PurpleEnvelopesViewModel_Class | |||
| Model.Title = "Tracking Kits" | |||
| Model.Title = "Purple Envelope Kits" | |||
| set Model.Kit = KitRepository.PagedPurpleEnvelopsIndexView(page_size, page_num, page_count, record_count) | |||
| Model.CurrentPageNumber = page_num | |||
| Model.PageSize = page_size | |||
| Model.PageCount = page_count | |||
| Model.RecordCount = record_count | |||
| %> <!--#include file="../../Views/Kit/SwitchBoardIndex.asp"--> <% | |||
| %> <!--#include file="../../Views/Kit/SwitchBoardPurpleEnvelopeIndex.asp"--> <% | |||
| End Sub | |||
| Public Sub SwitchBoardPurpleEnvelopeEdit | |||
| dim id : id = Request.QueryString("Id") | |||
| set Model = new SwitchBoard_ViewModel_Class | |||
| set Model.Kit = KitRepository.SwitchBoardPurpleEnvelopeEditFindById(id) | |||
| set Model.Labels = InkjetRecordsRepository.Find(Array("KitId =?",id),empty) | |||
| Model.Title = "Purple Envelopes for " | |||
| HTMLSecurity.SetAntiCSRFToken "KitEditForm" | |||
| %> <!--#include file="../../Views/Kit/SwitchBoardPurpleEnvelopeEdit.asp"--> <% | |||
| End Sub | |||
| Public Sub Index | |||
| dim page_size : page_size = 10 | |||
| @@ -29,11 +29,15 @@ Class IndexKitModel_Class | |||
| Public CreatedOn | |||
| Public LabelsPrinted | |||
| Public ExportedToSnailWorks | |||
| Public InkJetJob | |||
| Public JobType | |||
| Public Filename | |||
| Public Cass | |||
| Public Status | |||
| Private Sub Class_Initialize | |||
| 'ValidateExitsts Me, "","" | |||
| Class_Get_Properties = Array("ID, JobNumber, Jurisdiction,LabelCount,CreatedOn,LabelsPrinted,ExportedToSnailWorks,JobType") | |||
| Class_Get_Properties = Array("ID, JobNumber, Jurisdiction,LabelCount,CreatedOn,LabelsPrinted,ExportedToSnailWorks,InkJetJob,JobType,Filename,Cass,Status") | |||
| End Sub | |||
| End Class | |||
| @@ -48,7 +52,7 @@ Class KitRepository_Class | |||
| dim sql : sql = "SELECT Kit.ID,Kit.JobNumber as [JobNumber], " &_ | |||
| "Jurisdiction.Name As Jurisdiction," &_ | |||
| "(SELECT COUNT(*) From KitLabels Where KitId = Kit.ID)" &_ | |||
| " As [LabelCount],[CreatedOn],[LabelsPrinted],[ExportedToSnailWorks],[JobType] FROM Kit INNER JOIN Jurisdiction ON Kit.Jcode = Jurisdiction.JCode Where Kit.JobType = 'Purple Envelopes';" | |||
| " As [LabelCount],[CreatedOn],[LabelsPrinted],[ExportedToSnailWorks],[InkJetJob],[JobType],[Filename],[Cass],[Status] FROM Kit INNER JOIN Jurisdiction ON Kit.Jcode = Jurisdiction.JCode Where Kit.JobType = 'Purple Envelopes';" | |||
| dim list : set list = new LinkedList_Class | |||
| dim rs : set rs = DAL.PagedQuery(sql, empty, per_page, page_num) | |||
| @@ -69,7 +73,7 @@ Class KitRepository_Class | |||
| dim sql : sql = "SELECT Kit.ID,Kit.JobNumber as [JobNumber], " &_ | |||
| "Jurisdiction.Name As Jurisdiction," &_ | |||
| "(SELECT COUNT(*) From KitLabels Where KitId = Kit.ID)" &_ | |||
| " As [LabelCount],[CreatedOn],[LabelsPrinted],[ExportedToSnailWorks],[JobType] FROM Kit INNER JOIN Jurisdiction ON Kit.Jcode = Jurisdiction.JCode Where Kit.JobType Is Null or Kit.JobType = 'Labels';" | |||
| " As [LabelCount],[CreatedOn],[LabelsPrinted],[ExportedToSnailWorks],[JobType] FROM Kit INNER JOIN Jurisdiction ON Kit.Jcode = Jurisdiction.JCode Where Kit.JobType = 'Labels';" | |||
| dim list : set list = new LinkedList_Class | |||
| dim rs : set rs = DAL.PagedQuery(sql, empty, per_page, page_num) | |||
| @@ -100,7 +104,7 @@ Class KitRepository_Class | |||
| "Jurisdiction.Name As Jurisdiction," &_ | |||
| "(SELECT COUNT(*) From KitLabels Where KitId = Kit.ID)" &_ | |||
| " As [LabelCount],[CreatedOn],[LabelsPrinted],[ExportedToSnailWorks],[JobType] FROM Kit INNER JOIN Jurisdiction ON Kit.Jcode = Jurisdiction.JCode " &_ | |||
| "WHERE ID = ? AND Kit.JobType Is Null or Kit.JobType = 'Labels'" | |||
| "WHERE ID = ? AND Kit.JobType = 'Labels'" | |||
| dim rs : set rs = DAL.Query(sql,ID) | |||
| If rs.EOF then | |||
| @@ -112,6 +116,24 @@ Class KitRepository_Class | |||
| End Function | |||
| Public Function SwitchBoardPurpleEnvelopeEditFindById(ID) | |||
| dim sql : sql = "SELECT Kit.ID,Kit.JobNumber as [JobNumber], " &_ | |||
| "Jurisdiction.Name As Jurisdiction," &_ | |||
| "(SELECT COUNT(*) From InkjetRecords Where KitID = Kit.ID)" &_ | |||
| " As [LabelCount],[CreatedOn],[LabelsPrinted],[ExportedToSnailWorks],[JobType] FROM Kit INNER JOIN Jurisdiction ON Kit.Jcode = Jurisdiction.JCode " &_ | |||
| "WHERE ID = ? AND Kit.JobType Is Null or Kit.JobType = 'Purple Envelopes'" | |||
| dim rs : set rs = DAL.Query(sql,ID) | |||
| If rs.EOF then | |||
| Err.Raise 1, "KitRepository_Class", KitNotFoundException("ID", ID) | |||
| Else | |||
| Set SwitchBoardPurpleEnvelopeEditFindById = Automapper.AutoMap(rs,"IndexKitModel_Class") | |||
| End If | |||
| End Function | |||
| Public Function FindByID(ID) | |||
| dim sql : sql = "Select [ID], [JobNumber], [Jcode] FROM [Kit] WHERE ID = ?" | |||
| dim rs : set rs = DAL.Query(sql,ID) | |||
| @@ -13,7 +13,7 @@ Dim fixedTableName,tableName | |||
| Dim PrimaryKeyDictionary | |||
| Set oConn = WScript.CreateObject("ADODB.Connection") | |||
| Set fso = WScript.CreateObject("Scripting.Filesystemobject") | |||
| oConn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=F:\Development\Tracking_Kits\Data\webdata.mdb" | |||
| oConn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=F:\Development\Tracking_Kits\Data\webdata - Copy.mdb" | |||
| 'oConn.ConnectionString = "Provider=SQLOLEDB;Data Source=danielsubuntu,15789;Initial Catalog=northwind;User Id=sa;Password=SunBrightShine!;" | |||
| Init | |||
| @@ -23,7 +23,7 @@ Init | |||
| fixedTableName = Replace(rs("TABLE_NAME")," ","_") | |||
| tableName = rs("TABLE_NAME") | |||
| 'If tableName <> "meta_migrations" Then | |||
| If tableName <> "meta_migrations" AND tableName = "KitLabels" Then | |||
| If tableName <> "meta_migrations" AND tableName = "InkjetRecords" Then | |||
| debug.WriteLine(tableName) | |||
| If Not fso.FolderExists(ScriptDirectory()& "Controllers\"& fixedTableName) Then fso.CreateFolder(ScriptDirectory()& "Controllers\"& fixedTableName) | |||
| @@ -0,0 +1,86 @@ | |||
| <h2><%= H(Model.Title & " " & Model.Kit.Jurisdiction) %></h2> | |||
| <%= 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> | |||
| <p><strong>Label Count:</strong> <%= Model.Kit.LabelCount %></p> | |||
| <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> | |||
| <button class="btn btn-primary" id="toggleChild">Show Label Records</button> | |||
| </div> | |||
| </div> | |||
| <div class="row"> | |||
| <div class="col-md-4"> | |||
| <table id="KitLabels" class="table table-striped child-records" style="display:none"> | |||
| <thead> | |||
| <tr> | |||
| <th></th> | |||
| <th style="text-align: left">ID</th> | |||
| <th style="text-align: left">KitID</th> | |||
| <th style="text-align: left">VOTERID</th> | |||
| <th style="text-align: left">LASTNAME</th> | |||
| <th style="text-align: left">FIRSTNAME</th> | |||
| <th style="text-align: left">MIDDLENAME</th> | |||
| <th style="text-align: left">SUFFIX</th> | |||
| <th style="text-align: left">PRECINCT</th> | |||
| <th style="text-align: left">ADDRESS1</th> | |||
| <th style="text-align: left">ADDRESS2</th> | |||
| <th style="text-align: left">ADDRESS3</th> | |||
| <th style="text-align: left">ADDRESS4</th> | |||
| <th style="text-align: left">ADDRESS5</th> | |||
| <th style="text-align: left">APPSENT</th> | |||
| <th style="text-align: left">APPRETURNED</th> | |||
| <th style="text-align: left">BALSENT</th> | |||
| <th style="text-align: left">BALRETURNED</th> | |||
| <th style="text-align: left">CountingBoard</th> | |||
| <th style="text-align: left">UOCAVASTATUS</th> | |||
| <th style="text-align: left">EMAILADDRESS</th> | |||
| <th style="text-align: left">PHONENUMBER</th> | |||
| <th style="text-align: left">BALLOT_NUMBER</th> | |||
| <th style="text-align: left">CassADDRESS1</th> | |||
| <th style="text-align: left">CassADDRESS2</th> | |||
| <th style="text-align: left">CassADDRESS3</th> | |||
| <th style="text-align: left">CassADDRESS4</th> | |||
| <th style="text-align: left">CassADDRESS5</th> | |||
| <th></th> | |||
| </tr> | |||
| </thead> | |||
| <tbody> | |||
| <% dim it : set it = Model.Labels.Iterator %> | |||
| <% dim KitLabels %> | |||
| <% While it.HasNext %> | |||
| <% set KitLabels = it.GetNext() %> | |||
| <tr> | |||
| <td> | |||
| <%= HTML.LinkToExt("<i class='bi bi-search'></i>", "InkjetRecords", "Edit", Array("Id", KitLabels.ID), Array("class", "btn btn-primary")) %> | |||
| </td> | |||
| <td><% = H(KitLabels.ID) %></td> | |||
| <td><% = H(KitLabels.KitId) %></td> | |||
| <td><% = H(KitLabels.VOTERID) %></td> | |||
| <td><% = H(KitLabels.LASTNAME) %></td> | |||
| <td><% = H(KitLabels.FIRSTNAME) %></td> | |||
| <td><% = H(KitLabels.MIDDLENAME) %></td> | |||
| <td><% = H(KitLabels.SUFFIX) %></td> | |||
| <td><% = H(KitLabels.PRECINCT) %></td> | |||
| </tr> | |||
| <% Wend %> | |||
| </tbody> | |||
| </table> | |||
| </div> | |||
| </div> | |||
| <script> | |||
| document.getElementById('toggleChild').addEventListener('click', function() { | |||
| var childRecords = document.querySelector('.child-records'); | |||
| if (childRecords.style.display === 'none') { | |||
| childRecords.style.display = 'block'; | |||
| this.textContent = 'Hide Label Records'; | |||
| } else { | |||
| childRecords.style.display = 'none'; | |||
| this.textContent = 'Show Label Records'; | |||
| } | |||
| }); | |||
| </script> | |||
| @@ -0,0 +1,85 @@ | |||
| <h2><%= H(Model.Title) %></h2> | |||
| <div class="row"> | |||
| <div class="col-md-8 col-sm-8 col-xs-12"> | |||
| <%= H(Model.RecordCount) %> Kit found. Showing <%= H(Model.PageSize) %> records per page. | |||
| <%'= HTML.LinkToExt("<i class='bi bi-plus-square-fill'></i> New","Kit", "Create", empty, Array("class", "btn btn-xs btn-primary")) %> | |||
| </div> | |||
| <div class="col-md-4 col-sm-4 col-xs-12"> | |||
| <%= HTML.FormTag("Kit", "Search", empty, empty) %> | |||
| <div class="col-md-10 col-sm-10 col-xs-12"> | |||
| <label class="sr-only" for="search">Search</label> | |||
| <div class="input-group"> | |||
| <input type="text" class="form-control input-search" value='<%= Choice(Request.Form.Count = 0,Request.QueryString("q"),Request.Form("q")) %>' name="q" id="search" placeholder="Search"> | |||
| <span class="input-group-addon group-icon"><span class="glyphicon glyphicon-eye-open"></span> | |||
| <button type="submit" class="btn btn-success"><i class="bi bi-search"></i>Search</buttton> | |||
| </div> | |||
| </div> | |||
| </form> | |||
| </div> | |||
| </div> | |||
| <table id="Kit" class="table table-striped"> | |||
| <thead> | |||
| <tr> | |||
| <th></th> | |||
| <th style="text-align: left">Job Number</th> | |||
| <th style="text-align: left">Jurisdiction</th> | |||
| <th style="text-align: left">Number of Labels</th> | |||
| <th style="text-align: left">Created On</th> | |||
| <th style="text-align: left">SnailWorks Export Date</th> | |||
| <th style="text-align: left">Inkjet File Created</th> | |||
| <th style="text-align: left">Import File</th> | |||
| <th style="text-align: left">Has Been Cassed</th> | |||
| <th style="text-align: left">Status</th> | |||
| </tr> | |||
| </thead> | |||
| <tbody> | |||
| <% dim it : set it = Model.Kit.Iterator %> | |||
| <% dim Kit %> | |||
| <% While it.HasNext %> | |||
| <% set Kit = it.GetNext() %> | |||
| <tr> | |||
| <td> | |||
| <%= HTML.LinkToExt("<i class='bi bi-search'></i>", "Kit", "SwitchBoardPurpleEnvelopeEdit", Array("Id", Kit.ID), Array("class", "btn btn-primary")) %> | |||
| </td> | |||
| <td><% = H(Kit.JobNumber) %></td> | |||
| <td><% = H(Kit.Jurisdiction) %></td> | |||
| <td><% = H(Kit.LabelCount) %></td> | |||
| <td><% = H(Kit.CreatedOn) %></td> | |||
| <td><% = H(Kit.ExportedToSnailWorks) %></td> | |||
| <td><% = H(Kit.InkJetJob) %></td> | |||
| <td><% = H(Kit.Filename) %></td> | |||
| <td><% = H(Kit.Cass) %></td> | |||
| <td><% = H(Kit.Status) %></td> | |||
| </tr> | |||
| <% Wend %> | |||
| </tbody> | |||
| </table> | |||
| <div> | |||
| <% If Model.CurrentPageNumber <> 1 then %> | |||
| <%= HTML.LinkToExt("<i class='bi bi-chevron-left'></i><i class='bi bi-chevron-left'></i>", MVC.ControllerName, MVC.ActionName, Array("page_num", 1,"q", Choice(Request.Form.Count = 0,Request.QueryString("q"),Request.Form("q"))), Array("class", "btn btn-default")) %> | |||
| | |||
| <%= HTML.LinkToExt("<i class='bi bi-chevron-left'></i>", MVC.ControllerName, MVC.ActionName, Array("page_num", Model.CurrentPageNumber - 1,"q", Choice(Request.Form.Count = 0,Request.QueryString("q"),Request.Form("q"))), Array("class", "btn btn-default")) %> | |||
| | |||
| <% Else %> | |||
| <a class='btn btn-default disabled'><i class='bi bi-chevron-left'></i><i class='bi bi-chevron-left'></i></a> | |||
| | |||
| <a class='btn btn-default disabled'><i class='bi bi-chevron-left'></i></a> | |||
| | |||
| <% End If %> | |||
| <% If CInt(Model.CurrentPageNumber) < CInt(Model.PageCount) then %> | |||
| <%= HTML.LinkToExt("<i class='bi bi-chevron-right'></i>", MVC.ControllerName, MVC.ActionName, Array("page_num", Model.CurrentPageNumber + 1,"q", Choice(Request.Form.Count = 0,Request.QueryString("q"),Request.Form("q"))), Array("class", "btn btn-default")) %> | |||
| | |||
| <%= HTML.LinkToExt("<i class='bi bi-chevron-right'></i><i class='bi bi-chevron-right'></i>", MVC.ControllerName, MVC.ActionName, Array("page_num", Model.PageCount,"q", Choice(Request.Form.Count = 0,Request.QueryString("q"),Request.Form("q"))), Array("class", "btn btn-default")) %> | |||
| | |||
| <% Else %> | |||
| <a class='btn btn-default disabled'><i class='bi bi-chevron-right'></i><i class='bi bi-chevron-right'></i></a> | |||
| | |||
| <a class='btn btn-default disabled'><i class='bi bi-chevron-right'></i></a> | |||
| | |||
| <% End If %> | |||
| </div> | |||
| </div> | |||
| @@ -72,16 +72,26 @@ Sub CloneRepo | |||
| objFile.WriteLine("MVC/") | |||
| objFile.WriteLine("Dependancies/") | |||
| objFile.WriteLine("index.asp") | |||
| objFile.WriteLine("web.config" | |||
| objFile.WriteLine("web.config") | |||
| WshShell.Exec("git pull origin master") | |||
| objFile.Close | |||
| WScript.Sleep 10000 | |||
| Do until fso.FileExists(DeployRoot & "test\App\app.config.asp") | |||
| WScript.Sleep 250 | |||
| Loop | |||
| Set objFile = fso.OpenTextFile(DeployRoot & "test\App\app.config.asp",1) | |||
| Dim readConfigFile:readConfigFile = objFile.ReadAll | |||
| objFile.Close | |||
| Dim devToFalseSetting:devToFalseSetting = Replace(readConfigFile,"dev = true","dev = false") | |||
| Set objFile = fso.OpenTextFile(DeployRoot & "test\App\app.config.asp",2) | |||
| objFile.Write(devToFalseSetting) | |||
| objFile.Close | |||
| End Sub | |||
| '"F:\Development\Tracking_Kits\CiCd\test\App\app.config.asp" | |||
| '"F:\Development\Tracking_Kits\CiCd\test\App\app.config.asp" | |||
| 'C:\Windows\System32\inetsrv\appcmd.exe stop apppool /apppool.name:tracking | |||
| 'C:\Windows\System32\inetsrv\appcmd.exe stop site /site.name:tracking | |||
| 'C:\Windows\System32\inetsrv\appcmd.exe start apppool /apppool.name:tracking | |||
| 'C:\Windows\System32\inetsrv\appcmd.exe start site /site.name:tracking | |||
| 'nircmd.exe elevatecmd runassystem | |||
| @@ -0,0 +1,24 @@ | |||
| <% | |||
| Class Migration_13_Alter_Kit_Table_With_File_Cass | |||
| Public Migration | |||
| Public Sub Up | |||
| Migration.Do "ALTER TABLE [Kit] " &_ | |||
| "ADD [Filename] VARCHAR(100);" | |||
| Migration.Do "ALTER TABLE [Kit] " &_ | |||
| "ADD [Cass] BIT DEFAULT '0';" | |||
| Migration.Do "ALTER TABLE [Kit] " &_ | |||
| "ADD [Status] VARCHAR(100);" | |||
| End Sub | |||
| Public Sub Down | |||
| Migration.Do "ALTER TABLE [Kit] " &_ | |||
| "DROP COLUMN [Filename];" | |||
| Migration.Do "ALTER TABLE [Kit] " &_ | |||
| "DROP COLUMN [Cass];" | |||
| Migration.Do "ALTER TABLE [Kit] " &_ | |||
| "DROP COLUMN [Status];" | |||
| End Sub | |||
| End Class | |||
| Migrations.Add "Migration_13_Alter_Kit_Table_With_File_Cass" | |||
| %> | |||
| @@ -41,6 +41,7 @@ Migrations.Tracing = false | |||
| <!--#include file="Migration_10_Alter_Tables_For_Relations.asp"--> | |||
| <!--#include file="Migration_11_Alter_Tables_For_Relations_FK.asp"--> | |||
| <!--#include file="Migration_12_Alter_Kit_Table_With_Type.asp"--> | |||
| <!--#include file="Migration_13_Alter_Kit_Table_With_File_Cass.asp"--> | |||
| <% | |||
| Sub HandleMigration | |||
| putl "<b>Starting Version: " & Migrations.Version & "</b>" | |||
Powered by TurnKey Linux.