MS_18052016
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Public Class frmSAP_FuBa
|
||||
|
||||
Dim m_CountTo As Integer = 0
|
||||
Private Sub TBPMO_SAP_FUBABindingNavigatorSaveItem_Click(sender As Object, e As EventArgs) Handles TBPMO_SAP_FUBABindingNavigatorSaveItem.Click
|
||||
Try
|
||||
Me.TBPMO_SAP_FUBABindingSource.EndEdit()
|
||||
@@ -141,8 +141,8 @@ Public Class frmSAP_FuBa
|
||||
End If
|
||||
'######
|
||||
Dim i = 0
|
||||
Dim tablename = "[TPPMO_SAPFUBA_" & TempTableNameTextBox.Text & "]"
|
||||
Dim createtablesql = "CREATE TABLE TPPMO_SAPFUBA_" & TempTableNameTextBox.Text & " ("
|
||||
Dim tablename = "[TBPMO_SAPFUBA_" & TempTableNameTextBox.Text & "]"
|
||||
Dim createtablesql = "CREATE TABLE TBPMO_SAPFUBA_" & TempTableNameTextBox.Text & " ("
|
||||
|
||||
|
||||
For Each col As System.Data.DataColumn In SAPResulttable.Columns
|
||||
@@ -158,7 +158,7 @@ Public Class frmSAP_FuBa
|
||||
|
||||
If ClassDatabase.Execute_Scalar(check) = 1 Then
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(">> TempTable " & tablename & " exists and will now be deleted!", False)
|
||||
' ClassDatabase.Execute_non_Query_withConn("DROP TABLE " & tablename, 1)
|
||||
ClassDatabase.Execute_non_Query_withConn("DROP TABLE " & tablename, 1)
|
||||
End If
|
||||
|
||||
''Die Tabelle anlegen
|
||||
@@ -245,6 +245,9 @@ Public Class frmSAP_FuBa
|
||||
|
||||
Private Sub btnGetResult_Click(sender As Object, e As EventArgs) Handles btnGetResult.Click
|
||||
Dim SAPCon As New R3Connection
|
||||
Dim sw As New Stopwatch
|
||||
sw.Start()
|
||||
m_CountTo = 100
|
||||
|
||||
Me.Cursor = Cursors.WaitCursor
|
||||
If ClassSAP.ConnectionInit(HostTextBox.Text, SystemNumberTextBox.Text, UserNameTextBox.Text, PasswordTextBox.Text, ClientTextBox.Text, LanguageTextBox.Text) = True Then
|
||||
@@ -255,6 +258,7 @@ Public Class frmSAP_FuBa
|
||||
lblResult.Visible = False
|
||||
GridControl2.DataSource = Nothing
|
||||
lblSave.Visible = False
|
||||
sw.Stop()
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
@@ -311,6 +315,7 @@ Public Class frmSAP_FuBa
|
||||
Me.Cursor = Cursors.Default
|
||||
lblSave.Visible = False
|
||||
Catch ex As Exception
|
||||
sw.Stop()
|
||||
ClassLogger.Add(">> Unexpected Error in SAP Table Result: " & ex.Message, False)
|
||||
MsgBox("Unexpected Error in SAP Table Result: " & ex.Message, MsgBoxStyle.Critical)
|
||||
lblResult.Visible = False
|
||||
@@ -491,6 +496,7 @@ Public Class frmSAP_FuBa
|
||||
Me.Cursor = Cursors.Default
|
||||
lblSave.Visible = False
|
||||
GridControl2.DataSource = Nothing
|
||||
sw.Stop()
|
||||
ClassLogger.Add(">> SAPResulttable is nothing", False)
|
||||
End If
|
||||
|
||||
@@ -502,14 +508,18 @@ Public Class frmSAP_FuBa
|
||||
GridControl2.DataSource = SAPResulttable
|
||||
End If
|
||||
SAPCon.Close()
|
||||
If txtLimitRows.Text <> "" Then
|
||||
lblResult.Text = "Result of FuBa (limited to " & txtLimitRows.Text & " rows)"
|
||||
Dim elapsed As Double
|
||||
elapsed = sw.Elapsed.TotalSeconds
|
||||
sw.Stop()
|
||||
If txtLimitRows.Text <> "" And SAPResulttable.Rows.Count >= CInt(txtLimitRows.Text) Then
|
||||
lblResult.Text = "Result of FuBa (limited to " & txtLimitRows.Text & " rows) - Duration: " & Format(elapsed, "0.00") & " seconds"
|
||||
Else
|
||||
lblResult.Text = "Result of FuBa (unlimited) >> " & SAPResulttable.Rows.Count & " rows retreived"
|
||||
lblResult.Text = "Result of FuBa (unlimited) >> " & SAPResulttable.Rows.Count & " rows retrieved - Duration: " & Format(elapsed, "0.00") & " seconds"
|
||||
End If
|
||||
lblResult.Visible = True
|
||||
Me.Cursor = Cursors.Default
|
||||
lblSave.Visible = False
|
||||
|
||||
Catch ex As Exception
|
||||
SAPCon.Close()
|
||||
lblResult.Visible = False
|
||||
|
||||
Reference in New Issue
Block a user