Files
egtbeamwall/EgtBEAMWALL.ViewerOptimizer/Utility/DbControllers.vb
T
Emmanuele Sassi 6ccb91b658 - correzion nel recupero del pezzo originale dei duplo: la isduplo funziona solo nel MachGroup
- Aggiunta lettura Indice di lavorazione
- Aggiunto test per ripartenza pareti con domanda
- Agginta gestione parziale colonne in Supervisor
2021-11-18 08:45:22 +01:00

52 lines
1.8 KiB
VB.net

Imports EgtUILib
Imports EgtWPFLib5
Imports EgtBEAMWALL.Core
Imports EgtBEAMWALL.ViewerOptimizer
Public 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_StatusMapController As DataLayer.Controllers.StatusMapController
Public m_PartController As DataLayer.Controllers.PartController
Sub Init()
End Sub
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
m_ProjController = New DataLayer.Controllers.ProjController
m_ProdController = New DataLayer.Controllers.ProdController
m_MachGroupController = New DataLayer.Controllers.MachGroupController
m_StatusMapController = New DataLayer.Controllers.StatusMapController
m_PartController = New DataLayer.Controllers.PartController
End Sub
End Module