| @@ -33,6 +33,31 @@ Class KitController | |||
| Model.RecordCount = record_count | |||
| %> <!--#include file="../../Views/Kit/SwitchBoardPurpleEnvelopeIndex.asp"--> <% | |||
| End Sub | |||
| Public Sub SwitchBoardPurpleEnvelopeEditPost | |||
| MVC.RequirePost | |||
| HTMLSecurity.OnInvalidAntiCsrfTokenRedirectToActionExt "KitEditForm", Request.Form("nonce"), "Edit", Array("Id", Request.Form("Id")) | |||
| dim ID : ID = Request.Form("Id") | |||
| dim model : set model = KitRepository.SwitchBoardPurpleEnvelopeEditFindById(ID) | |||
| set model = Automapper.AutoMap(Request.Form, model) | |||
| if Request.Form("InBoundTracking") = "on" Then | |||
| model.InboundSTID = SettingsRepository.FindByName("Inbound STID") | |||
| end if | |||
| model.Status = "Ready to Assign Labels" | |||
| 'model.Validate | |||
| 'If model.Validator.HasErrors then | |||
| FormCache.SerializeForm "EditKit", Request.Form | |||
| ' Flash.Errors = model.Validator.Errors | |||
| ' MVC.RedirectToActionExt "Edit", Array("Id",ID) | |||
| 'Else | |||
| KitRepository.Update model | |||
| FormCache.ClearForm "EditKit" | |||
| Flash.Success = "Kit updated." | |||
| MVC.RedirectToAction "Index" | |||
| 'End If | |||
| End Sub | |||
| Public Sub SwitchBoardPurpleEnvelopeEdit | |||
| @@ -40,6 +65,7 @@ Class KitController | |||
| set Model = new SwitchBoard_ViewModel_Class | |||
| set Model.Kit = KitRepository.SwitchBoardPurpleEnvelopeEditFindById(id) | |||
| set Model.Labels = InkjetRecordsRepository.Find(Array("KitId =?",id),empty) | |||
| set Model.StidDropDown = SettingsRepository.GetStidDropDownRS() | |||
| Model.Title = "Purple Envelopes for " | |||
| HTMLSecurity.SetAntiCSRFToken "KitEditForm" | |||
| %> <!--#include file="../../Views/Kit/SwitchBoardPurpleEnvelopeEdit.asp"--> <% | |||
| @@ -24,6 +24,7 @@ Class IndexKitModel_Class | |||
| Public ID | |||
| Public JobNumber '90 | |||
| Public Jcode | |||
| Public Jurisdiction '106 | |||
| Public LabelCount '106 | |||
| Public CreatedOn | |||
| @@ -34,10 +35,12 @@ Class IndexKitModel_Class | |||
| Public Filename | |||
| Public Cass | |||
| Public Status | |||
| Public OutboundSTID | |||
| Public InboundSTID | |||
| Private Sub Class_Initialize | |||
| 'ValidateExitsts Me, "","" | |||
| Class_Get_Properties = Array("ID, JobNumber, Jurisdiction,LabelCount,CreatedOn,LabelsPrinted,ExportedToSnailWorks,InkJetJob,JobType,Filename,Cass,Status") | |||
| Class_Get_Properties = Array("ID, JobNumber,Jcode, Jurisdiction,LabelCount,CreatedOn,LabelsPrinted,ExportedToSnailWorks,InkJetJob,JobType,Filename,Cass,Status,OutboundSTID,InboundSTID") | |||
| End Sub | |||
| End Class | |||
| @@ -49,10 +52,10 @@ End Class | |||
| Class KitRepository_Class | |||
| Public Function PagedPurpleEnvelopsIndexView(per_page, page_num, ByRef page_count, ByRef record_count) | |||
| dim sql : sql = "SELECT Kit.ID,Kit.JobNumber as [JobNumber], " &_ | |||
| dim sql : sql = "SELECT Kit.ID,Kit.JobNumber as [JobNumber],Kit.JCode, " &_ | |||
| "Jurisdiction.Name As Jurisdiction," &_ | |||
| "(SELECT COUNT(*) From InkjetRecords Where KitId = Kit.ID)" &_ | |||
| " 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';" | |||
| " As [LabelCount],[CreatedOn],[LabelsPrinted],[ExportedToSnailWorks],[InkJetJob],[JobType],[Filename],[Cass],[Status],[OutboundSTID],[InboundSTID] 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) | |||
| @@ -103,7 +106,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 " &_ | |||
| " As [LabelCount],[CreatedOn],[LabelsPrinted],[ExportedToSnailWorks],[JobType],[Status] FROM Kit INNER JOIN Jurisdiction ON Kit.Jcode = Jurisdiction.JCode " &_ | |||
| "WHERE ID = ? AND Kit.JobType = 'Labels'" | |||
| dim rs : set rs = DAL.Query(sql,ID) | |||
| @@ -117,10 +120,10 @@ Class KitRepository_Class | |||
| End Function | |||
| Public Function SwitchBoardPurpleEnvelopeEditFindById(ID) | |||
| dim sql : sql = "SELECT Kit.ID,Kit.JobNumber as [JobNumber], " &_ | |||
| dim sql : sql = "SELECT Kit.ID,Kit.JobNumber as [JobNumber],Kit.JCode, " &_ | |||
| "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 " &_ | |||
| " As [LabelCount],[CreatedOn],[LabelsPrinted],[ExportedToSnailWorks],[JobType],[Status],[OutboundSTID],[InboundSTID] FROM Kit INNER JOIN Jurisdiction ON Kit.Jcode = Jurisdiction.JCode " &_ | |||
| "WHERE ID = ? " | |||
| dim rs : set rs = DAL.Query(sql,ID) | |||
| @@ -310,11 +313,17 @@ Class KitRepository_Class | |||
| Public Sub Update(model) | |||
| dim sql : sql = "UPDATE [Kit] SET [JobNumber] = ?," &_ | |||
| "[Jcode] = ?" &_ | |||
| "[Jcode] = ?," &_ | |||
| "[Status] = ?," &_ | |||
| "[OutboundSTID] = ?," &_ | |||
| "[InboundSTID] = ?" &_ | |||
| " WHERE [ID] = ?" | |||
| DAL.Execute sql, Array(model.JobNumber, _ | |||
| model.Jcode, _ | |||
| model.Status, _ | |||
| model.OutboundSTID, _ | |||
| model.InboundSTID, _ | |||
| model.ID) | |||
| End Sub | |||
| @@ -24,6 +24,13 @@ End CLass | |||
| Class SettingsRepository_Class | |||
| Public Function GetStidDropDownRS() | |||
| dim sql : sql = "Select RIGHT([Name],LEN(NAME)-6) & ' ' & [STID] as [OPTION] ,[Value] AS [STID] from Settings WHERE [Name] LIKE '(STID)%'" | |||
| dim rs : set rs = DAL.Query(sql,empty) | |||
| set GetStidDropDownRS = rs | |||
| End Function | |||
| Public Function FindByID(ID) | |||
| dim sql : sql = "Select [ID], [Name], [Value] FROM [Settings] WHERE ID = ?" | |||
| dim rs : set rs = DAL.Query(sql,ID) | |||
| @@ -34,6 +41,17 @@ Class SettingsRepository_Class | |||
| End If | |||
| End Function | |||
| Public Function FindByName(Name) | |||
| dim sql : sql = "Select [Value] FROM [Settings] WHERE [Name] = ?" | |||
| dim rs : set rs = DAL.Query(sql,Name) | |||
| If rs.EOF then | |||
| Err.Raise 1, "SettingsRepository_Class", SettingsNotFoundException("Name", Name) | |||
| Else | |||
| FindByName = rs(0).Value | |||
| End If | |||
| End Function | |||
| Public Function GetAll(orderBy) | |||
| set GetAll = Find(empty,orderBy) | |||
| End Function | |||
| @@ -19,6 +19,7 @@ Class SwitchBoard_ViewModel_Class | |||
| Public Title | |||
| Public Kit | |||
| Public Labels | |||
| Public StidDropDown | |||
| End Class | |||
| Class SwitchBoard_PurpleEnvelopesViewModel_Class | |||
| @@ -9,6 +9,19 @@ | |||
| <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> | |||
| <% IF Model.Kit.Status = "Ready To Assign STIDS" THEN %> | |||
| <p><strong>Select Outbound STID:</strong></p> | |||
| <%= HTML.FormTag("Kit","SwitchBoardPurpleEnvelopeEditPost",empty,empty) %> | |||
| <%= HTML.Hidden("nonce", HTMLSecurity.GetAntiCSRFToken("KitEditForm")) %> | |||
| <%= HTML.Hidden("Id", Model.Kit.ID) %> | |||
| <%= HTML.DropDownListExt("OutboundSTID","hmm",Model.StidDropDown,"STID","OPTION",Array("Class","form-select")) %> | |||
| <p></p> | |||
| <%= HTML.Checkbox("InBoundTracking",0) %> Inbound Tracking | |||
| <p></p> | |||
| <%= HTML.Button("submit", "<i class='glyphicon glyphicon-ok'></i> Save", "btn-primary") %> | |||
| </form> | |||
| <p></p> | |||
| <% END IF %> | |||
| <button class="btn btn-primary" id="toggleChild">Show Label Records</button> | |||
| </div> | |||
| </div> | |||
| @@ -33,6 +33,8 @@ | |||
| <th style="text-align: left">Import File</th> | |||
| <th style="text-align: left">Has Been Cassed</th> | |||
| <th style="text-align: left">Status</th> | |||
| <th style="text-align: left">Outbound STID</th> | |||
| <th style="text-align: left">Inbound STID</th> | |||
| </tr> | |||
| </thead> | |||
| <tbody> | |||
| @@ -53,6 +55,8 @@ | |||
| <td><% = H(Kit.Filename) %></td> | |||
| <td><% = H(Kit.Cass) %></td> | |||
| <td><% = H(Kit.Status) %></td> | |||
| <td><% = H(Kit.OutboundSTID) %></td> | |||
| <td><% = H(Kit.InboundSTID) %></td> | |||
| </tr> | |||
| <% Wend %> | |||
| @@ -42,6 +42,7 @@ Migrations.Tracing = false | |||
| <!--#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"--> | |||
| <!--#include file="Migration_14_Alter_Kit_Table_With_STIDS.asp"--> | |||
| <% | |||
| Sub HandleMigration | |||
| putl "<b>Starting Version: " & Migrations.Version & "</b>" | |||
| @@ -173,6 +173,7 @@ Sub ImportCass | |||
| Next | |||
| oConn.Execute("UPDATE Kit SET Status ='Ready To Assign STIDS' WHERE ID =" & KitID & ";") | |||
| oConn.Execute("UPDATE Kit SET [Cass] = 1 WHERE ID =" & KitID & ";") | |||
| End Sub | |||
| Sub RunMailManager | |||
Powered by TurnKey Linux.