Advertisement
penright

Untitled

Oct 3rd, 2023
1,829
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 5.26 KB | None | 0 0
  1.   Sub FixDataServ()
  2.  
  3.         DispThis("                 Started" & NewLine)
  4.  
  5.         DispThis("                       Dataserv.ini" & NewLine)
  6.  
  7.         '***************************************************************
  8.         'P.E. 7/16/2008
  9.         'Make sure everyone has the expo groups
  10.         DispThis("                       Group Expo" & NewLine)
  11.         Using dtExpoGroup As clsDataTable = DataAccessIris.GetDT2("select * from tblExpoGroup",, "PosLive",,, eErrReturn.Exception)
  12.             DispThis("                       Drive,")
  13.             dtExpoGroup.LocalWalkFindRow(New Dictionary(Of String, Object) From {{"GroupID", 1}})
  14.             If dtExpoGroup.LocalWalkFindRecordNum = -1 Then
  15.                 DispThis("adding group,")
  16.                 Dim newRec As DataRow = dtExpoGroup.NewRow
  17.                 newRec!GroupID = 1
  18.                 newRec!Description = "Drive"
  19.                 newRec!MinExpoNum = 1
  20.                 newRec!MaxExpoNum = 999
  21.                 newRec!ExpoNum = 101
  22.                 dtExpoGroup.Rows.Add(newRec)
  23.                 DispThis("updating,")
  24.                 dtExpoGroup.UpdateData()
  25.                 DispThis("updated,")
  26.             Else
  27.                 DispThis("group existed, " & CIntNull(dtExpoGroup.LocalWalkFindRow!ExpoNum) & ",")
  28.             End If
  29.             DispThis("done" & NewLine)
  30.  
  31.             DispThis("                       Lobby,")
  32.             dtExpoGroup.LocalWalkFindRow(New Dictionary(Of String, Object) From {{"GroupID", 2}})
  33.             If dtExpoGroup.LocalWalkFindRecordNum = -1 Then
  34.                 DispThis("adding group,")
  35.                 Dim newRec As DataRow = dtExpoGroup.NewRow
  36.                 newRec!GroupID = 2
  37.                 newRec!Description = "Lobby"
  38.                 newRec!MinExpoNum = 1
  39.                 newRec!MaxExpoNum = 999
  40.                 newRec!ExpoNum = 101
  41.                 dtExpoGroup.Rows.Add(newRec)
  42.                 DispThis("updating,")
  43.                 dtExpoGroup.UpdateData()
  44.                 DispThis("updated,")
  45.             Else
  46.                 DispThis("group existed, " & CIntNull(dtExpoGroup.LocalWalkFindRow!ExpoNum) & ",")
  47.             End If
  48.             DispThis("done" & NewLine)
  49.         End Using
  50.         '***************************************************************
  51.         DispThis("                 Done" & NewLine)
  52.  
  53.         Using dtRegExpoGroup As clsDataTable = DataAccessIris.GetDT2("select * from tblRegExpoGroup",, "PosLive",,, eErrReturn.Exception)
  54.             Dim FindFilterDrive As New Dictionary(Of String, Object)
  55.             Dim FindFilterLobby As New Dictionary(Of String, Object)
  56.             FindFilterDrive.Add("RegID", 0) : FindFilterDrive.Add("DestinationMask", 4)
  57.             FindFilterLobby.Add("RegID", 0) : FindFilterLobby.Add("DestinationMask", 3)
  58.             Dim RegistersFound As New List(Of Integer)
  59.             Dim DataServIni As New PrivateIniFile
  60.             For xLoop_Reg As Integer = 0 To PosMaint.RegisterInformations.Count - 1
  61.                 Dim RegInfo As RegInfo = PosMaint.RegisterInformations(xLoop_Reg)
  62.                 RegistersFound.Add(RegInfo.RegisterNumber)
  63.                 FindFilterDrive("RegID") = RegInfo.RegisterNumber
  64.                 FindFilterLobby("RegID") = RegInfo.RegisterNumber
  65.                 dtRegExpoGroup.LocalWalkFindFilter(FindFilterDrive)
  66.                 If dtRegExpoGroup.LocalWalkFindRecordNum = -1 Then
  67.                     Dim drNew As DataRow = dtRegExpoGroup.NewRow
  68.                     drNew!RegID = RegInfo.RegisterNumber
  69.                     drNew!GroupID = 1
  70.                     drNew!DestinationMask = 4
  71.                     dtRegExpoGroup.Rows.Add(drNew)
  72.                 End If
  73.                 dtRegExpoGroup.LocalWalkFindFilter(FindFilterLobby)
  74.                 If dtRegExpoGroup.LocalWalkFindRecordNum = -1 Then
  75.                     Dim drNew As DataRow = dtRegExpoGroup.NewRow
  76.                     drNew!RegID = RegInfo.RegisterNumber
  77.                     drNew!GroupID = 2
  78.                     drNew!DestinationMask = 3
  79.                     dtRegExpoGroup.Rows.Add(drNew)
  80.                 End If
  81.                 DataServIni.SetFileName("c:\iris\reginfo\reg" & RegInfo.RegisterNumber & "\ini\dataserv.ini")
  82.                 DataServIni.WriteString("ExpoNum", "UseServer", "1")
  83.                 DataServIni.WriteString("ExpoNum", "Destination", "7")
  84.                 DataServIni.WriteString("ExpoNum", "Format", "NNN")
  85.                 DataServIni.WriteString("ExpoNum", "LocalFormat", "RNNN")
  86.                 DataServIni.WriteString("LDS", "POSTRANS", "..\data\POSLive.sqlite")
  87.                 DataServIni.WriteString("LDS", "PAYROLL", "..\data\Payroll.sqlite")
  88.                 DataServIni.WriteString("LDS", "TABLE", "..\data\POSCfg.sqlite")
  89.                 DataServIni.WriteString("LDS", "POSCFG", "..\data\POSCfg.sqlite")
  90.                 DataServIni.WriteString("LDS", "POSPENDING", "..\data\POSPend.sqlite")
  91.                 DataServIni.WriteString("LDS", "BUSDATE", "..\data\POSLive.sqlite")
  92.                 DataServIni.WriteString("LDS", "NEXTNUM", "..\data\POSLive.sqlite")
  93.             Next
  94.             DataServIni = Nothing
  95.             For xLoop_dt As Integer = 0 To dtRegExpoGroup.Rows.Count - 1
  96.                 If Not RegistersFound.Contains(CIntNull(dtRegExpoGroup.Rows(xLoop_dt)!RegID)) Then dtRegExpoGroup.Rows(xLoop_dt).Delete()
  97.             Next
  98.             dtRegExpoGroup.UpdateData()
  99.         End Using
  100.  
  101.     End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement