' Return to Dynamics GP 9
Imports Microsoft.ApplicationBlocks.Data
Imports Microsoft.Dexterity.Applications
Imports System.Configuration
Public Class user
Public ReadOnly Property Database() As String
Get
Return Dynamics.Globals.IntercompanyId.Value()
End Get
End Property
Public ReadOnly Property UserID() As String
Get
Return Dynamics.Globals.UserId.Value
End Get
End Property
Public ReadOnly Property ConnectionString() As String
Get
Return "Data Source=" & Me.server & ";Integrated Security=SSPI;Initial Catalog=" & Me.Database
End Get
End Property
Public ReadOnly Property server()
Get
'Declare an instance of the Microsoft Dynamics GP syBackupRestore
'form in which the function resides.
Dim backup As Microsoft.Dexterity.Applications.DynamicsDictionary.SyBackupRestoreForm
backup = Microsoft.Dexterity.Applications.Dynamics.Forms.SyBackupRestore
'Invoke the form-level function.
Return backup.Functions.GetServerNameWithInstance.Invoke()
End Get
End Property
Public ReadOnly Property OrderType() As String
Get
Return ConfigurationManager.AppSettings("OrderType").ToString
End Get
End Property
End Class