diff --git a/App/Controllers/InkjetRecords/InkjetRecordsController.asp b/App/Controllers/InkjetRecords/InkjetRecordsController.asp new file mode 100644 index 0000000..654113b --- /dev/null +++ b/App/Controllers/InkjetRecords/InkjetRecordsController.asp @@ -0,0 +1,129 @@ +<% Option Explicit %> + + +<% +Class InkjetRecordsController + Public Model + + Public Sub Index + + dim page_size : page_size = 10 + 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 PagedIndex_ViewModel_Class + Model.Title = "InkjetRecords" + set Model.InkjetRecords = InkjetRecordsRepository.FindPaged(empty, "ID", 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 Search + + dim searchValue:searchValue = Choice(Request.Form.Count = 0,Request.QueryString("q"),Request.Form("q")) + dim page_size : page_size = 10 + 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 PagedIndex_ViewModel_Class + Model.Title = "InkjetRecords" + set Model.InkjetRecords = InkjetRecordsRepository.SearchTablePaged(Array("ID","%" & searchValue & "%","KitID","%" & searchValue & "%","VOTERID","%" & searchValue & "%","LASTNAME","%" & searchValue & "%","FIRSTNAME","%" & searchValue & "%","MIDDLENAME","%" & searchValue & "%","SUFFIX","%" & searchValue & "%","PRECINCT","%" & searchValue & "%","ADDRESS1","%" & searchValue & "%","ADDRESS2","%" & searchValue & "%","ADDRESS3","%" & searchValue & "%","ADDRESS4","%" & searchValue & "%","ADDRESS5","%" & searchValue & "%","APPSENT","%" & searchValue & "%","APPRETURNED","%" & searchValue & "%","BALSENT","%" & searchValue & "%","BALRETURNED","%" & searchValue & "%","CountingBoard","%" & searchValue & "%","UOCAVASTATUS","%" & searchValue & "%","EMAILADDRESS","%" & searchValue & "%","PHONENUMBER","%" & searchValue & "%","BALLOT_NUMBER","%" & searchValue & "%","CassADDRESS1","%" & searchValue & "%","CassADDRESS2","%" & searchValue & "%","CassADDRESS3","%" & searchValue & "%","CassADDRESS4","%" & searchValue & "%","CassADDRESS5","%" & searchValue & "%"),"ID", 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 Edit + + dim id : id = Request.QueryString("Id") + set Model = new Edit_ViewModel_Class + set Model.InkjetRecords = InkjetRecordsRepository.FindByID(id) + Model.Title = "Edit InkjetRecords" + HTMLSecurity.SetAntiCSRFToken "InkjetRecordsEditForm" + %> <% + Flash.Success = "InkjetRecords Updated." + End Sub + + Public Sub EditPost + MVC.RequirePost + HTMLSecurity.OnInvalidAntiCsrfTokenRedirectToActionExt "InkjetRecordsEditForm", Request.Form("nonce"), "Edit", Array("Id", Request.Form("Id")) + dim ID : ID = Request.Form("Id") + dim model : set model = InkjetRecordsRepository.FindByID(ID) + set model = Automapper.AutoMap(Request.Form, model) + 'model.Validate + 'If model.Validator.HasErrors then + FormCache.SerializeForm "EditInkjetRecords", Request.Form + ' Flash.Errors = model.Validator.Errors + ' MVC.RedirectToActionExt "Edit", Array("Id",ID) + 'Else + InkjetRecordsRepository.Update model + FormCache.ClearForm "EditInkjetRecords" + Flash.Success = "InkjetRecords updated." + MVC.RedirectToAction "Index" + 'End If + End Sub + + Public Sub Create + + dim form_params : set form_params = FormCache.DeserializeForm("NewInkjetRecords") + If Not form_params Is Nothing then + set Model = Automapper.AutoMap(form_params, New Create_ViewModel_Class) + Else + set Model = new Create_ViewModel_Class + End If + + HTMLSecurity.SetAntiCSRFToken "InkjetRecordsCreateForm" + + %> <% + End Sub + + Public Sub CreatePost + + MVC.RequirePost + HtmlSecurity.OnInvalidAntiCSRFTokenRedirectToAction "InkjetRecordsCreateForm", Request.Form("nonce"), "Create" + + dim new_InkjetRecords_model : set new_InkjetRecords_model = Automapper.AutoMap(Request.Form, new InkjetRecordsModel_Class) + + 'new_InkjetRecords_model.Validator.Validate + + 'If new_InkjetRecords_model.Validator.HasErrors then + ' FormCache.SerializeForm "NewInkjetRecords", Request.Form + ' Flash.Errors = new_InkjetRecords_model.Validator.Errors + ' MVC.RedirectToAction "Create" + 'Else + InkjetRecordsRepository.AddNew new_InkjetRecords_model + ' FormCache.ClearForm "NewInkjetRecords" + Flash.Success = "InkjetRecords added." + MVC.RedirectToAction "Index" + 'End If + End Sub + + Public Sub Delete + dim id : id = Request.QueryString("Id") + set Model = new Delete_ViewModel_Class + set Model.InkjetRecords = InkjetRecordsRepository.FindByID(id) + Model.Title = "Delete InkjetRecords" + + HTMLSecurity.SetAntiCSRFToken "InkjetRecordsDeleteForm" + + %> <% + End Sub + + Public Sub DeletePost + MVC.RequirePost + HtmlSecurity.OnInvalidAntiCSRFTokenRedirectToAction "InkjetRecordsDeleteForm", Request.Form("nonce"), "Create" + + dim id : id = Request.Form("Id") + InkjetRecordsRepository.Delete id + + Flash.Success = "InkjetRecords deleted." + MVC.RedirectToAction "Index" + End Sub + +End Class +MVC.Dispatch +%> diff --git a/App/Controllers/Kit/KitController.asp b/App/Controllers/Kit/KitController.asp index f6df8f1..3961e58 100644 --- a/App/Controllers/Kit/KitController.asp +++ b/App/Controllers/Kit/KitController.asp @@ -17,8 +17,23 @@ Class KitController Model.PageCount = page_count Model.RecordCount = record_count %> <% + End Sub + + Public Sub SwitchBoardPurpleEnvelopsIndex + dim page_size : page_size = 10 + 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" + 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 Index dim page_size : page_size = 10 diff --git a/App/DomainModels/InkjetRecordsRepository.asp b/App/DomainModels/InkjetRecordsRepository.asp new file mode 100644 index 0000000..9556ae1 --- /dev/null +++ b/App/DomainModels/InkjetRecordsRepository.asp @@ -0,0 +1,342 @@ +<% +'======================================================================================================================= +' InkjetRecords Model +'======================================================================================================================= + +Class InkjetRecordsModel_Class + Public Validator + Public Class_Get_Properties + + Public ID '90 + Public KitID '122 + Public VOTERID '106 + Public LASTNAME '106 + Public FIRSTNAME '106 + Public MIDDLENAME '106 + Public SUFFIX '106 + Public PRECINCT '106 + Public ADDRESS1 '106 + Public ADDRESS2 '106 + Public ADDRESS3 '106 + Public ADDRESS4 '106 + Public ADDRESS5 '106 + Public APPSENT '106 + Public APPRETURNED '106 + Public BALSENT '106 + Public BALRETURNED '106 + Public CountingBoard '106 + Public UOCAVASTATUS '106 + Public EMAILADDRESS '106 + Public PHONENUMBER '106 + Public BALLOT_NUMBER '106 + Public CassADDRESS1 '106 + Public CassADDRESS2 '106 + Public CassADDRESS3 '106 + Public CassADDRESS4 '106 + Public CassADDRESS5 '106 + + Private Sub Class_Initialize + 'ValidateExitsts Me, "","" + Class_Get_Properties = Array("ID, KitID, VOTERID, LASTNAME, FIRSTNAME, MIDDLENAME, SUFFIX, PRECINCT, ADDRESS1, ADDRESS2, ADDRESS3, ADDRESS4, ADDRESS5, APPSENT, APPRETURNED, BALSENT, BALRETURNED, CountingBoard, UOCAVASTATUS, EMAILADDRESS, PHONENUMBER, BALLOT_NUMBER, CassADDRESS1, CassADDRESS2, CassADDRESS3, CassADDRESS4, CassADDRESS5") + End Sub + +End CLass + +'======================================================================================================================= +' InkjetRecords Repository +'======================================================================================================================= + +Class InkjetRecordsRepository_Class + + Public Function FindByID(ID) + dim sql : sql = "Select [ID], [KitID], [VOTERID], [LASTNAME], [FIRSTNAME], [MIDDLENAME], [SUFFIX], [PRECINCT], [ADDRESS1], [ADDRESS2], [ADDRESS3], [ADDRESS4], [ADDRESS5], [APPSENT], [APPRETURNED], [BALSENT], [BALRETURNED], [CountingBoard], [UOCAVASTATUS], [EMAILADDRESS], [PHONENUMBER], [BALLOT_NUMBER], [CassADDRESS1], [CassADDRESS2], [CassADDRESS3], [CassADDRESS4], [CassADDRESS5] FROM [InkjetRecords] WHERE ID = ?" + dim rs : set rs = DAL.Query(sql,ID) + If rs.EOF then + Err.Raise 1, "InkjetRecordsRepository_Class", InkjetRecordsNotFoundException("ID", ID) + Else + set FindByID = Automapper.AutoMap(rs,"InkjetRecordsModel_Class") + End If + End Function + + Public Function GetAll(orderBy) + set GetAll = Find(empty,orderBy) + End Function + + Public Function Find(where_kvarray, order_string_or_array) + dim sql : sql = "Select [ID], [KitID], [VOTERID], [LASTNAME], [FIRSTNAME], [MIDDLENAME], [SUFFIX], [PRECINCT], [ADDRESS1], [ADDRESS2], [ADDRESS3], [ADDRESS4], [ADDRESS5], [APPSENT], [APPRETURNED], [BALSENT], [BALRETURNED], [CountingBoard], [UOCAVASTATUS], [EMAILADDRESS], [PHONENUMBER], [BALLOT_NUMBER], [CassADDRESS1], [CassADDRESS2], [CassADDRESS3], [CassADDRESS4], [CassADDRESS5] FROM [InkjetRecords]" + + If Not IsEmpty(where_kvarray) then + sql = sql & " WHERE " + dim where_keys, where_values + KVUnzip where_kvarray, where_keys, where_values + + dim i + For i = 0 to UBound(where_keys) + If i > 0 then sql = sql & " AND " + sql = sql & " " & where_keys(i) & " " + Next + End If + + If Not IsEmpty(order_string_or_array) then + sql = sql & "ORDER BY " + If IsArray(order_string_or_array) then + dim order_array : order_array = order_string_or_array + For i = 0 to UBound(order_array) + If i > 0 then sql = sql & ", " + sql = sql & " " & order_array(i) + Next + Else + sql = sql & order_string_or_array & " " + End If + End If + + dim rs : set rs = DAL.Query(sql, where_values) + set Find = InkjetRecordsList(rs) + Destroy rs + End Function + + Public Function FindPaged(where_kvarray, order_string_or_array, per_page, page_num, ByRef page_count, ByRef record_count) + dim sql : sql = "Select [ID], [KitID], [VOTERID], [LASTNAME], [FIRSTNAME], [MIDDLENAME], [SUFFIX], [PRECINCT], [ADDRESS1], [ADDRESS2], [ADDRESS3], [ADDRESS4], [ADDRESS5], [APPSENT], [APPRETURNED], [BALSENT], [BALRETURNED], [CountingBoard], [UOCAVASTATUS], [EMAILADDRESS], [PHONENUMBER], [BALLOT_NUMBER], [CassADDRESS1], [CassADDRESS2], [CassADDRESS3], [CassADDRESS4], [CassADDRESS5] FROM [InkjetRecords]" + + If Not IsEmpty(where_kvarray) then + sql = sql & " WHERE " + dim where_keys, where_values + KVUnzip where_kvarray, where_keys, where_values + + dim i + For i = 0 to UBound(where_keys) + If i > 0 then sql = sql & " AND " + sql = sql & " " & where_keys(i) & " " + Next + End If + + If Not IsEmpty(order_string_or_array) then + sql = sql & "ORDER BY " + If IsArray(order_string_or_array) then + dim order_array : order_array = order_string_or_array + For i = 0 to UBound(order_array) + If i > 0 then sql = sql & ", " + sql = sql & " " & order_array(i) + Next + Else + sql = sql & order_string_or_array & " " + End If + End If + + dim list : set list = new LinkedList_Class + dim rs : set rs = DAL.PagedQuery(sql, where_values, per_page, page_num) + + If Not rs.EOF and Not (IsEmpty(per_page) and IsEmpty(page_num) and IsEmpty(page_count) and IsEmpty(record_count)) then + rs.PageSize = per_page + rs.AbsolutePage = page_num + page_count = rs.PageCount + record_count = rs.RecordCount + End If + + set FindPaged = PagedInkjetRecordsList(rs, per_page) + Destroy rs + End Function + + Public Function SearchTablePaged(where_kvarray, order_string_or_array, per_page, page_num, ByRef page_count, ByRef record_count) + dim sql : sql = "Select [ID], [KitID], [VOTERID], [LASTNAME], [FIRSTNAME], [MIDDLENAME], [SUFFIX], [PRECINCT], [ADDRESS1], [ADDRESS2], [ADDRESS3], [ADDRESS4], [ADDRESS5], [APPSENT], [APPRETURNED], [BALSENT], [BALRETURNED], [CountingBoard], [UOCAVASTATUS], [EMAILADDRESS], [PHONENUMBER], [BALLOT_NUMBER], [CassADDRESS1], [CassADDRESS2], [CassADDRESS3], [CassADDRESS4], [CassADDRESS5] FROM [InkjetRecords]" + + If Not IsEmpty(where_kvarray) then + sql = sql & " WHERE " + dim where_keys, where_values + KVUnzip where_kvarray, where_keys, where_values + + dim i + For i = 0 to UBound(where_keys) + If i > 0 then sql = sql & " OR" + sql = sql & " " & where_keys(i) & " LIKE ?" + Next + End If + + If Not IsEmpty(order_string_or_array) then + sql = sql & " ORDER BY " + If IsArray(order_string_or_array) then + dim order_array : order_array = order_string_or_array + For i = 0 to UBound(order_array) + If i > 0 then sql = sql & ", " + sql = sql & " " & order_array(i) + Next + Else + sql = sql & order_string_or_array & " " + End If + End If + + dim list : set list = new LinkedList_Class + dim rs : set rs = DAL.PagedQuery(sql, where_values, per_page, page_num) + + If Not rs.EOF and Not (IsEmpty(per_page) and IsEmpty(page_num) and IsEmpty(page_count) and IsEmpty(record_count)) then + rs.PageSize = per_page + rs.AbsolutePage = page_num + page_count = rs.PageCount + record_count = rs.RecordCount + End If + + set SearchTablePaged = PagedInkjetRecordsList(rs, per_page) + Destroy rs + End Function + + Private Function PagedInkjetRecordsList(rs, per_page) + dim list : set list = new LinkedList_Class + + dim x : x =0 + Do While x < per_page and Not rs.EOF + list.Push Automapper.AutoMap(rs, new InkjetRecordsModel_Class) + x = x +1 + rs.MoveNext + Loop + set PagedInkjetRecordsList = list + End Function + + Private Function InkjetRecordsNotFoundException(ByVal field_name, ByVal field_val) + InkjetRecordsNotFoundException = "InkjetRecords was not found with " & field_name & " of '" & field_val & "'." + End Function + + Private Function InkjetRecordsList(rs) + dim list : set list = new LinkedList_Class + dim model + + Do until rs.EOF + set model = new InkjetRecordsModel_Class + list.Push Automapper.AutoMap(rs, model) + rs.MoveNext + Loop + set InkjetRecordsList = list + End Function + + Public Sub AddNew(ByRef model) + dim sql : sql = "INSERT INTO [InkjetRecords] (" &_ + "[KitID]," &_ + "[VOTERID]," &_ + "[LASTNAME]," &_ + "[FIRSTNAME]," &_ + "[MIDDLENAME]," &_ + "[SUFFIX]," &_ + "[PRECINCT]," &_ + "[ADDRESS1]," &_ + "[ADDRESS2]," &_ + "[ADDRESS3]," &_ + "[ADDRESS4]," &_ + "[ADDRESS5]," &_ + "[APPSENT]," &_ + "[APPRETURNED]," &_ + "[BALSENT]," &_ + "[BALRETURNED]," &_ + "[CountingBoard]," &_ + "[UOCAVASTATUS]," &_ + "[EMAILADDRESS]," &_ + "[PHONENUMBER]," &_ + "[BALLOT_NUMBER]," &_ + "[CassADDRESS1]," &_ + "[CassADDRESS2]," &_ + "[CassADDRESS3]," &_ + "[CassADDRESS4]," &_ + "[CassADDRESS5])" &_ + "VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)" + DAL.Execute sql, Array(model.KitID, _ + model.VOTERID, _ + model.LASTNAME, _ + model.FIRSTNAME, _ + model.MIDDLENAME, _ + model.SUFFIX, _ + model.PRECINCT, _ + model.ADDRESS1, _ + model.ADDRESS2, _ + model.ADDRESS3, _ + model.ADDRESS4, _ + model.ADDRESS5, _ + model.APPSENT, _ + model.APPRETURNED, _ + model.BALSENT, _ + model.BALRETURNED, _ + model.CountingBoard, _ + model.UOCAVASTATUS, _ + model.EMAILADDRESS, _ + model.PHONENUMBER, _ + model.BALLOT_NUMBER, _ + model.CassADDRESS1, _ + model.CassADDRESS2, _ + model.CassADDRESS3, _ + model.CassADDRESS4, _ + model.CassADDRESS5) + sql = "SELECT TOP 1 ID FROM [InkjetRecords] ORDER BY ID DESC" + dim rs : set rs = DAL.Query(sql, empty) + model.ID = rs("ID") + Destroy rs + End Sub + + Public Sub Update(model) + dim sql : sql = "UPDATE [InkjetRecords] SET [KitID] = ?," &_ + "[VOTERID] = ?," &_ + "[LASTNAME] = ?," &_ + "[FIRSTNAME] = ?," &_ + "[MIDDLENAME] = ?," &_ + "[SUFFIX] = ?," &_ + "[PRECINCT] = ?," &_ + "[ADDRESS1] = ?," &_ + "[ADDRESS2] = ?," &_ + "[ADDRESS3] = ?," &_ + "[ADDRESS4] = ?," &_ + "[ADDRESS5] = ?," &_ + "[APPSENT] = ?," &_ + "[APPRETURNED] = ?," &_ + "[BALSENT] = ?," &_ + "[BALRETURNED] = ?," &_ + "[CountingBoard] = ?," &_ + "[UOCAVASTATUS] = ?," &_ + "[EMAILADDRESS] = ?," &_ + "[PHONENUMBER] = ?," &_ + "[BALLOT_NUMBER] = ?," &_ + "[CassADDRESS1] = ?," &_ + "[CassADDRESS2] = ?," &_ + "[CassADDRESS3] = ?," &_ + "[CassADDRESS4] = ?," &_ + "[CassADDRESS5] = ?" &_ + " WHERE [ID] = ?" + + DAL.Execute sql, Array(model.KitID, _ + model.VOTERID, _ + model.LASTNAME, _ + model.FIRSTNAME, _ + model.MIDDLENAME, _ + model.SUFFIX, _ + model.PRECINCT, _ + model.ADDRESS1, _ + model.ADDRESS2, _ + model.ADDRESS3, _ + model.ADDRESS4, _ + model.ADDRESS5, _ + model.APPSENT, _ + model.APPRETURNED, _ + model.BALSENT, _ + model.BALRETURNED, _ + model.CountingBoard, _ + model.UOCAVASTATUS, _ + model.EMAILADDRESS, _ + model.PHONENUMBER, _ + model.BALLOT_NUMBER, _ + model.CassADDRESS1, _ + model.CassADDRESS2, _ + model.CassADDRESS3, _ + model.CassADDRESS4, _ + model.CassADDRESS5, _ + model.ID) + End Sub + + Public Sub Delete(id) + dim sql : sql = "DELETE FROM [InkjetRecords] WHERE [ID] = ?" + DAL.Execute sql, id + End Sub +End Class + +dim InkjetRecordsRepository__Singleton +Function InkjetRecordsRepository() + If IsEmpty(InkjetRecordsRepository__Singleton) then + set InkjetRecordsRepository__Singleton = new InkjetRecordsRepository_Class + End If + set InkjetRecordsRepository = InkjetRecordsRepository__Singleton +End Function +%> diff --git a/App/DomainModels/KitLabelsRepository.asp b/App/DomainModels/KitLabelsRepository.asp index 3741f04..584c405 100644 --- a/App/DomainModels/KitLabelsRepository.asp +++ b/App/DomainModels/KitLabelsRepository.asp @@ -30,7 +30,9 @@ End CLass '======================================================================================================================= Class KitLabelsRepository_Class + Public Function PagedPurpleEnvelopsIndexView(where_kvarray, order_string_or_array, per_page, page_num, ByRef page_count, ByRef record_count) + End Function Public Function FindByID(ID) dim sql : sql = "Select [ID], [KitId], [OutboundSerial], [InBoundSerial], [OutboundIMB], [InBoundIMB], [OutboundIMBDigits], [InBoundIMBDigits],OutboundIMBPNG,INBOUNDIMBPNG,[SetNumber] FROM [KitLabels] WHERE ID = ?" dim rs : set rs = DAL.Query(sql,ID) diff --git a/App/DomainModels/KitRepository.asp b/App/DomainModels/KitRepository.asp index acf510d..98bbbe5 100644 --- a/App/DomainModels/KitRepository.asp +++ b/App/DomainModels/KitRepository.asp @@ -44,6 +44,27 @@ 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], " &_ + "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';" + + dim list : set list = new LinkedList_Class + dim rs : set rs = DAL.PagedQuery(sql, empty, per_page, page_num) + If Not rs.EOF and Not (IsEmpty(per_page) and IsEmpty(page_num) and IsEmpty(page_count) and IsEmpty(record_count)) then + rs.PageSize = per_page + rs.AbsolutePage = page_num + page_count = rs.PageCount + record_count = rs.RecordCount + End If + set PagedPurpleEnvelopsIndexView = PagedIndexViewKitList(rs, per_page) + Destroy rs + End Function + + + + Public Function PagedIndexView(per_page, page_num, ByRef page_count, ByRef record_count) dim sql : sql = "SELECT Kit.ID,Kit.JobNumber as [JobNumber], " &_ "Jurisdiction.Name As Jurisdiction," &_ diff --git a/App/ViewModels/InkjetRecordsViewModels.asp b/App/ViewModels/InkjetRecordsViewModels.asp new file mode 100644 index 0000000..04bf6ec --- /dev/null +++ b/App/ViewModels/InkjetRecordsViewModels.asp @@ -0,0 +1,52 @@ +<% +Class PagedIndex_ViewModel_Class + Public Title + Public InkjetRecords + + Public CurrentPageNumber + Public PageSize + Public PageCount + Public RecordCount +End Class + +Class Edit_ViewModel_Class + Public Title + Public InkjetRecords + +End Class + +Class Create_ViewModel_Class + Public KitID + Public VOTERID + Public LASTNAME + Public FIRSTNAME + Public MIDDLENAME + Public SUFFIX + Public PRECINCT + Public ADDRESS1 + Public ADDRESS2 + Public ADDRESS3 + Public ADDRESS4 + Public ADDRESS5 + Public APPSENT + Public APPRETURNED + Public BALSENT + Public BALRETURNED + Public CountingBoard + Public UOCAVASTATUS + Public EMAILADDRESS + Public PHONENUMBER + Public BALLOT_NUMBER + Public CassADDRESS1 + Public CassADDRESS2 + Public CassADDRESS3 + Public CassADDRESS4 + Public CassADDRESS5 +End Class + +Class Delete_ViewModel_Class + Public Title + Public InkjetRecords +End Class + +%> diff --git a/App/ViewModels/KitViewModels.asp b/App/ViewModels/KitViewModels.asp index 6766e88..c6634fd 100644 --- a/App/ViewModels/KitViewModels.asp +++ b/App/ViewModels/KitViewModels.asp @@ -21,6 +21,15 @@ Class SwitchBoard_ViewModel_Class Public Labels End Class +Class SwitchBoard_PurpleEnvelopesViewModel_Class + Public Title + Public Kit + + Public CurrentPageNumber + Public PageSize + Public PageCount + Public RecordCount +End Class Class Create_ViewModel_Class Public Title diff --git a/App/Views/Home/Index.asp b/App/Views/Home/Index.asp index e7c87b5..853fdaf 100644 --- a/App/Views/Home/Index.asp +++ b/App/Views/Home/Index.asp @@ -11,7 +11,7 @@ Switchboard <%= Html.LinkTOExt("Create Kit","Home","CreateKit",empty,Array("Class","list-group-item list-group-item-action")) %> <%= Html.LinkTOExt("View Tracking Kits","Kit","SwitchBoardIndex",empty,Array("Class","list-group-item list-group-item-action")) %> - <%= Html.LinkTOExt("View Purple Envelope Jobs","Kit","SwitchBoardIndex",empty,Array("Class","list-group-item list-group-item-action")) %> + <%= Html.LinkTOExt("View Purple Envelope Jobs","Kit","SwitchBoardPurpleEnvelopsIndex",empty,Array("Class","list-group-item list-group-item-action")) %> Create InkjetRecords + +<%= HTML.FormTag("InkjetRecords", "CreatePost", empty, empty) %> +<%= HTML.Hidden("nonce", HTMLSecurity.GetAntiCSRFToken("InkjetRecordsCreateForm")) %> +
+ +
+
+
+
+ + <%= HTML.TextboxExt("KitID", Model.KitID, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("VOTERID", Model.VOTERID, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("LASTNAME", Model.LASTNAME, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("FIRSTNAME", Model.FIRSTNAME, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("MIDDLENAME", Model.MIDDLENAME, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("SUFFIX", Model.SUFFIX, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("PRECINCT", Model.PRECINCT, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("ADDRESS1", Model.ADDRESS1, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("ADDRESS2", Model.ADDRESS2, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("ADDRESS3", Model.ADDRESS3, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("ADDRESS4", Model.ADDRESS4, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("ADDRESS5", Model.ADDRESS5, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("APPSENT", Model.APPSENT, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("APPRETURNED", Model.APPRETURNED, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("BALSENT", Model.BALSENT, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("BALRETURNED", Model.BALRETURNED, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("CountingBoard", Model.CountingBoard, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("UOCAVASTATUS", Model.UOCAVASTATUS, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("EMAILADDRESS", Model.EMAILADDRESS, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("PHONENUMBER", Model.PHONENUMBER, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("BALLOT_NUMBER", Model.BALLOT_NUMBER, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("CassADDRESS1", Model.CassADDRESS1, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("CassADDRESS2", Model.CassADDRESS2, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("CassADDRESS3", Model.CassADDRESS3, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("CassADDRESS4", Model.CassADDRESS4, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("CassADDRESS5", Model.CassADDRESS5, Array("class", "form-control")) %> +
+
+
+ <%= HTML.Button("submit", " Create", "btn-primary") %> +    + <%= HTML.LinkToExt(" Cancel", "InkjetRecords", "Index", empty, Array("class", "btn btn-default")) %> +
+ + diff --git a/App/Views/InkjetRecords/delete.asp b/App/Views/InkjetRecords/delete.asp new file mode 100644 index 0000000..ddbe42e --- /dev/null +++ b/App/Views/InkjetRecords/delete.asp @@ -0,0 +1,223 @@ +

<%= H(Model.Title) %>

+ +

Are you sure you want to delete this InkjetRecords?

+ +<%= HTML.FormTag("InkjetRecords", "DeletePost", empty, Array("class", "form-horizontal")) %> +<%= HTML.Hidden("nonce", HTMLSecurity.GetAntiCSRFToken("InkjetRecordsDeleteForm")) %> +<%= HTML.Hidden("Id", Model.InkjetRecords.ID) %> +
+
+ <%= HTML.Button("submit", " Confirm Delete", "btn-danger") %> +    + <%= HTML.LinkToExt("Cancel", "InkjetRecords", "Index", empty, Array("class", "btn btn-success")) %> +
+
+
+ + <%= HTML.TextboxExt("KitID", Model.InkjetRecords.KitID, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("VOTERID", Model.InkjetRecords.VOTERID, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("LASTNAME", Model.InkjetRecords.LASTNAME, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("FIRSTNAME", Model.InkjetRecords.FIRSTNAME, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("MIDDLENAME", Model.InkjetRecords.MIDDLENAME, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("SUFFIX", Model.InkjetRecords.SUFFIX, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("PRECINCT", Model.InkjetRecords.PRECINCT, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("ADDRESS1", Model.InkjetRecords.ADDRESS1, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("ADDRESS2", Model.InkjetRecords.ADDRESS2, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("ADDRESS3", Model.InkjetRecords.ADDRESS3, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("ADDRESS4", Model.InkjetRecords.ADDRESS4, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("ADDRESS5", Model.InkjetRecords.ADDRESS5, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("APPSENT", Model.InkjetRecords.APPSENT, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("APPRETURNED", Model.InkjetRecords.APPRETURNED, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("BALSENT", Model.InkjetRecords.BALSENT, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("BALRETURNED", Model.InkjetRecords.BALRETURNED, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("CountingBoard", Model.InkjetRecords.CountingBoard, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("UOCAVASTATUS", Model.InkjetRecords.UOCAVASTATUS, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("EMAILADDRESS", Model.InkjetRecords.EMAILADDRESS, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("PHONENUMBER", Model.InkjetRecords.PHONENUMBER, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("BALLOT_NUMBER", Model.InkjetRecords.BALLOT_NUMBER, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("CassADDRESS1", Model.InkjetRecords.CassADDRESS1, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("CassADDRESS2", Model.InkjetRecords.CassADDRESS2, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("CassADDRESS3", Model.InkjetRecords.CassADDRESS3, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("CassADDRESS4", Model.InkjetRecords.CassADDRESS4, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("CassADDRESS5", Model.InkjetRecords.CassADDRESS5, Array("class", "form-control")) %> +
+
+
+
+
+ diff --git a/App/Views/InkjetRecords/edit.asp b/App/Views/InkjetRecords/edit.asp new file mode 100644 index 0000000..de83b16 --- /dev/null +++ b/App/Views/InkjetRecords/edit.asp @@ -0,0 +1,221 @@ +

<%= H(Model.Title) %>

+<%= HTML.FormTag("InkjetRecords", "EditPost", empty, empty) %> + <%= HTML.Hidden("nonce", HTMLSecurity.GetAntiCSRFToken("InkjetRecordsEditForm")) %> + <%= HTML.Hidden("Id", Model.InkjetRecords.ID) %> +
+
+
+ + <%= HTML.TextboxExt("KitID", Model.InkjetRecords.KitID, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("VOTERID", Model.InkjetRecords.VOTERID, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("LASTNAME", Model.InkjetRecords.LASTNAME, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("FIRSTNAME", Model.InkjetRecords.FIRSTNAME, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("MIDDLENAME", Model.InkjetRecords.MIDDLENAME, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("SUFFIX", Model.InkjetRecords.SUFFIX, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("PRECINCT", Model.InkjetRecords.PRECINCT, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("ADDRESS1", Model.InkjetRecords.ADDRESS1, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("ADDRESS2", Model.InkjetRecords.ADDRESS2, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("ADDRESS3", Model.InkjetRecords.ADDRESS3, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("ADDRESS4", Model.InkjetRecords.ADDRESS4, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("ADDRESS5", Model.InkjetRecords.ADDRESS5, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("APPSENT", Model.InkjetRecords.APPSENT, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("APPRETURNED", Model.InkjetRecords.APPRETURNED, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("BALSENT", Model.InkjetRecords.BALSENT, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("BALRETURNED", Model.InkjetRecords.BALRETURNED, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("CountingBoard", Model.InkjetRecords.CountingBoard, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("UOCAVASTATUS", Model.InkjetRecords.UOCAVASTATUS, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("EMAILADDRESS", Model.InkjetRecords.EMAILADDRESS, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("PHONENUMBER", Model.InkjetRecords.PHONENUMBER, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("BALLOT_NUMBER", Model.InkjetRecords.BALLOT_NUMBER, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("CassADDRESS1", Model.InkjetRecords.CassADDRESS1, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("CassADDRESS2", Model.InkjetRecords.CassADDRESS2, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("CassADDRESS3", Model.InkjetRecords.CassADDRESS3, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("CassADDRESS4", Model.InkjetRecords.CassADDRESS4, Array("class", "form-control")) %> +
+
+
+
+
+
+ + <%= HTML.TextboxExt("CassADDRESS5", Model.InkjetRecords.CassADDRESS5, Array("class", "form-control")) %> +
+
+
+
+
+ <% = HTML.Button("submit", " Save", "btn-primary") %> +    + <%= HTML.LinkToExt(" Delete", "InkjetRecords", "Delete", Array("id", Model.InkjetRecords.ID), Array("class", "btn btn-danger")) %> +    + <%= HTML.LinkToExt("Cancel", "InkjetRecords", "Index", empty, Array("class", "btn btn-default")) %> +
+ diff --git a/App/Views/InkjetRecords/index.asp b/App/Views/InkjetRecords/index.asp new file mode 100644 index 0000000..80a7822 --- /dev/null +++ b/App/Views/InkjetRecords/index.asp @@ -0,0 +1,121 @@ +

<%= H(Model.Title) %>

+
+
+ <%= H(Model.RecordCount) %> InkjetRecords found. Showing <%= H(Model.PageSize) %> records per page. + <%= HTML.LinkToExt(" New","InkjetRecords", "Create", empty, Array("class", "btn btn-xs btn-primary")) %> +
+
+ + <%= HTML.FormTag("InkjetRecords", "Search", empty, empty) %> + +
+ +
+ + +
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <% dim it : set it = Model.InkjetRecords.Iterator %> + <% dim InkjetRecords %> + <% While it.HasNext %> + <% set InkjetRecords = it.GetNext() %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <% Wend %> + +
IDKitIDVOTERIDLASTNAMEFIRSTNAMEMIDDLENAMESUFFIXPRECINCTADDRESS1ADDRESS2ADDRESS3ADDRESS4ADDRESS5APPSENTAPPRETURNEDBALSENTBALRETURNEDCountingBoardUOCAVASTATUSEMAILADDRESSPHONENUMBERBALLOT_NUMBERCassADDRESS1CassADDRESS2CassADDRESS3CassADDRESS4CassADDRESS5
+ <%= HTML.LinkToExt("", "InkjetRecords", "Edit", Array("Id", InkjetRecords.ID), Array("class", "btn btn-primary")) %> + <% = H(InkjetRecords.ID) %><% = H(InkjetRecords.KitID) %><% = H(InkjetRecords.VOTERID) %><% = H(InkjetRecords.LASTNAME) %><% = H(InkjetRecords.FIRSTNAME) %><% = H(InkjetRecords.MIDDLENAME) %><% = H(InkjetRecords.SUFFIX) %><% = H(InkjetRecords.PRECINCT) %><% = H(InkjetRecords.ADDRESS1) %><% = H(InkjetRecords.ADDRESS2) %><% = H(InkjetRecords.ADDRESS3) %><% = H(InkjetRecords.ADDRESS4) %><% = H(InkjetRecords.ADDRESS5) %><% = H(InkjetRecords.APPSENT) %><% = H(InkjetRecords.APPRETURNED) %><% = H(InkjetRecords.BALSENT) %><% = H(InkjetRecords.BALRETURNED) %><% = H(InkjetRecords.CountingBoard) %><% = H(InkjetRecords.UOCAVASTATUS) %><% = H(InkjetRecords.EMAILADDRESS) %><% = H(InkjetRecords.PHONENUMBER) %><% = H(InkjetRecords.BALLOT_NUMBER) %><% = H(InkjetRecords.CassADDRESS1) %><% = H(InkjetRecords.CassADDRESS2) %><% = H(InkjetRecords.CassADDRESS3) %><% = H(InkjetRecords.CassADDRESS4) %><% = H(InkjetRecords.CassADDRESS5) %>
+
+ <% 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/App/Views/Shared/layout.header.asp b/App/Views/Shared/layout.header.asp index f05f509..0dfbd5c 100644 --- a/App/Views/Shared/layout.header.asp +++ b/App/Views/Shared/layout.header.asp @@ -28,6 +28,7 @@
  • <%= Html.LinkTOExt("Kit","Kit","Index",empty,Array("Class","dropdown-item")) %>
  • <%= Html.LinkTOExt("KitLabels","KitLabels","Index",empty,Array("Class","dropdown-item")) %>
  • <%= Html.LinkTOExt("Settings","Settings","Index",empty,Array("Class","dropdown-item")) %>
  • +
  • <%= Html.LinkTOExt("InkjetRecords","InkjetRecords","Index",empty,Array("Class","dropdown-item")) %>
  • @@ -57,3 +58,4 @@ + diff --git a/App/include_all.asp b/App/include_all.asp index cdeb5de..09096e7 100644 --- a/App/include_all.asp +++ b/App/include_all.asp @@ -1,8 +1,9 @@ - + - \ No newline at end of file + + \ No newline at end of file diff --git a/Todo.txt b/Todo.txt new file mode 100644 index 0000000..4d97be4 --- /dev/null +++ b/Todo.txt @@ -0,0 +1,92 @@ +X Add links in the data base foreign keys +X add purple enevlope field in kits to identify them +update insert statements to reflect this change +add purple kit contorlloers +view purple kits option on switch board + +cicd turn off application pool and site before unzipping then restart app and site +cicd install service and start +cicd stop service and copy zip to folder + +create a list and import and export and process to cass and pave + +update label export as pdf for printing +add report man dll for dependancies +update label csv export for snail works + +update inkjet createion and csv export for snail works + + +CREATE TABLE [InkjetRecords] ( + [ID] COUNTER, + [KitID] LONG, + [VOTERID] VARCHAR(255), + [LASTNAME] VARCHAR(255), + [FIRSTNAME] VARCHAR(255), + [MIDDLENAME] VARCHAR(255), + [SUFFIX] VARCHAR(255), + [PRECINCT] VARCHAR(255), + [ADDRESS1] VARCHAR(255), + [ADDRESS2] VARCHAR(255), + [ADDRESS3] VARCHAR(255), + [ADDRESS4] VARCHAR(255), + [ADDRESS5] VARCHAR(255), + [APPSENT] VARCHAR(255), + [APPRETURNED] VARCHAR(255), + [BALSENT] VARCHAR(255), + [BALRETURNED] VARCHAR(255), + [CountingBoard] VARCHAR(255), + [UOCAVASTATUS] VARCHAR(255), + [EMAILADDRESS] VARCHAR(255), + [PHONENUMBER] VARCHAR(255), + [BALLOT_NUMBER] VARCHAR(255), + [CassADDRESS1] VARCHAR(255), + [CassADDRESS2] VARCHAR(255), + [CassADDRESS3] VARCHAR(255), + [CassADDRESS4] VARCHAR(255), + [CassADDRESS5] VARCHAR(255) +); +CREATE UNIQUE INDEX [ID] ON [InkjetRecords]( [ID] ) WITH PRIMARY; +CREATE INDEX [Jcode] ON [InkjetRecords]( [KitID] ); +-- Foreign Key Index will be created after with Constraints +-- CREATE INDEX [KitInkjetRecords] ON [InkjetRecords]( [KitID] ); + +CREATE TABLE [Kit] ( + [ID] COUNTER, + [JobNumber] VARCHAR(255), + [Jcode] VARCHAR(255), + [CreatedOn] DATETIME, + [LabelsPrinted] DATETIME, + [ExportedToSnailWorks] DATETIME, + [InkJetJob] BIT DEFAULT '0' +); +CREATE UNIQUE INDEX [ID] ON [Kit]( [ID] ) WITH PRIMARY; + +CREATE TABLE [KitLabels] ( + [ID] COUNTER, + [KitId] LONG, + [OutboundSerial] VARCHAR(255), + [InBoundSerial] VARCHAR(255), + [OutboundIMB] VARCHAR(255), + [InBoundIMB] VARCHAR(255), + [OutboundIMBDigits] VARCHAR(255), + [InBoundIMBDigits] VARCHAR(255), + [OutboundIMBPNG] MEMO, + [INBOUNDIMBPNG] MEMO, + [SetNumber] DOUBLE +); +CREATE UNIQUE INDEX [ID] ON [KitLabels]( [ID] ) WITH PRIMARY; +-- Foreign Key Index will be created after with Constraints +-- CREATE INDEX [KitKitLabels] ON [KitLabels]( [KitId] ); + +ALTER TABLE [InkjetRecords] ADD CONSTRAINT [KitInkjetRecords] + FOREIGN KEY ( [KitID] ) + REFERENCES [Kit] ( [ID] ) + ON UPDATE CASCADE + ON DELETE CASCADE; + +ALTER TABLE [KitLabels] ADD CONSTRAINT [KitKitLabels] + FOREIGN KEY ( [KitId] ) + REFERENCES [Kit] ( [ID] ) + ON UPDATE CASCADE + ON DELETE CASCADE;