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 @@ +
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 %>
+ ++ | Job Number | +Jurisdiction | +Number of Labels | +Created On | +SnailWorks Export Date | +Inkjet File Created | +Import File | +Has Been Cassed | +Status | +
---|---|---|---|---|---|---|---|---|---|
+ <%= 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) %> | + +