diff --git a/App/Controllers/Kit/KitController.asp b/App/Controllers/Kit/KitController.asp index 3961e58..af2e14e 100644 --- a/App/Controllers/Kit/KitController.asp +++ b/App/Controllers/Kit/KitController.asp @@ -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 - %> <% + %> <% 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" + %> <% + End Sub + Public Sub Index dim page_size : page_size = 10 diff --git a/App/DomainModels/KitRepository.asp b/App/DomainModels/KitRepository.asp index 98bbbe5..389bad5 100644 --- a/App/DomainModels/KitRepository.asp +++ b/App/DomainModels/KitRepository.asp @@ -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) diff --git a/App/ScaffoldRepo.vbs b/App/ScaffoldRepo.vbs index 2c88580..2d54954 100644 --- a/App/ScaffoldRepo.vbs +++ b/App/ScaffoldRepo.vbs @@ -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) diff --git a/App/Views/Kit/SwitchBoardPurpleEnvelopeEdit.asp b/App/Views/Kit/SwitchBoardPurpleEnvelopeEdit.asp new file mode 100644 index 0000000..e0cda70 --- /dev/null +++ b/App/Views/Kit/SwitchBoardPurpleEnvelopeEdit.asp @@ -0,0 +1,86 @@ +

<%= H(Model.Title & " " & Model.Kit.Jurisdiction) %>

+ <%= HTML.Hidden("nonce", HTMLSecurity.GetAntiCSRFToken("KitEditForm")) %> + <%= HTML.Hidden("Id", Model.Kit.ID) %> +
+
+

Job Number: <%= Model.Kit.JobNumber %>

+

Jurisdiction: <%= Model.Kit.Jurisdiction %>

+

Label Count: <%= Model.Kit.LabelCount %>

+

Created On: <%= Model.Kit.CreatedOn %>

+

Labels Printed On : <%= Model.Kit.LabelsPrinted %>

+

Exported to SnailWorks On: <%= Model.Kit.ExportedToSnailWorks %>

+ +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <% dim it : set it = Model.Labels.Iterator %> + <% dim KitLabels %> + <% While it.HasNext %> + <% set KitLabels = it.GetNext() %> + + + + + + + + + + + + + <% Wend %> + + +
+
+ \ No newline at end of file diff --git a/App/Views/Kit/SwitchBoardPurpleEnvelopeIndex.asp b/App/Views/Kit/SwitchBoardPurpleEnvelopeIndex.asp new file mode 100644 index 0000000..38b2afb --- /dev/null +++ b/App/Views/Kit/SwitchBoardPurpleEnvelopeIndex.asp @@ -0,0 +1,85 @@ +

<%= H(Model.Title) %>

+
+
+ <%= H(Model.RecordCount) %> Kit found. Showing <%= H(Model.PageSize) %> records per page. + <%'= HTML.LinkToExt(" New","Kit", "Create", empty, Array("class", "btn btn-xs btn-primary")) %> +
+
+ + <%= HTML.FormTag("Kit", "Search", empty, empty) %> + +
+ +
+ + +
+
+ + +
+
+ + + + + + + + + + + + + + + + + <% dim it : set it = Model.Kit.Iterator %> + <% dim Kit %> + <% While it.HasNext %> + <% set Kit = it.GetNext() %> + + + + + + + + + + + + + + <% Wend %> + +
Job NumberJurisdictionNumber of LabelsCreated OnSnailWorks Export DateInkjet File CreatedImport FileHas Been CassedStatus
+ <%= HTML.LinkToExt("", "Kit", "SwitchBoardPurpleEnvelopeEdit", Array("Id", Kit.ID), Array("class", "btn btn-primary")) %> + <% = H(Kit.JobNumber) %><% = H(Kit.Jurisdiction) %><% = H(Kit.LabelCount) %><% = H(Kit.CreatedOn) %><% = H(Kit.ExportedToSnailWorks) %><% = H(Kit.InkJetJob) %><% = H(Kit.Filename) %><% = H(Kit.Cass) %><% = H(Kit.Status) %>
+
+ <% If Model.CurrentPageNumber <> 1 then %> + <%= HTML.LinkToExt("", 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("", 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 %> + +   + +   + <% End If %> + <% If CInt(Model.CurrentPageNumber) < CInt(Model.PageCount) then %> + <%= HTML.LinkToExt("", 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("", 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 %> + +   + +   +<% End If %> +
+ diff --git a/CiCd/deploy.vbs b/CiCd/deploy.vbs index 97282fc..422404b 100644 --- a/CiCd/deploy.vbs +++ b/CiCd/deploy.vbs @@ -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" \ No newline at end of file +'"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 \ No newline at end of file diff --git a/Data/Migrations/Migration_13_Alter_Kit_Table_With_File_Cass.asp b/Data/Migrations/Migration_13_Alter_Kit_Table_With_File_Cass.asp new file mode 100644 index 0000000..34e42d4 --- /dev/null +++ b/Data/Migrations/Migration_13_Alter_Kit_Table_With_File_Cass.asp @@ -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" + %> \ No newline at end of file diff --git a/Data/Migrations/migrate.asp b/Data/Migrations/migrate.asp index 7c37604..680d744 100644 --- a/Data/Migrations/migrate.asp +++ b/Data/Migrations/migrate.asp @@ -41,6 +41,7 @@ Migrations.Tracing = false + <% Sub HandleMigration putl "Starting Version: " & Migrations.Version & "" diff --git a/Dependancies/nircmd.exe b/Dependancies/nircmd.exe new file mode 100644 index 0000000..82da758 Binary files /dev/null and b/Dependancies/nircmd.exe differ diff --git a/Dependancies/nircmdc.exe b/Dependancies/nircmdc.exe new file mode 100644 index 0000000..9c9a343 Binary files /dev/null and b/Dependancies/nircmdc.exe differ