Advertisement
penright

Untitled

Oct 3rd, 2023
1,635
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 3.23 KB | None | 0 0
  1.    Sub FixSCBBreakfastCombo()
  2.         Dim lstSQL_1 As New List(Of String)
  3.         Dim lstSQL_2 As New List(Of String)
  4.         Using dtAttachments As clsDataTable = DataAccessIris.GetDT2("Select * from tbl_ItemCatLinks Where CatID = 6023")
  5.             For i As Integer = 0 To dtAttachments.RowCount - 1
  6.                 lstSQL_1.Add("Delete from tbl_ItemAttachments where ItemNum = " & CStrNull(dtAttachments.Rows(i)!ItemNum))
  7.                 lstSQL_2.Add("INSERT tbl_ItemAttachments(ItemNum, SeqNum, InsMarker, IsModifier, IsItem, ID, MinChoices, MaxChoices," &
  8.                            "PromptSoundFile, ReplacePrice, PriceAdjust, DeductItemPrice, NoNegativePrice, AllowQTY, Destination)" &
  9.                            "Values(" & CStrNull(dtAttachments.Rows(i)!ItemNum) & ",0,0,0,1,5651,1,1,0,0.00,0,-1,0,0,0)") 'Add Hash-browns
  10.                 If PosMaint.SpecialityCoffeeStore Then
  11.                     lstSQL_2.Add("INSERT tbl_ItemAttachments(ItemNum, SeqNum, InsMarker, IsModifier, IsItem, ID, MinChoices, MaxChoices, " &
  12.                                "PromptSoundFile, ReplacePrice, PriceAdjust, DeductItemPrice, NoNegativePrice, AllowQTY, Destination)" &
  13.                                "Values(" & CStrNull(dtAttachments.Rows(i)!ItemNum) & ",1,0,0,0,2000,1,1,0,0.00,0,-1,0,0,0)") 'Special Coffee Menu
  14.                     'PE 3/7/2022
  15.                     'Added In you face upsize
  16.                     lstSQL_2.Add("INSERT tbl_ItemAttachments(ItemNum, SeqNum, InsMarker, IsModifier, IsItem, ID, MinChoices, MaxChoices, " &
  17.                                "PromptSoundFile, ReplacePrice, PriceAdjust, DeductItemPrice, NoNegativePrice, AllowQTY, Destination)" &
  18.                                "Values(" & CStrNull(dtAttachments.Rows(i)!ItemNum) & ",2,0,0,0,395,0,0,0,0.00,0,-1,0,0,0)") 'Menu for up sized
  19.                 Else
  20.                     lstSQL_2.Add("INSERT tbl_ItemAttachments(ItemNum, SeqNum, InsMarker, IsModifier, IsItem, ID, MinChoices, MaxChoices," &
  21.                                "PromptSoundFile, ReplacePrice, PriceAdjust, DeductItemPrice, NoNegativePrice, AllowQTY, Destination)" &
  22.                                "Values(" & CStrNull(dtAttachments.Rows(i)!ItemNum) & ",1,0,0,1,3509,1,1,0,0.00,0,-1,0,0,0)") 'Small Coffee Item
  23.                     'PE 3/7/2022
  24.                     'Added In you face up size
  25.                     lstSQL_2.Add("INSERT tbl_ItemAttachments(ItemNum, SeqNum, InsMarker, IsModifier, IsItem, ID, MinChoices, MaxChoices, " &
  26.                                "PromptSoundFile, ReplacePrice, PriceAdjust, DeductItemPrice, NoNegativePrice, AllowQTY, Destination)" &
  27.                                "Values(" & CStrNull(dtAttachments.Rows(i)!ItemNum) & ",2,0,0,0,395,0,0,0,0.00,0,-1,0,0,0)") 'Menu For up sized
  28.                 End If
  29.             Next
  30.         End Using
  31.         'DataAccessIris.ExecCommand("DELETE FROM TBL_ITEMATTACHMENTS WHERE ID = 3509" & vbNewLine & _
  32.         '               "DELETE FROM TBL_ITEMATTACHMENTS WHERE ID = 5651" & vbNewLine & _
  33.         '               "DELETE FROM TBL_ITEMATTACHMENTS WHERE ID = 2000")
  34.         ''run the list
  35.         If lstSQL_1.Count > 0 Then DataAccessIris.ExecCommand(Join(lstSQL_1.ToArray, vbNewLine))
  36.         If lstSQL_2.Count > 0 Then DataAccessIris.ExecCommand(Join(lstSQL_2.ToArray, vbNewLine))
  37.  
  38.     End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement