Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub FixDataServ()
- DispThis(" Started" & NewLine)
- DispThis(" Dataserv.ini" & NewLine)
- '***************************************************************
- 'P.E. 7/16/2008
- 'Make sure everyone has the expo groups
- DispThis(" Group Expo" & NewLine)
- Using dtExpoGroup As clsDataTable = DataAccessIris.GetDT2("select * from tblExpoGroup",, "PosLive",,, eErrReturn.Exception)
- DispThis(" Drive,")
- dtExpoGroup.LocalWalkFindRow(New Dictionary(Of String, Object) From {{"GroupID", 1}})
- If dtExpoGroup.LocalWalkFindRecordNum = -1 Then
- DispThis("adding group,")
- Dim newRec As DataRow = dtExpoGroup.NewRow
- newRec!GroupID = 1
- newRec!Description = "Drive"
- newRec!MinExpoNum = 1
- newRec!MaxExpoNum = 999
- newRec!ExpoNum = 101
- dtExpoGroup.Rows.Add(newRec)
- DispThis("updating,")
- dtExpoGroup.UpdateData()
- DispThis("updated,")
- Else
- DispThis("group existed, " & CIntNull(dtExpoGroup.LocalWalkFindRow!ExpoNum) & ",")
- End If
- DispThis("done" & NewLine)
- DispThis(" Lobby,")
- dtExpoGroup.LocalWalkFindRow(New Dictionary(Of String, Object) From {{"GroupID", 2}})
- If dtExpoGroup.LocalWalkFindRecordNum = -1 Then
- DispThis("adding group,")
- Dim newRec As DataRow = dtExpoGroup.NewRow
- newRec!GroupID = 2
- newRec!Description = "Lobby"
- newRec!MinExpoNum = 1
- newRec!MaxExpoNum = 999
- newRec!ExpoNum = 101
- dtExpoGroup.Rows.Add(newRec)
- DispThis("updating,")
- dtExpoGroup.UpdateData()
- DispThis("updated,")
- Else
- DispThis("group existed, " & CIntNull(dtExpoGroup.LocalWalkFindRow!ExpoNum) & ",")
- End If
- DispThis("done" & NewLine)
- End Using
- '***************************************************************
- DispThis(" Done" & NewLine)
- Using dtRegExpoGroup As clsDataTable = DataAccessIris.GetDT2("select * from tblRegExpoGroup",, "PosLive",,, eErrReturn.Exception)
- Dim FindFilterDrive As New Dictionary(Of String, Object)
- Dim FindFilterLobby As New Dictionary(Of String, Object)
- FindFilterDrive.Add("RegID", 0) : FindFilterDrive.Add("DestinationMask", 4)
- FindFilterLobby.Add("RegID", 0) : FindFilterLobby.Add("DestinationMask", 3)
- Dim RegistersFound As New List(Of Integer)
- Dim DataServIni As New PrivateIniFile
- For xLoop_Reg As Integer = 0 To PosMaint.RegisterInformations.Count - 1
- Dim RegInfo As RegInfo = PosMaint.RegisterInformations(xLoop_Reg)
- RegistersFound.Add(RegInfo.RegisterNumber)
- FindFilterDrive("RegID") = RegInfo.RegisterNumber
- FindFilterLobby("RegID") = RegInfo.RegisterNumber
- dtRegExpoGroup.LocalWalkFindFilter(FindFilterDrive)
- If dtRegExpoGroup.LocalWalkFindRecordNum = -1 Then
- Dim drNew As DataRow = dtRegExpoGroup.NewRow
- drNew!RegID = RegInfo.RegisterNumber
- drNew!GroupID = 1
- drNew!DestinationMask = 4
- dtRegExpoGroup.Rows.Add(drNew)
- End If
- dtRegExpoGroup.LocalWalkFindFilter(FindFilterLobby)
- If dtRegExpoGroup.LocalWalkFindRecordNum = -1 Then
- Dim drNew As DataRow = dtRegExpoGroup.NewRow
- drNew!RegID = RegInfo.RegisterNumber
- drNew!GroupID = 2
- drNew!DestinationMask = 3
- dtRegExpoGroup.Rows.Add(drNew)
- End If
- DataServIni.SetFileName("c:\iris\reginfo\reg" & RegInfo.RegisterNumber & "\ini\dataserv.ini")
- DataServIni.WriteString("ExpoNum", "UseServer", "1")
- DataServIni.WriteString("ExpoNum", "Destination", "7")
- DataServIni.WriteString("ExpoNum", "Format", "NNN")
- DataServIni.WriteString("ExpoNum", "LocalFormat", "RNNN")
- DataServIni.WriteString("LDS", "POSTRANS", "..\data\POSLive.sqlite")
- DataServIni.WriteString("LDS", "PAYROLL", "..\data\Payroll.sqlite")
- DataServIni.WriteString("LDS", "TABLE", "..\data\POSCfg.sqlite")
- DataServIni.WriteString("LDS", "POSCFG", "..\data\POSCfg.sqlite")
- DataServIni.WriteString("LDS", "POSPENDING", "..\data\POSPend.sqlite")
- DataServIni.WriteString("LDS", "BUSDATE", "..\data\POSLive.sqlite")
- DataServIni.WriteString("LDS", "NEXTNUM", "..\data\POSLive.sqlite")
- Next
- DataServIni = Nothing
- For xLoop_dt As Integer = 0 To dtRegExpoGroup.Rows.Count - 1
- If Not RegistersFound.Contains(CIntNull(dtRegExpoGroup.Rows(xLoop_dt)!RegID)) Then dtRegExpoGroup.Rows(xLoop_dt).Delete()
- Next
- dtRegExpoGroup.UpdateData()
- End Using
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement