MS
This commit is contained in:
688
app/ResultHandler_Konfig/frmMain.vb
Normal file
688
app/ResultHandler_Konfig/frmMain.vb
Normal file
@@ -0,0 +1,688 @@
|
||||
Imports System.ServiceProcess
|
||||
Public Class frmMain
|
||||
Private _windream As clsWindream_allgemein
|
||||
Private Sub TBPROFILBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs) Handles TBPROFILBindingNavigatorSaveItem.Click
|
||||
Save_Profil()
|
||||
End Sub
|
||||
|
||||
Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
If My.Settings.myConnString = String.Empty Then
|
||||
Dim dbPath As String = Application.StartupPath & "\Database\wdResultHandler.db3"
|
||||
If IO.File.Exists(dbPath) Then
|
||||
My.Settings.myConnString = dbPath
|
||||
My.Settings.Save()
|
||||
Else
|
||||
MsgBox("Achtung: Die SQLite-Database File exisitiert nicht am angegebenen Ort: " & vbNewLine & dbPath, MsgBoxStyle.Critical, "Fehler:")
|
||||
DB_Path()
|
||||
End If
|
||||
End If
|
||||
Load_Constring()
|
||||
Try
|
||||
' Windream instanziieren
|
||||
_windream = New clsWindream_allgemein()
|
||||
'Windream initialisieren (Connection, Session, ... aufbauen)
|
||||
_windream.Init()
|
||||
Catch ex As Exception
|
||||
MsgBox("Fehler bei Initialisieren von windream: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:")
|
||||
End Try
|
||||
Load_Profil()
|
||||
Load_Uebersicht()
|
||||
clsLogger.Init(My.Application.Info.DirectoryPath & "\Log", "logResultHandler_")
|
||||
End Sub
|
||||
Sub Load_Uebersicht()
|
||||
' Try
|
||||
Dim DT As DataTable = MyDataset.TBWMRH_PROFIL
|
||||
' ClassDIProfile.Init()
|
||||
Dim Count As Integer = 0
|
||||
ListViewProfile.Items.Clear()
|
||||
|
||||
|
||||
Dim running = CheckIfRunning("DDWDResultHandler")
|
||||
If running = False Then
|
||||
ListViewProfile.Columns(3).Width = 150
|
||||
Else
|
||||
ListViewProfile.Columns(3).Width = 80
|
||||
End If
|
||||
For Each row As DataRow In DT.Rows
|
||||
ListViewProfile.Items.Add(row.Item("Profilname"))
|
||||
If running = False Then
|
||||
ListViewProfile.Items(Count).ImageIndex = 2
|
||||
Else
|
||||
If CBool(row.Item("Aktiv")) = True Then
|
||||
ListViewProfile.Items(Count).ImageIndex = 0
|
||||
Else
|
||||
ListViewProfile.Items(Count).ImageIndex = 1
|
||||
End If
|
||||
End If
|
||||
Try
|
||||
ListViewProfile.Items(Count).SubItems.Add(row.Item("Aktiv"))
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
|
||||
ListViewProfile.Items(Count).SubItems.Add(row.Item("Letzter_Durchlauf"))
|
||||
If running = False Then
|
||||
ListViewProfile.Items(Count).SubItems.Add("Service stopped")
|
||||
Else
|
||||
If CBool(row.Item("Running")) = True Then
|
||||
ListViewProfile.Items(Count).SubItems.Add("Running")
|
||||
Else
|
||||
ListViewProfile.Items(Count).SubItems.Add("Waiting")
|
||||
End If
|
||||
End If
|
||||
|
||||
Count += 1
|
||||
Next
|
||||
|
||||
'Catch ex As Exception
|
||||
' MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler beim Laden der Dateiimport-Profileiste")
|
||||
'End Try
|
||||
End Sub
|
||||
Private Function CheckIfRunning(sServiceName As String) As Boolean
|
||||
Try
|
||||
Dim sc As New ServiceController(sServiceName)
|
||||
If sc.Status.Equals(ServiceControllerStatus.Stopped) Or sc.Status.Equals(ServiceControllerStatus.StopPending) Then
|
||||
' Service is not running
|
||||
Return False
|
||||
Else
|
||||
' Service is running()
|
||||
Return True
|
||||
End If
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler inCheckIfRunning")
|
||||
End Try
|
||||
End Function
|
||||
Sub Load_Constring()
|
||||
My.Settings.Save()
|
||||
Me.TBWMRH_KONFIGURATIONTableAdapter.Connection.ConnectionString = My.Settings.SQLSERVER_CS
|
||||
Me.TBWMRH_PROFILTableAdapter.Connection.ConnectionString = My.Settings.SQLSERVER_CS
|
||||
Me.TBWMRH_PROFIL_JOBTableAdapter.Connection.ConnectionString = My.Settings.SQLSERVER_CS
|
||||
Me.TBWMRH_PROFIL_FILE_JOBTableAdapter.Connection.ConnectionString = My.Settings.SQLSERVER_CS
|
||||
Load_Grundkonfig()
|
||||
End Sub
|
||||
Sub Load_Grundkonfig()
|
||||
Try
|
||||
'TODO: Diese Codezeile lädt Daten in die Tabelle "MyDataset.TBWMRH_TBKONFIGURATION". Sie können sie bei Bedarf verschieben oder entfernen.
|
||||
Me.TBWMRH_KONFIGURATIONTableAdapter.Fill(Me.MyDataset.TBWMRH_KONFIGURATION)
|
||||
LOG_ERRORS_ONLY = MyDataset.TBWMRH_KONFIGURATION.Rows(0).Item("LOG_ERRORS_ONLY")
|
||||
WDLAUFWERK = MyDataset.TBWMRH_KONFIGURATION.Rows(0).Item("WD_LAUFWERK")
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler in Load_Konfiguration:")
|
||||
End Try
|
||||
End Sub
|
||||
Sub Load_Profil()
|
||||
Try
|
||||
Me.TBWMRH_PROFILTableAdapter.Fill(Me.MyDataset.TBWMRH_PROFIL)
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler in Load_Profil:")
|
||||
End Try
|
||||
End Sub
|
||||
Private Sub ObjekttypenEintragen()
|
||||
Me.ObjekttypComboBox.Items.Clear()
|
||||
Try
|
||||
Dim oDokumentTypen As WINDREAMLib.WMObjects = Me._windream.GetObjecttypesAsObjects()
|
||||
If oDokumentTypen Is Nothing Then Exit Sub
|
||||
For Each aType In oDokumentTypen
|
||||
Me.ObjekttypComboBox.Items.Add(aType.aName)
|
||||
Next
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler bei ObjekttypenEintragen")
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
Sub Save_Profil()
|
||||
Try
|
||||
Select Case cmbTimeTyp.SelectedIndex
|
||||
Case 0
|
||||
RunTextBox.Text = "INTV;" & NumericUpDown.Value
|
||||
Case 1
|
||||
RunTextBox.Text = "TIME;" & dtp_Time.Text
|
||||
End Select
|
||||
|
||||
Me.TBWMRH_PROFILBindingSource.EndEdit()
|
||||
If MyDataset.TBWMRH_PROFIL.GetChanges Is Nothing = False Then
|
||||
Me.GEAENDERTWERTextBox.Text = Environment.UserName
|
||||
Me.TBWMRH_PROFILBindingSource.EndEdit()
|
||||
Me.TBWMRH_PROFILTableAdapter.Update(MyDataset.TBWMRH_PROFIL)
|
||||
statuslabel(True, "Profil erfolgreich gespeichert - " & Now)
|
||||
Else
|
||||
statuslabel(False, "")
|
||||
End If
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler in Save_Profil:")
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
Sub statuslabel(visible As Boolean, Text As String)
|
||||
Me.tsstatus.Visible = visible
|
||||
Me.tsstatus.Text = Text
|
||||
End Sub
|
||||
Private Sub btnDatenbankConnect_Click(sender As Object, e As EventArgs) Handles btnDatenbankConnect.Click
|
||||
DB_Path()
|
||||
End Sub
|
||||
Sub DB_Path()
|
||||
With OpenFileDialog1
|
||||
' Do
|
||||
.Filter = "Alle Dateien|*.*"
|
||||
.FilterIndex = 1
|
||||
.Title = "Pfad zur Datenbank:"
|
||||
If .ShowDialog() = DialogResult.OK Then
|
||||
Dim dbPath As String = .FileName
|
||||
My.Settings.myConnString = dbPath
|
||||
My.Settings.Save()
|
||||
Load_Constring()
|
||||
End If
|
||||
End With
|
||||
End Sub
|
||||
|
||||
Private Sub btnaddSearch_Click(sender As Object, e As EventArgs) Handles btnaddSearch.Click
|
||||
With OpenFileDialog1
|
||||
' Do
|
||||
.Filter = " windream-Suche|*.wdf|Alle Dateien|*.*"
|
||||
.FilterIndex = 1
|
||||
.Title = "Pfad zur windream-suche:"
|
||||
If .ShowDialog() = DialogResult.OK Then
|
||||
Me.WindreamSucheTextBox.Text = .FileName
|
||||
End If
|
||||
End With
|
||||
End Sub
|
||||
|
||||
Private Sub TBPROFILBindingSource_AddingNew(sender As Object, e As System.ComponentModel.AddingNewEventArgs)
|
||||
MyDataset.TBWMRH_PROFIL.ERSTELLTWERColumn.DefaultValue = Environment.UserName
|
||||
End Sub
|
||||
|
||||
Private Sub TBPROFILBindingSource_CurrentItemChanged(sender As Object, e As EventArgs)
|
||||
statuslabel(True, "TBPROFILBindingSource.CurrentItemChanged")
|
||||
End Sub
|
||||
|
||||
Private Sub TBPROFILBindingSource_PositionChanged(sender As Object, e As EventArgs)
|
||||
statuslabel(True, "TBPROFILBindingSource.PositionChanged - " & GUIDTextBox.Text)
|
||||
|
||||
'obj.SelectedIndex = cmbObjekttypen.FindStringExact()
|
||||
End Sub
|
||||
|
||||
Private Sub TabControlMain_SelectedIndexChanged(sender As Object, e As EventArgs) Handles TabControlMain.SelectedIndexChanged
|
||||
Select Case TabControlMain.SelectedIndex
|
||||
Case 0
|
||||
Load_Profil()
|
||||
Load_Uebersicht()
|
||||
Case 1
|
||||
ObjekttypenEintragen()
|
||||
Load_Profil()
|
||||
Case 2
|
||||
Load_Grundkonfig()
|
||||
End Select
|
||||
End Sub
|
||||
Private Sub TBPROFILBindingSource_BindingComplete(sender As Object, e As BindingCompleteEventArgs)
|
||||
statuslabel(True, "TBPROFILBindingSource.BindingComplete - " & GUIDTextBox.Text)
|
||||
End Sub
|
||||
Sub Checkbox_Days()
|
||||
Dim days As String
|
||||
If CheckBox1.Checked Then
|
||||
days = "1"
|
||||
Else
|
||||
days = "0"
|
||||
End If
|
||||
If CheckBox2.Checked Then
|
||||
days = days & "1"
|
||||
Else
|
||||
days = days & "0"
|
||||
End If
|
||||
If CheckBox3.Checked Then
|
||||
days = days & "1"
|
||||
Else
|
||||
days = days & "0"
|
||||
End If
|
||||
If CheckBox4.Checked Then
|
||||
days = days & "1"
|
||||
Else
|
||||
days = days & "0"
|
||||
End If
|
||||
If CheckBox5.Checked Then
|
||||
days = days & "1"
|
||||
Else
|
||||
days = days & "0"
|
||||
End If
|
||||
If CheckBox6.Checked Then
|
||||
days = days & "1"
|
||||
Else
|
||||
days = days & "0"
|
||||
End If
|
||||
If CheckBox7.Checked Then
|
||||
days = days & "1"
|
||||
Else
|
||||
days = days & "0"
|
||||
End If
|
||||
Me.DayTextBox.Text = days
|
||||
End Sub
|
||||
Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox1.CheckedChanged
|
||||
Checkbox_Days()
|
||||
End Sub
|
||||
|
||||
Private Sub CheckBox2_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox2.CheckedChanged
|
||||
Checkbox_Days()
|
||||
End Sub
|
||||
Private Sub CheckBox3_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox3.CheckedChanged
|
||||
Checkbox_Days()
|
||||
End Sub
|
||||
|
||||
Private Sub CheckBox4_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox4.CheckedChanged
|
||||
Checkbox_Days()
|
||||
End Sub
|
||||
|
||||
Private Sub CheckBox5_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox5.CheckedChanged
|
||||
Checkbox_Days()
|
||||
End Sub
|
||||
|
||||
Private Sub CheckBox6_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox6.CheckedChanged
|
||||
Checkbox_Days()
|
||||
End Sub
|
||||
|
||||
Private Sub CheckBox7_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox7.CheckedChanged
|
||||
Checkbox_Days()
|
||||
End Sub
|
||||
|
||||
Private Sub DayTextBox_TextChanged(sender As Object, e As EventArgs) Handles DayTextBox.TextChanged
|
||||
If DayTextBox.Text <> String.Empty Then
|
||||
'Markieren der Checkboxen'
|
||||
If DayTextBox.Text.Substring(0, 1) = 1 Then
|
||||
CheckBox1.Checked = True
|
||||
End If
|
||||
If DayTextBox.Text.Substring(1, 1) = 1 Then
|
||||
CheckBox2.Checked = True
|
||||
End If
|
||||
If DayTextBox.Text.Substring(2, 1) = 1 Then
|
||||
CheckBox3.Checked = True
|
||||
End If
|
||||
If DayTextBox.Text.Substring(3, 1) = 1 Then
|
||||
CheckBox4.Checked = True
|
||||
End If
|
||||
If DayTextBox.Text.Substring(4, 1) = 1 Then
|
||||
CheckBox5.Checked = True
|
||||
End If
|
||||
If DayTextBox.Text.Substring(5, 1) = 1 Then
|
||||
CheckBox6.Checked = True
|
||||
End If
|
||||
If DayTextBox.Text.Substring(6, 1) = 1 Then
|
||||
CheckBox7.Checked = True
|
||||
End If
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub RunTextBox_TextChanged(sender As Object, e As EventArgs) Handles RunTextBox.TextChanged
|
||||
Dim arr As String()
|
||||
arr = RunTextBox.Text.Split(";")
|
||||
|
||||
If RunTextBox.Text.Contains("TIME") Then
|
||||
dtp_Time.Value = CDate("01.01.1900 " & arr(1))
|
||||
Me.cmbTimeTyp.SelectedIndex = 1
|
||||
Me.dtp_Time.Visible = True
|
||||
Me.NumericUpDown.Visible = False
|
||||
lblTimeIntervall.Text = "Uhrzeit:"
|
||||
ElseIf RunTextBox.Text.Contains("INTV") Then 'INTV
|
||||
If arr(1) = "" Then arr(1) = "5"
|
||||
NumericUpDown.Value = arr(1)
|
||||
Me.cmbTimeTyp.SelectedIndex = 0
|
||||
Me.dtp_Time.Visible = False
|
||||
Me.NumericUpDown.Visible = True
|
||||
lblTimeIntervall.Text = "Intervall (Minute):"
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub cmbTimeTyp_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmbTimeTyp.SelectedIndexChanged
|
||||
Select Case cmbTimeTyp.SelectedIndex
|
||||
Case 0
|
||||
Me.dtp_Time.Visible = False
|
||||
Me.NumericUpDown.Visible = True
|
||||
RunTextBox.Text = "INTV;" & NumericUpDown.Value
|
||||
Case 1
|
||||
Me.dtp_Time.Visible = True
|
||||
Me.NumericUpDown.Visible = False
|
||||
RunTextBox.Text = "TIME;" & dtp_Time.Text
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Private Sub Load_Jobs(ProfilID As Integer)
|
||||
Try
|
||||
Me.TBWMRH_PROFIL_JOBTableAdapter.Fill(Me.MyDataset.TBWMRH_PROFIL_JOB, ProfilID)
|
||||
Catch ex As System.Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler in Load Jobs:")
|
||||
End Try
|
||||
End Sub
|
||||
Private Sub Load_FILE_JOBS(Profil_ID As Integer)
|
||||
Try
|
||||
Me.TBWMRH_PROFIL_FILE_JOBTableAdapter.Fill(Me.MyDataset.TBWMRH_PROFIL_FILE_JOB, Profil_ID)
|
||||
Me.STRING1ComboBox.Items.Clear()
|
||||
cmbFileJob_WHIndexe.Items.Clear()
|
||||
Dim indexe = _windream.GetIndicesByObjecttype(ObjekttypComboBox.Text)
|
||||
If indexe IsNot Nothing Then
|
||||
For Each index As String In indexe
|
||||
Me.STRING1ComboBox.Items.Add(index)
|
||||
cmbFileJob_WHIndexe.Items.Add(index)
|
||||
Next
|
||||
End If
|
||||
Catch ex As System.Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler in Load File-Jobs:")
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
Private Sub GUIDTextBox_TextChanged(sender As Object, e As EventArgs) Handles GUIDTextBox.TextChanged
|
||||
If GUIDTextBox.Text <> String.Empty Then
|
||||
Load_Jobs(GUIDTextBox.Text)
|
||||
Load_FILE_JOBS(GUIDTextBox.Text)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub ToolStripButton7_Click(sender As Object, e As EventArgs) Handles ToolStripButton7.Click
|
||||
Save_PROFIL_JOB()
|
||||
End Sub
|
||||
Sub Save_PROFIL_JOB()
|
||||
Try
|
||||
Me.TBWMRH_PROFIL_JOBBindingSource.EndEdit()
|
||||
If MyDataset.TBWMRH_PROFIL_JOB.GetChanges Is Nothing = False Then
|
||||
Me.GEAENDERTWERTextBox1.Text = Environment.UserName
|
||||
Me.TBWMRH_PROFIL_JOBBindingSource.EndEdit()
|
||||
Me.TBWMRH_PROFIL_JOBTableAdapter.Update(MyDataset.TBWMRH_PROFIL_JOB)
|
||||
statuslabel(True, "Profil-JOB erfolgreich gespeichert - " & Now)
|
||||
Else
|
||||
statuslabel(False, "")
|
||||
End If
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler in Save PROFIL-JOB:")
|
||||
End Try
|
||||
End Sub
|
||||
Sub Save_File_JOB()
|
||||
Try
|
||||
Me.TBWMRH_PROFIL_FILE_JOBBindingSource.EndEdit()
|
||||
If MyDataset.TBWMRH_PROFIL_FILE_JOB.GetChanges Is Nothing = False Then
|
||||
Me.GEAENDERTWERTextBox2.Text = Environment.UserName
|
||||
Me.TBWMRH_PROFIL_FILE_JOBBindingSource.EndEdit()
|
||||
Me.TBWMRH_PROFIL_FILE_JOBTableAdapter.Update(MyDataset.TBWMRH_PROFIL_FILE_JOB)
|
||||
statuslabel(True, "File-JOB erfolgreich gespeichert - " & Now)
|
||||
Else
|
||||
statuslabel(False, "")
|
||||
End If
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler in Save File-JOB:")
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub ToolStripButton2_Click(sender As Object, e As EventArgs) Handles ToolStripButton2.Click
|
||||
Dim result As MsgBoxResult
|
||||
result = MessageBox.Show("Sind Sie sicher dass Sie diesen Job löschen wollen?", "Bestätigung erforderlich:", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
|
||||
If result = MsgBoxResult.Yes Then
|
||||
Me.TBWMRH_PROFIL_JOBTableAdapter.Delete(Me.GUIDTextBox1.Text)
|
||||
Load_Jobs(Me.GUIDTextBox.Text)
|
||||
statuslabel(True, "Job wurde erfolgreich gelöscht! - " & Now)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub BindingNavigatorDeleteItem_Click(sender As Object, e As EventArgs) Handles BindingNavigatorDeleteItem.Click
|
||||
Dim result As MsgBoxResult
|
||||
result = MessageBox.Show("Sind Sie sicher dass Sie dieses Profil löschen wollen?", "Bestätigung erforderlich:", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
|
||||
If result = MsgBoxResult.Yes Then
|
||||
Me.TBWMRH_PROFIL_JOBTableAdapter.DeleteforPROFIL(Me.GUIDTextBox.Text)
|
||||
Me.TBWMRH_PROFIL_FILE_JOBTableAdapter.DeleteForProfil(Me.GUIDTextBox.Text)
|
||||
Me.TBWMRH_PROFILTableAdapter.Delete(Me.GUIDTextBox.Text)
|
||||
Load_Profil()
|
||||
statuslabel(True, "Profil wurde erfolgreich gelöscht! - " & Now)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub JOB_TYPComboBox_SelectedIndexChanged(sender As Object, e As EventArgs) Handles JOB_TYPComboBox.SelectedIndexChanged
|
||||
btnJOB_addSpeicherort.Visible = False
|
||||
lblString1.Text = ""
|
||||
lblString2.Text = ""
|
||||
Select Case JOB_TYPComboBox.SelectedIndex
|
||||
Case 0
|
||||
lblString1.Text = "Speicherort für windream-Ergebnisse:"
|
||||
btnJOB_addSpeicherort.Visible = True
|
||||
Case 1
|
||||
lblString1.Text = "Email-Empfänger:"
|
||||
Case 2 'Oracle
|
||||
lblString1.Text = "Connection String Oracle"
|
||||
lblString2.Text = "Command Oracle"
|
||||
Case 3 'MSSQL
|
||||
lblString1.Text = "Connection String MSSQL"
|
||||
lblString2.Text = "Command MSSQL"
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Private Sub btnJOB_addSpeicherort_Click(sender As Object, e As EventArgs) Handles btnJOB_addSpeicherort.Click
|
||||
With FolderBrowserDialog1
|
||||
' Do
|
||||
.Description = "Speicherort für Ergebnis-Dokumente"
|
||||
If .ShowDialog() = DialogResult.OK Then
|
||||
Me.STRING1TextBox.Text = .SelectedPath
|
||||
End If
|
||||
End With
|
||||
End Sub
|
||||
|
||||
Private Sub ToolStripButton9_Click(sender As Object, e As EventArgs) Handles ToolStripButton9.Click
|
||||
Dim result As MsgBoxResult
|
||||
result = MessageBox.Show("Sind Sie sicher dass Sie diesen File-Job löschen wollen?", "Bestätigung erforderlich:", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
|
||||
If result = MsgBoxResult.Yes Then
|
||||
Me.TBWMRH_PROFIL_FILE_JOBTableAdapter.Delete(Me.GUIDTextBox2.Text)
|
||||
Load_FILE_JOBS(Me.GUIDTextBox.Text)
|
||||
statuslabel(True, "File-Job wurde erfolgreich gelöscht! - " & Now)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub ToolStripButton14_Click(sender As Object, e As EventArgs) Handles ToolStripButton14.Click
|
||||
Save_File_JOB()
|
||||
End Sub
|
||||
|
||||
Private Sub STEP_TYPComboBox_SelectedIndexChanged(sender As Object, e As EventArgs) Handles STEP_TYPComboBox.SelectedIndexChanged
|
||||
cmbFileJob_WHIndexe.Visible = False
|
||||
btnFileJob_addIndex.Visible = False
|
||||
Me.btnaddDatetime.Visible = False
|
||||
STRING1TextBoxFile_Job.Visible = False
|
||||
STRING2TextBoxProfil_FileJob.Visible = False
|
||||
lblString2FileJobs.Visible = False
|
||||
btnTestCon.Visible = False
|
||||
lblndexname.Visible = False
|
||||
If STEP_TYPComboBox.SelectedIndex <> -1 Then
|
||||
Select Case STEP_TYPComboBox.SelectedIndex
|
||||
Case 0
|
||||
lblString1FileJobs.Text = "Indexname"
|
||||
STRING1ComboBox.Visible = True
|
||||
|
||||
lblString2FileJobs.Text = "Wert"
|
||||
STRING2TextBoxProfil_FileJob.Visible = True
|
||||
Me.btnaddDatetime.Visible = True
|
||||
|
||||
Case 1
|
||||
Renamewithindex()
|
||||
Case 2
|
||||
Renamewithindex()
|
||||
Case 3 'Oracle
|
||||
btnTestCon.Visible = True
|
||||
lblString1FileJobs.Text = "Connection String Oracle"
|
||||
lblString2FileJobs.Text = "Command Oracle"
|
||||
STRING1TextBoxFile_Job.Visible = True
|
||||
STRING2TextBoxProfil_FileJob.Visible = True
|
||||
lblString2FileJobs.Visible = True
|
||||
Case 4 'MSSQL
|
||||
btnTestCon.Visible = True
|
||||
lblString1FileJobs.Text = "Connection String MSSQL"
|
||||
lblString2FileJobs.Text = "Command MSSQL"
|
||||
STRING1TextBoxFile_Job.Visible = True
|
||||
STRING2TextBoxProfil_FileJob.Visible = True
|
||||
lblString2FileJobs.Visible = True
|
||||
End Select
|
||||
|
||||
End If
|
||||
End Sub
|
||||
Sub Renamewithindex()
|
||||
lblString1FileJobs.Text = "Namenkonvention"
|
||||
STRING1ComboBox.Visible = False
|
||||
STRING1TextBoxFile_Job.Visible = True
|
||||
lblndexname.Visible = True
|
||||
|
||||
cmbFileJob_WHIndexe.Visible = True
|
||||
btnFileJob_addIndex.Visible = True
|
||||
End Sub
|
||||
Private Sub btn_runProfileManual_Click(sender As Object, e As EventArgs) Handles btn_runProfileManual.Click
|
||||
'Try
|
||||
' Dim result As MsgBoxResult
|
||||
' If RunningCheckBox.Checked = False Then
|
||||
|
||||
' result = MessageBox.Show("Bitte bestätigen Sie den manuellen Start des Profils!", "Bestätigung erforderlich:", MessageBoxButtons.OKCancel, MessageBoxIcon.Question)
|
||||
' If result = MsgBoxResult.Ok Then
|
||||
' Me.TBWMRH_PROFILTableAdapter.cmdUpdateRunningnow(Me.GUIDTextBox.Text)
|
||||
' MsgBox("Das Profil wurde für den manuellen Durchlauf markiert. Der Durchlauf sollte innerhalb der nächsten Minute starten.", MsgBoxStyle.Information)
|
||||
' Load_Profil()
|
||||
' End If
|
||||
' Else
|
||||
' result = MessageBox.Show("Achtung das Profil schein noch zu laufen, dennoch Updaten??", "Bestätigung erforderlich:", MessageBoxButtons.OKCancel, MessageBoxIcon.Question)
|
||||
' If result = MsgBoxResult.Ok Then
|
||||
' Me.TBWMRH_PROFILTableAdapter.cmdUpdateRunningnow(Me.GUIDTextBox.Text)
|
||||
' Load_Profil()
|
||||
' End If
|
||||
' End If
|
||||
|
||||
'Catch ex As Exception
|
||||
' MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler in Run Job manually:")
|
||||
'End Try
|
||||
Me.TBWMRH_PROFILTableAdapter.cmdUpdateRunningnow(Me.GUIDTextBox.Text)
|
||||
Manual()
|
||||
End Sub
|
||||
|
||||
Private Sub tabtn_refreshProfile_Click(sender As Object, e As EventArgs) Handles tabtn_refreshProfile.Click
|
||||
Load_Profil()
|
||||
End Sub
|
||||
|
||||
Private Sub tsbtmrefresh_Uebersicht_Click(sender As Object, e As EventArgs) Handles tsbtmrefresh_Uebersicht.Click
|
||||
Load_Uebersicht()
|
||||
End Sub
|
||||
|
||||
Private Sub btnsave_Grundkonfig_Click(sender As Object, e As EventArgs) Handles btnsave_Grundkonfig.Click
|
||||
Try
|
||||
Me.TBWMRH_KONFIGURATIONBindingSource.EndEdit()
|
||||
If MyDataset.TBWMRH_KONFIGURATION.GetChanges Is Nothing = False Then
|
||||
Me.GEAENDERT_WERTextBox.Text = Environment.UserName
|
||||
Me.TBWMRH_KONFIGURATIONBindingSource.EndEdit()
|
||||
Me.TBWMRH_KONFIGURATIONTableAdapter.Update(MyDataset.TBWMRH_KONFIGURATION)
|
||||
statuslabel(True, "Grundkonfiguration gespeichert - " & Now)
|
||||
Load_Grundkonfig()
|
||||
End If
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler in Save Grundkonfig:")
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub btnaddDatetime_Click(sender As Object, e As EventArgs) Handles btnaddDatetime.Click
|
||||
Me.STRING2TextBoxProfil_FileJob.Text = STRING2TextBoxProfil_FileJob.Text & "[%DATETIME]"
|
||||
End Sub
|
||||
Private Sub btnFileJob_addIndex_Click(sender As Object, e As EventArgs) Handles btnFileJob_addIndex.Click
|
||||
If cmbFileJob_WHIndexe.SelectedIndex <> -1 Then
|
||||
STRING1TextBoxFile_Job.Text = STRING1TextBoxFile_Job.Text & "[%" & cmbFileJob_WHIndexe.Text & "]"
|
||||
End If
|
||||
End Sub
|
||||
Sub Manual()
|
||||
'Try
|
||||
Dim notcompleted As Boolean = False
|
||||
|
||||
clsLogger.Add("", False)
|
||||
clsLogger.Add("## Start Durchlauf WindreamResultHandler - " & Now & " ## ", False)
|
||||
clsLogger.Add("", False)
|
||||
'windream initialisieren
|
||||
If _windream.Init() = True Then
|
||||
clsLogger.AddDetailLog("windream vollumfänglich initialisiert!")
|
||||
'Zur sicherheit die DB nochmal initialiseren
|
||||
If clsDatatabase.Init() = True Then
|
||||
Dim DT As DataTable = clsDatatabase.Return_Datatable("SELECT GUID FROM TBWMRH_PROFIL WHERE AKTIV = 1 order by REIHENFOLGE")
|
||||
If DT.Rows.Count > 0 Then
|
||||
clsLogger.AddDetailLog("Anzahl der aktiven Profile: " & DT.Rows.Count.ToString)
|
||||
For Each DR As DataRow In DT.Rows
|
||||
_PROFIL_ID = CInt(DR.Item("GUID"))
|
||||
'Und nun das Profil durchlaufen
|
||||
Dim initresult = clsProfil.Init(_PROFIL_ID)
|
||||
If initresult = True Then
|
||||
clsLogger.WriteLog()
|
||||
clsProfil.Profil_Durchlauf()
|
||||
ElseIf initresult = False Then
|
||||
clsLogger.Add("clsProfil konnte nicht initialisiert werden", True, "RUN_THREAD")
|
||||
notcompleted = True
|
||||
ElseIf initresult = 0 Then
|
||||
clsLogger.AddDetailLog("initresult: 0")
|
||||
notcompleted = True
|
||||
ElseIf initresult = 1 Then
|
||||
clsLogger.AddDetailLog("initresult: 1")
|
||||
notcompleted = True
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
clsLogger.Add("- Keine aktiven Profile vorhanden", False)
|
||||
notcompleted = True
|
||||
End If
|
||||
clsDatatabase.Execute_non_Query("UPDATE TBWMRH_KONFIGURATION SET LAST_TICK = GETDATE() WHERE GUID = 1")
|
||||
Else
|
||||
clsLogger.Add("- clsSQLLite konnte nicht initialisiert werden!", False)
|
||||
notcompleted = True
|
||||
End If
|
||||
Else
|
||||
clsLogger.Add("# Achtung: Windream-Init mit Fehlern beendet", False)
|
||||
notcompleted = True
|
||||
End If
|
||||
If notcompleted = True Then
|
||||
clsLogger.WriteLog()
|
||||
End If
|
||||
MsgBox("Run completed!", MsgBoxStyle.Information)
|
||||
'Catch ex As Exception
|
||||
' clsLogger.AddError(ex.Message, "RUN_THREAD")
|
||||
'End Try
|
||||
End Sub
|
||||
|
||||
Private Sub TBWMRH_PROFIL_JOBBindingSource_AddingNew_1(sender As Object, e As System.ComponentModel.AddingNewEventArgs) Handles TBWMRH_PROFIL_JOBBindingSource.AddingNew
|
||||
MyDataset.TBWMRH_PROFIL_JOB.ERSTELLTWERColumn.DefaultValue = Environment.UserName
|
||||
MyDataset.TBWMRH_PROFIL_JOB.PROFIL_IDColumn.DefaultValue = GUIDTextBox.Text
|
||||
End Sub
|
||||
|
||||
Private Sub TBWMRH_PROFIL_FILE_JOBBindingSource_AddingNew(sender As Object, e As System.ComponentModel.AddingNewEventArgs) Handles TBWMRH_PROFIL_FILE_JOBBindingSource.AddingNew
|
||||
MyDataset.TBWMRH_PROFIL_FILE_JOB.ERSTELLTWERColumn.DefaultValue = Environment.UserName
|
||||
MyDataset.TBWMRH_PROFIL_FILE_JOB.PROFIL_IDColumn.DefaultValue = GUIDTextBox.Text
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
|
||||
Process.Start(clsLogger.LogFilename)
|
||||
End Sub
|
||||
|
||||
Private Sub btnTestCon_Click(sender As Object, e As EventArgs) Handles btnTestCon.Click
|
||||
If STRING1TextBoxFile_Job.Text = "" Then
|
||||
Exit Sub
|
||||
End If
|
||||
If STEP_TYPComboBox.Text = "Execute Oracle Command" Then
|
||||
If clsDatatabase.Oracle_CS_Test(STRING1TextBoxFile_Job.Text) = True Then
|
||||
MsgBox("Oracle Connection successfull!", MsgBoxStyle.Information)
|
||||
Exit Sub
|
||||
End If
|
||||
ElseIf STEP_TYPComboBox.Text = "Execute MSSQL Command" Then
|
||||
If clsDatatabase.MSSQL_CS_Test(STRING1TextBoxFile_Job.Text) = True Then
|
||||
MsgBox("MSSQL Connection successfull!", MsgBoxStyle.Information)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
clsLogger.WriteLog()
|
||||
MsgBox("Connection could not be created - Check the log", MsgBoxStyle.Critical)
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
|
||||
Try
|
||||
Dim p As New Process()
|
||||
p.StartInfo.FileName = Me.WindreamSucheTextBox.Text
|
||||
p.StartInfo.WindowStyle = ProcessWindowStyle.Normal
|
||||
p.Start()
|
||||
p.WaitForExit()
|
||||
p.Close()
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler bei Öffnen der windream-Suche:")
|
||||
End Try
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user