Modules/EDMI_ClientSuite/frmDocTest.vb
2019-03-06 15:23:23 +01:00

52 lines
1.8 KiB
VB.net

Imports DevExpress.XtraGrid
Public Class frmDocTest
Private _CommonCommands As ClassCommonCommands
Private Sub DocTest_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Try
Dim oControlPatcher = New ClassControlPatcher(Of GridControl)(Me)
oControlPatcher.
ProcessContainer(AddressOf GridControlDefaults.DefaultGridSettings).
ProcessContainer(AddressOf GridControlDefaults.ReadOnlyGridSettings)
_CommonCommands = New ClassCommonCommands(My.LogConfig)
Dim oSQL = "SELECT * FROM VWICM_DOC_METADATA_DE"
My.Channel.CreateDatabaseRequest("Load Doc Values", True)
Dim oResult = My.Channel.ReturnDatatable(oSQL)
If Not oResult.OK Then
MsgBox(oResult.ErrorMessage)
Exit Sub
End If
My.Channel.CloseDatabaseRequest()
Dim oDatatable As DataTable = oResult.Table
txtDoctype.DataBindings.Add(New Binding("Text", oDatatable, "DOCTYPE"))
txtDocId.DataBindings.Add(New Binding("Text", oDatatable, "DOC_ID"))
GridControl1.DataSource = oDatatable
Catch ex As Exception
_ErrorHandler.ShowErrorMessage(ex)
End Try
End Sub
Private Async Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim oDocId As Int64 = Int64.Parse(txtDocId.Text)
Dim oValue As String = txtDoctype.Text
Dim oSyskey As String = "001-DOCTYPE"
Dim oResult = Await _CommonCommands.FNICM_NEW_DOC_VALUE(oDocId, oSyskey, My.Application.User.Language, oValue)
If Not oResult.OK Then
MsgBox(oResult.ErrorMessage)
Exit Sub
End If
My.Channel.CloseDatabaseRequest()
End Sub
End Class