Files
egtbeamwall/EgtBEAMWALL.Supervisor/Utility/DbControllers.vb
T
Emmanuele Sassi 69e010e147 - Modifiche provvisorie per far funzionare Q su L250
- Modifiche lettura variabili NUM per input ed output
- introdotte differenze grafiche tra NUM e TPA
- Introdotto controllo chiave su utilizzo Db non locale
- Correzione su reset dei CALC quando ci sono modifiche
- Blocco comandi su MachGroup in produzione
- Introdotto bottone supervisore in View/Optim per aprirlo o richiamarlo in primo piano
2021-11-26 10:41:27 +01:00

52 lines
2.0 KiB
VB.net

Imports EgtUILib
Imports EgtWPFLib5
Imports EgtBEAMWALL.Core
Module DbControllers
Friend m_SupervisorId As String = "1"
Public m_ProjController As DataLayer.Controllers.ProjController
Public m_ProdController As DataLayer.Controllers.ProdController
Public m_MachGroupController As DataLayer.Controllers.MachGroupController
Public m_PartController As DataLayer.Controllers.PartController
Public m_LogMachineController As DataLayer.Controllers.LogMachineController
Public m_StatusMapController As DataLayer.Controllers.StatusMapController
Sub New()
' se demo--> server = db.steamware.net, nKey e sKey come le hai...
Dim sKey = "", sUser = "", sPwd = ""
EgtGetKeyInfo(sKey)
sKey = sKey.Replace(" ", "")
If Not IsNothing(sKey) AndAlso sKey.Length > 11 Then
sUser = sKey.Substring(3, 6)
sPwd = sKey.Substring(10, sKey.Length - 10).Replace("(", "").Replace(")", "")
End If
Try
Dim DbAddress As String = "127.0.0.1"
If Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NETWORK) Then
GetMainPrivateProfileString(S_GENERAL, K_DBADDRESS, "127.0.0.1", DbAddress)
End If
DataLayer.DbConfig.InitDb(DbAddress, sUser, sPwd)
DataLayer.DbConfig.CheckUser(sUser, sPwd)
Catch ex As Exception
EgtOutLog("InitDb error: " & ex.ToString())
MessageBox.Show(Application.Current.MainWindow, "Db connection error!!", "Error")
End
End Try
DataLayer.DbConfig.InitDb("127.0.0.1", sUser, sPwd)
DataLayer.DbConfig.CheckUser(sUser, sPwd)
m_ProjController = New DataLayer.Controllers.ProjController
m_ProdController = New DataLayer.Controllers.ProdController
m_MachGroupController = New DataLayer.Controllers.MachGroupController
m_PartController = New DataLayer.Controllers.PartController
m_LogMachineController = New DataLayer.Controllers.LogMachineController
m_StatusMapController = New DataLayer.Controllers.StatusMapController
End Sub
End Module