diff --git a/App/DomainModels/KitLabelsRepository.asp b/App/DomainModels/KitLabelsRepository.asp index 69252d8..3741f04 100644 --- a/App/DomainModels/KitLabelsRepository.asp +++ b/App/DomainModels/KitLabelsRepository.asp @@ -17,9 +17,10 @@ Class KitLabelsModel_Class Public InBoundIMBDigits '106 Public OutboundIMBPNG Public INBOUNDIMBPNG + Public SetNumber Private Sub Class_Initialize 'ValidateExitsts Me, "","" - Class_Get_Properties = Array("ID, KitId, OutboundSerial, InBoundSerial, OutboundIMB, InBoundIMB, OutboundIMBDigits, InBoundIMBDigits,OutboundIMBPNG,INBOUNDIMBPNG") + Class_Get_Properties = Array("ID, KitId, OutboundSerial, InBoundSerial, OutboundIMB, InBoundIMB, OutboundIMBDigits, InBoundIMBDigits,OutboundIMBPNG,INBOUNDIMBPNG,SetNumber") End Sub End CLass @@ -31,7 +32,7 @@ End CLass Class KitLabelsRepository_Class Public Function FindByID(ID) - dim sql : sql = "Select [ID], [KitId], [OutboundSerial], [InBoundSerial], [OutboundIMB], [InBoundIMB], [OutboundIMBDigits], [InBoundIMBDigits],OutboundIMBPNG,INBOUNDIMBPNG FROM [KitLabels] WHERE 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) If rs.EOF then Err.Raise 1, "KitLabelsRepository_Class", KitLabelsNotFoundException("ID", ID) @@ -45,7 +46,7 @@ Class KitLabelsRepository_Class End Function Public Function Find(where_kvarray, order_string_or_array) - dim sql : sql = "Select [ID], [KitId], [OutboundSerial], [InBoundSerial], [OutboundIMB], [InBoundIMB], [OutboundIMBDigits], [InBoundIMBDigits],OutboundIMBPNG,INBOUNDIMBPNG FROM [KitLabels]" + dim sql : sql = "Select [ID], [KitId], [OutboundSerial], [InBoundSerial], [OutboundIMB], [InBoundIMB], [OutboundIMBDigits], [InBoundIMBDigits],OutboundIMBPNG,INBOUNDIMBPNG, [SetNumber] FROM [KitLabels]" If Not IsEmpty(where_kvarray) then sql = sql & " WHERE " @@ -78,7 +79,7 @@ Class KitLabelsRepository_Class 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], [OutboundSerial], [InBoundSerial], [OutboundIMB], [InBoundIMB], [OutboundIMBDigits], [InBoundIMBDigits],OutboundIMBPNG,INBOUNDIMBPNG FROM [KitLabels]" + dim sql : sql = "Select [ID], [KitId], [OutboundSerial], [InBoundSerial], [OutboundIMB], [InBoundIMB], [OutboundIMBDigits], [InBoundIMBDigits],OutboundIMBPNG,INBOUNDIMBPNG, [SetNumber] FROM [KitLabels]" If Not IsEmpty(where_kvarray) then sql = sql & " WHERE " @@ -120,7 +121,7 @@ Class KitLabelsRepository_Class 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], [OutboundSerial], [InBoundSerial], [OutboundIMB], [InBoundIMB], [OutboundIMBDigits], [InBoundIMBDigits],OutboundIMBPNG,INBOUNDIMBPNG FROM [KitLabels]" + dim sql : sql = "Select [ID], [KitId], [OutboundSerial], [InBoundSerial], [OutboundIMB], [InBoundIMB], [OutboundIMBDigits], [InBoundIMBDigits],OutboundIMBPNG,INBOUNDIMBPNG, [SetNumber] FROM [KitLabels]" If Not IsEmpty(where_kvarray) then sql = sql & " WHERE " @@ -198,10 +199,13 @@ Class KitLabelsRepository_Class Dim SerialNumberStart:SerialNumberStart = SettingsRepository.Find(Array("Name =?","SerialNumberStart"),empty).pop().Value Dim serialOffset:serialOffset = SettingsRepository.Find(Array("Name =?","SerialOffset"),empty).pop().Value Dim SerialStart:SerialStart = CLng(SerialNumberStart) + CLng(serialOffset) - dim i + dim i,s + s = 1 for i = 0 to (Amount * 2) - 2 Step 2 dim NewKitLabel : set NewKitLabel = new KitLabelsModel_Class NewKitLabel.KitId = KitId + NewKitLabel.SetNumber = s + s = s + 1 NewKitLabel.OutboundSerial = PadLeft(SerialStart + i,9,"0") NewKitLabel.InBoundSerial = PadLeft(SerialStart + i + 1,9,"0") NewKitLabel.OutboundIMBDigits ="00716" & MailingID & NewKitLabel.OutboundSerial & "000000000" @@ -237,8 +241,9 @@ Class KitLabelsRepository_Class "[OutboundIMBDigits]," &_ "[InBoundIMBDigits]," &_ "[OutboundIMBPNG]," &_ - "[INBOUNDIMBPNG])" &_ - "VALUES (?,?,?,?,?,?,?,?,?)" + "[INBOUNDIMBPNG]," &_ + "[SetNumber])" &_ + "VALUES (?,?,?,?,?,?,?,?,?,?)" DAL.Execute sql, Array(model.KitId, _ model.OutboundSerial, _ model.InBoundSerial, _ @@ -247,7 +252,8 @@ Class KitLabelsRepository_Class model.OutboundIMBDigits, _ model.InBoundIMBDigits, _ model.OutboundIMBPNG, _ - model.INBOUNDIMBPNG) + model.INBOUNDIMBPNG, _ + model.SetNumber) sql = "SELECT TOP 1 ID FROM [KitLabels] ORDER BY ID DESC" dim rs : set rs = DAL.Query(sql, empty) model.ID = rs("ID") @@ -262,7 +268,7 @@ Class KitLabelsRepository_Class "[InBoundIMB] = ?," &_ "[OutboundIMBDigits] = ?," &_ "[InBoundIMBDigits] = ?," &_ - "OutboundIMBPNG,INBOUNDIMBPNG)" &_ + "OutboundIMBPNG,INBOUNDIMBPNG,[SetNumber])" &_ " WHERE [ID] = ?" DAL.Execute sql, Array(model.KitId, _ @@ -274,6 +280,7 @@ Class KitLabelsRepository_Class model.InBoundIMBDigits, _ model.OutboundIMBPNG, _ model.INBOUNDIMBPNG, _ + model.SetNumber, _ model.ID) End Sub diff --git a/App/ViewModels/KitLabelsViewModels.asp b/App/ViewModels/KitLabelsViewModels.asp index 838c2d4..6e980bc 100644 --- a/App/ViewModels/KitLabelsViewModels.asp +++ b/App/ViewModels/KitLabelsViewModels.asp @@ -25,6 +25,7 @@ Class Create_ViewModel_Class Public InBoundIMBDigits Public OutboundIMBPNG Public INBOUNDIMBPNG + Public SetNumber End Class Class Delete_ViewModel_Class diff --git a/App/Views/Kit/SwitchBoardEdit.asp b/App/Views/Kit/SwitchBoardEdit.asp index 5f27bc0..911d978 100644 --- a/App/Views/Kit/SwitchBoardEdit.asp +++ b/App/Views/Kit/SwitchBoardEdit.asp @@ -19,6 +19,7 @@