|
|
Imports System.IO
|
|
|
Imports ALLGEMEIN.UI
|
|
|
Imports System.Drawing.Color
|
|
|
Imports System.Data
|
|
|
Imports System.Data.SqlTypes
|
|
|
Imports System.Data.SqlClient
|
|
|
|
|
|
Imports EDOKALib.Common
|
|
|
Imports EDOKALib
|
|
|
Public Class EdokaMain
|
|
|
Implements mMain.SingleInstance.ISingleInstanceForm
|
|
|
|
|
|
'Rel 4.0 - BUD - 2007.04.27 - Dim auskommentiert (brauchts nicht)
|
|
|
'Dim WithEvents f1 As New frmMeldungen()
|
|
|
|
|
|
Dim fcheckdoc As New frmDefekteDokumente()
|
|
|
Dim ShowDefekteDokumente As Boolean = False
|
|
|
Dim ShowGeburtstag As Boolean = False
|
|
|
|
|
|
Dim WithEvents MyTimer As New System.Timers.Timer(900000)
|
|
|
Dim mytimerstopped As Boolean
|
|
|
|
|
|
Dim forceexit As Boolean = False
|
|
|
Dim pnr(10) As Integer
|
|
|
Dim spnr(10) As Integer
|
|
|
Dim shellparams As String
|
|
|
Dim barcodeid As String
|
|
|
|
|
|
|
|
|
Private Edoka_Gestartet As Boolean = False
|
|
|
|
|
|
|
|
|
Private Overloads Sub EDOKAMain_Load()
|
|
|
If Not Edoka_Gestartet Then
|
|
|
Dim baseSplash As SplashScreen
|
|
|
'Splash Screen
|
|
|
Me.WindowState = FormWindowState.Maximized
|
|
|
Me.Refresh()
|
|
|
baseSplash = New Splash()
|
|
|
SplashScreenController.Show(baseSplash, 3)
|
|
|
System.Threading.Thread.Sleep(0)
|
|
|
init_system()
|
|
|
If Globals.show_releasenotes Then
|
|
|
'RGL 20080612 RelNotes nur von DB lesen wenn auch angezeigt wird
|
|
|
getRelNotes(Globals.Applikationsdaten.Rows(Globals.AppldataRow).Item("relNotes"))
|
|
|
Dim f As New frmWordViewer()
|
|
|
f.addressBar.Text = "H:\TSSETTINGS\EDOKA\relNotes.doc"
|
|
|
f.Text = "Release-Informationen"
|
|
|
f.Show()
|
|
|
End If
|
|
|
End If
|
|
|
End Sub
|
|
|
|
|
|
Private Function check_version() As Integer
|
|
|
Try
|
|
|
ChDir(DivFnkt.Get_Filename("", ""))
|
|
|
Catch
|
|
|
MkDir(DivFnkt.Get_Filename("", ""))
|
|
|
End Try
|
|
|
|
|
|
Try
|
|
|
If Globals.Applikationsdaten.Rows(0).Item("version") <> Globals.Version Then
|
|
|
MyMsg.show_standardmessage(42, MsgBoxStyle.Critical)
|
|
|
Application.Exit()
|
|
|
Globals.Force_Exit = True
|
|
|
Me.forceexit = True
|
|
|
Exit Function
|
|
|
Dim p As New EdokaUpd()
|
|
|
p.PrepareUpdate()
|
|
|
p = Nothing
|
|
|
Dim StartInfo As New ProcessStartInfo()
|
|
|
Dim S As String
|
|
|
Dim i As Integer
|
|
|
S = DivFnkt.Get_Filename("UpdateEdoka.cmd", "")
|
|
|
Me.shellparams = S
|
|
|
Me.forceexit = True
|
|
|
End If
|
|
|
Catch
|
|
|
End Try
|
|
|
End Function
|
|
|
|
|
|
'Rel 4.0 - BUD - 2007.04.27 - Auskommentiert, da auf Terminal Server nicht erlaubt.
|
|
|
'Private Function SetLocalSystemTime()
|
|
|
' 'Rel 3.2 bud - Set System Time
|
|
|
' 'Ruft den Befehl NET TIME auf. Somit wird die Lokale System Zeit mit dem Server abgeglichen.
|
|
|
' Try
|
|
|
' Dim aa
|
|
|
' aa = Shell("cmd.exe /C" & " NET TIME /SET /YES", AppWinStyle.Hide, False)
|
|
|
' Catch
|
|
|
' End Try
|
|
|
'End Function
|
|
|
|
|
|
Private Sub init_system()
|
|
|
|
|
|
'initialisierung
|
|
|
' Datenbank Connection initialisieren
|
|
|
Dim db_conn As New EDOKA.DB_Connection()
|
|
|
Globals.conn.sConnectionString = Globals.sConnectionString
|
|
|
Globals.EDOKAMAIN_Statusbar = Me.StatusBar1
|
|
|
|
|
|
'Benutzer auslesen
|
|
|
If Not Globals.Mitarbeiter.Get_Mitarbeiter Then
|
|
|
MyMsg.show_standardmessage(900, MsgBoxStyle.Critical)
|
|
|
End
|
|
|
End If
|
|
|
|
|
|
'aktuellerBenutzer f<>r EdokaLib setzen
|
|
|
Dim aktuellerBenutzer As New EDOKALib.BusinessFacade.AktuellerBenutzer(Globals.MitarbeiterNr)
|
|
|
|
|
|
'initialisierung von logging by uwe 2006-10-16
|
|
|
Try
|
|
|
#If DEBUG Then
|
|
|
Dim c As New TKBLib.Errorhandling.Config(True) 'throw exceptions in errorhandling classes
|
|
|
#End If
|
|
|
#If Not Debug Then
|
|
|
Dim c As New TKBLib.Errorhandling.Config(False) 'do NOT throw exceptions in errorhandling classes
|
|
|
#End If
|
|
|
|
|
|
Dim paramLogLevel As EDOKALib.BusinessFacade.Parameter
|
|
|
Dim paramLogLevelUserJournal As EDOKALib.BusinessFacade.Parameter
|
|
|
Dim paramLogToFile As EDOKALib.BusinessFacade.Parameter
|
|
|
Dim paramLogFilePath As BusinessFacade.Parameter
|
|
|
|
|
|
|
|
|
paramLogLevel = EDOKALib.BusinessFacade.Config.GetParameter("LogLevel")
|
|
|
paramLogLevelUserJournal = EDOKALib.BusinessFacade.Config.GetParameter("LogLevelUserJournal")
|
|
|
paramLogToFile = EDOKALib.BusinessFacade.Config.GetParameter("LogToFile")
|
|
|
paramLogFilePath = EDOKALib.BusinessFacade.Config.GetParameter("LogFilePath")
|
|
|
|
|
|
Dim tl As System.Diagnostics.TraceLevel
|
|
|
Dim th As TKBLib.Errorhandling.TraceHelper
|
|
|
Dim t As New TKBLib.Errorhandling.Tracer()
|
|
|
|
|
|
If BusinessFacade.AktuellerBenutzer.Journalisierung Then
|
|
|
tl = CType(paramLogLevelUserJournal.Wert, System.Diagnostics.TraceLevel)
|
|
|
|
|
|
If CBool(paramLogToFile.Wert) = True And paramLogFilePath.Wert.Trim.Length > 0 Then
|
|
|
TKBLib.Errorhandling.Tracer.StartLoggingToTextFile(paramLogFilePath.Wert, True)
|
|
|
End If
|
|
|
Else
|
|
|
tl = CType(paramLogLevel.Wert, System.Diagnostics.TraceLevel)
|
|
|
End If
|
|
|
th = New TKBLib.Errorhandling.TraceHelper(tl)
|
|
|
TKBLib.Errorhandling.Tracer.StartLoggingToDatabase(Globals.sConnectionString, aktuellerBenutzer.MitarbeiterNr.ToString())
|
|
|
TKBLib.Errorhandling.TraceHelper.Msg("Edoka.edokamain.init_sys", "logging started", TraceLevel.Info)
|
|
|
|
|
|
Catch ex As Exception
|
|
|
Console.WriteLine(ex.Message + " " + ex.StackTrace)
|
|
|
End Try
|
|
|
|
|
|
'Rel 4.0 - BUD - wieder ausgebaut, da auf EDOKA auf Terminalserver l<>uft
|
|
|
' Rel 3.2 bud - Lokale Systemzeit setzen
|
|
|
' SetLocalSystemTime()
|
|
|
|
|
|
'System Pr<50>fung / Vista / BUD Rel. 3.7 / -> leider keine sch<63>ne l<>sung
|
|
|
Dim AppRowID As Integer
|
|
|
If DivFnkt.FolderExist("C:\OS") Then
|
|
|
AppRowID = 2
|
|
|
Else
|
|
|
AppRowID = 1
|
|
|
End If
|
|
|
|
|
|
'Applikationsdaten laden
|
|
|
Dim Applikation As New edokadb.clsApplikation()
|
|
|
Dim i As Integer
|
|
|
Applikation.cpMainConnectionProvider = Globals.conn
|
|
|
Applikation.iApplikationsnr = New SqlInt32(CType(AppRowID, Int32))
|
|
|
Globals.Applikationsdaten = Applikation.SelectOne
|
|
|
'Globals.Applikationsdaten = Applikation.SelectAll
|
|
|
If check_version() = False Then
|
|
|
If Me.forceexit Then Exit Sub
|
|
|
End If
|
|
|
|
|
|
For i = 0 To Globals.Applikationsdaten.Rows.Count - 1
|
|
|
If Globals.Applikationsdaten.Rows(i).Item("mandantnr") = Globals.MandantNr Then
|
|
|
Globals.AppldataRow = i
|
|
|
End If
|
|
|
Next
|
|
|
|
|
|
'20071129 RGL / KC Avaloq Anbindung
|
|
|
Globals.CutOverDatum = Globals.Applikationsdaten.Rows(Globals.AppldataRow).Item("CutoverDate")
|
|
|
Globals.SpoolerDir = Globals.Applikationsdaten.Rows(Globals.AppldataRow).Item("SpoolerDir")
|
|
|
''20080616 KC Neuanforderung Spoolerdir auf C:\ mit TGNUMMER!
|
|
|
Globals.SpoolerDir = Replace(Globals.SpoolerDir, "%TGNummer%", Globals.TGNummer)
|
|
|
Globals.SpoolerTempDir = Globals.Applikationsdaten.Rows(Globals.AppldataRow).Item("SpoolerTempDir")
|
|
|
Globals.DeleteSpoolerFile = Globals.Applikationsdaten.Rows(Globals.AppldataRow).Item("DeleteSpoolerFiles")
|
|
|
getSpoolerXSD(Globals.Applikationsdaten.Rows(Globals.AppldataRow).Item("XSD_File"))
|
|
|
'Globals.OutputDir_VorlagenExport = Globals.Applikationsdaten.Rows(Globals.AppldataRow).Item("OutputDir_Vorlagenexport")
|
|
|
|
|
|
If Globals.Applikationsdaten.Rows(Globals.AppldataRow).Item("showlogin") = True Then
|
|
|
Dim frm As New frmLogin()
|
|
|
frm.cbMitarbeiter.Select()
|
|
|
frm.ShowDialog()
|
|
|
If frm.Mitarbeiternr = -99999 Then
|
|
|
Close()
|
|
|
Exit Sub
|
|
|
End If
|
|
|
End If
|
|
|
|
|
|
If Globals.Applikationsdaten.Rows(Globals.AppldataRow).Item("showlogin") = False Then
|
|
|
'Me.mnuLoginSplit.Visible = False
|
|
|
Me.MnuNewLogin.Visible = False
|
|
|
Me.Panel1.Visible = False
|
|
|
Me.Label1.Visible = False
|
|
|
Else
|
|
|
Me.MnuNewLogin.Visible = True
|
|
|
Me.Label1.Visible = True
|
|
|
Me.Panel1.Visible = True
|
|
|
Me.Label1.Text = "Test-/Schulungsumgebung Datenbank: [" + Globals.conn.scoDBConnection.DataSource.ToString + "." + Globals.conn.scoDBConnection.Database.ToString + "]"
|
|
|
End If
|
|
|
|
|
|
'Rel 3.73 / BUD
|
|
|
fMehrfachdruck = New frmMehrfachdruck()
|
|
|
fMehrfachdruck.MdiParent = Me
|
|
|
fMehrfachdruck.Visible = False
|
|
|
fMehrfachdruck.Hide()
|
|
|
fMehrfachdruck.InitForm()
|
|
|
|
|
|
If DivFnkt.BarcodeEtiketten_Berechtigt = False Then
|
|
|
Me.MenuItem11.Enabled = False
|
|
|
Else
|
|
|
Me.MenuItem11.Enabled = True
|
|
|
End If
|
|
|
refresh_menu_trefferliste()
|
|
|
Delete_Old_Files()
|
|
|
MyTimer.Interval = Globals.Applikationsdaten.Rows(0).Item("Zeitintervall_in_minuten") * 60 * 1000
|
|
|
AddHandler MyTimer.Elapsed, AddressOf TimerFired
|
|
|
MyTimer.Start()
|
|
|
mytimerstopped = False
|
|
|
Me.fcheckdoc.MdiParent = Me
|
|
|
Me.fcheckdoc.fnkt = 1
|
|
|
'Rel 4.0 - BUD - 21.05.2007 Fehlerhafte Dokumente nur anzeigen wenn kein Start aus XML.
|
|
|
If Action.Action.ActionType = 0 Then check_doc_abschluss(True)
|
|
|
|
|
|
Dim ma As New edokadb.clsMitarbeiter()
|
|
|
ma.cpMainConnectionProvider = Globals.conn
|
|
|
ma.iMitarbeiternr = New SqlTypes.SqlInt32(CType(Globals.MitarbeiterNr, Int32))
|
|
|
ma.SelectOne()
|
|
|
Globals.show_releasenotes = ma.bShowtip.Value = True
|
|
|
ma.bShowtip = New SqlTypes.SqlBoolean(CType(False, Boolean))
|
|
|
conn.OpenConnection()
|
|
|
ma.Update()
|
|
|
conn.CloseConnection(True)
|
|
|
ma.Dispose()
|
|
|
Try
|
|
|
Me.HelpProvider1.HelpNamespace = Application.StartupPath + "\benudok.chm"
|
|
|
Catch
|
|
|
End Try
|
|
|
Try
|
|
|
DivFnkt.Gesperrte_Dokumente_Loeschen()
|
|
|
Catch
|
|
|
End Try
|
|
|
|
|
|
'Rel 3.5 / BUD
|
|
|
'Pr<50>fen ob der angemeldete User Geburstag hat.
|
|
|
If Check_Geburtstag(Globals.MitarbeiterNr) = 1 Then
|
|
|
Dim frm As New frmGeburtstag()
|
|
|
frm.MdiParent = Me
|
|
|
frm.StartPosition = FormStartPosition.CenterScreen
|
|
|
frm.TopMost = True
|
|
|
frm.Show()
|
|
|
Me.ShowGeburtstag = True
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
'REL 3.7 / SHU
|
|
|
'Ein bzw. Ausblenden der Serienbrief-Funktionalit<69>ten
|
|
|
If Me.Check_show_sb = False Then
|
|
|
Me.mnuserienbriefe.Visible = False
|
|
|
Me.mnuPartnerlisten.Visible = False
|
|
|
Me.MenuItem66.Visible = False
|
|
|
Else
|
|
|
Me.mnuserienbriefe.Visible = True
|
|
|
Me.mnuPartnerlisten.Visible = True
|
|
|
Me.MenuItem66.Visible = True
|
|
|
End If
|
|
|
|
|
|
End Sub
|
|
|
Private Sub getSpoolerXSD(ByVal xsd As Byte())
|
|
|
'Checken ob Spooler Ordner vorhanden sind.
|
|
|
If Directory.Exists(Globals.SpoolerDir) = False Then
|
|
|
Directory.CreateDirectory(Globals.SpoolerDir)
|
|
|
End If
|
|
|
|
|
|
Dim K As Long
|
|
|
K = UBound(xsd)
|
|
|
Dim fs As New FileStream(Globals.SpoolerDir & "\EdokaActionInterface.xsd", FileMode.Create, FileAccess.Write)
|
|
|
fs.Write(xsd, 0, K)
|
|
|
fs.Close()
|
|
|
fs = Nothing
|
|
|
|
|
|
|
|
|
End Sub
|
|
|
Private Sub getRelNotes(ByVal relNotes As Byte())
|
|
|
Dim K As Long
|
|
|
K = UBound(relNotes)
|
|
|
Try
|
|
|
Dim fs As New FileStream("H:\\TSSETTINGS\\EDOKA\\relNotes.doc", FileMode.Create, FileAccess.Write)
|
|
|
fs.Write(relNotes, 0, K)
|
|
|
fs.Close()
|
|
|
fs = Nothing
|
|
|
Catch ex As Exception
|
|
|
End Try
|
|
|
|
|
|
End Sub
|
|
|
Private Function Check_offene_dp_instanzen() As Boolean
|
|
|
Dim f As New frmOffeneDPInstanzen()
|
|
|
Dim d As DataTable
|
|
|
d = f.Generic_Select(1)
|
|
|
If d.Rows.Count > 0 Then
|
|
|
f.Show()
|
|
|
f.Left = Me.Width - f.Width - 10
|
|
|
f.MdiParent = Me
|
|
|
Return True
|
|
|
Else
|
|
|
f.Dispose()
|
|
|
Return False
|
|
|
End If
|
|
|
End Function
|
|
|
|
|
|
Private Function Check_Geburtstag(ByVal iMitarbeiterNr As Integer) As Integer
|
|
|
Check_Geburtstag = 0
|
|
|
Try
|
|
|
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
|
|
Dim s As String
|
|
|
Dim dtToReturn As DataTable = New DataTable()
|
|
|
Dim sdaAdapter As SqlDataAdapter = New SqlDataAdapter(scmCmdToExecute)
|
|
|
scmCmdToExecute.CommandText = "dbo.sp_check_geburtstag"
|
|
|
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
|
|
scmCmdToExecute.Connection = conn.scoDBConnection
|
|
|
Try
|
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMANR", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, iMitarbeiterNr))
|
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@iReturn", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, 0))
|
|
|
sdaAdapter.Fill(dtToReturn)
|
|
|
Check_Geburtstag = scmCmdToExecute.Parameters.Item("@iReturn").Value
|
|
|
Catch ex As Exception
|
|
|
|
|
|
Throw New Exception("::Error occured." & ex.Message, ex)
|
|
|
Finally
|
|
|
scmCmdToExecute.Dispose()
|
|
|
sdaAdapter.Dispose()
|
|
|
End Try
|
|
|
Catch
|
|
|
|
|
|
End Try
|
|
|
End Function
|
|
|
|
|
|
Private Sub MenuItem6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem6.Click
|
|
|
If Globals.Bearbeitung_Problemdokumente Then Globals.Global_ForceExit = True
|
|
|
Me.Close()
|
|
|
End Sub
|
|
|
|
|
|
'Rel. 4.03 Aktive Dokumenterstellungsfenster immer im Vordergund halten
|
|
|
'Private Sub EDOKAMain_MdiChildActivate(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.MdiChildActivate
|
|
|
' Dim p As Boolean = False
|
|
|
' Dim d As Boolean = False
|
|
|
' Dim v As Boolean = False
|
|
|
' Dim pf As Form
|
|
|
' Dim df As Form
|
|
|
' Dim vf As Form
|
|
|
' For Each f As Form In Me.MdiChildren
|
|
|
' If f.Name = "frmDokumentbearbeitung" Then
|
|
|
' d = True
|
|
|
' df = f
|
|
|
' End If
|
|
|
' If f.Name = "frmDokumentbearbeitungBC" Then
|
|
|
' d = True
|
|
|
' df = f
|
|
|
' End If
|
|
|
' If f.Name = "frmDokumentbearbeitungED" Then
|
|
|
' d = True
|
|
|
' df = f
|
|
|
' End If
|
|
|
' 'If f.Name = "frmDokumentpaket" Then
|
|
|
' 'd = True
|
|
|
' 'df = f
|
|
|
' 'End If
|
|
|
' If f.Name = "FrmPartnersuche" Then
|
|
|
' p = True
|
|
|
' pf = f
|
|
|
' End If
|
|
|
' If f.Name = "frmVorlagenauswahl" Then
|
|
|
' v = True
|
|
|
' vf = f
|
|
|
' End If
|
|
|
' Next
|
|
|
' If p Then
|
|
|
' pf.Activate()
|
|
|
' Exit Sub
|
|
|
' End If
|
|
|
' If d Then
|
|
|
' df.Activate()
|
|
|
' Exit Sub
|
|
|
' End If
|
|
|
' If v Then
|
|
|
' vf.Activate()
|
|
|
' Exit Sub
|
|
|
' End If
|
|
|
'End Sub
|
|
|
|
|
|
|
|
|
Private Sub edokamain_resize(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Resize
|
|
|
'Me.MandantRolle.Left = Me.Right - Me.MandantRolle.Width
|
|
|
Globals.EDOKAMAIN_WindowHeight = Me.Height
|
|
|
Globals.EDOKAMAIN_WindowWidth = Me.Width
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MnuSystemadministration_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MnuSystemadministration.Click
|
|
|
Dim f As New FrmSysadminMenu()
|
|
|
|
|
|
Dim x As Windows.Forms.Form
|
|
|
Dim isactive As Boolean
|
|
|
isactive = False
|
|
|
For Each x In Me.MdiChildren
|
|
|
If x.Name = f.Name And x.Visible = True Then
|
|
|
f.Dispose()
|
|
|
x.BringToFront()
|
|
|
isactive = True
|
|
|
End If
|
|
|
Next
|
|
|
If Not isactive Then
|
|
|
f.MdiParent = Me
|
|
|
f.Show()
|
|
|
End If
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MenuItem12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MenuItem12_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MnuNewLogin.Click
|
|
|
init_system()
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MenuItem12_Click_2(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem12.Click
|
|
|
Me.LayoutMdi(System.Windows.Forms.MdiLayout.TileHorizontal)
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MenuItem13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem13.Click
|
|
|
Me.LayoutMdi(System.Windows.Forms.MdiLayout.TileVertical)
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MenuItem14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem14.Click
|
|
|
Me.LayoutMdi(System.Windows.Forms.MdiLayout.Cascade)
|
|
|
End Sub
|
|
|
|
|
|
Sub close_all_childs()
|
|
|
Dim c As Windows.Forms.Form
|
|
|
For Each c In Me.MdiChildren
|
|
|
c.Close()
|
|
|
Next
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MenuItem15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem15.Click
|
|
|
close_all_childs()
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MenuItem16_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem16.Click
|
|
|
Dim f As New frmPartnerHost()
|
|
|
f.Show()
|
|
|
End Sub
|
|
|
|
|
|
Private Sub EDOKAMain_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
|
|
|
Dim bExit As Boolean = True
|
|
|
Dim lcnt As Integer
|
|
|
|
|
|
''check Problemdokumente
|
|
|
'If Globals.Bearbeitung_Problemdokumente = True Then
|
|
|
' e.Cancel = True
|
|
|
' bExit = False
|
|
|
'End If
|
|
|
|
|
|
'Anwendung beenden?
|
|
|
If MyMsg.Show_MessageYesNo(1) = MsgBoxResult.No Then
|
|
|
bExit = False
|
|
|
End If
|
|
|
|
|
|
' look for Word Processes
|
|
|
If Globals.Words.Count > 0 And bExit = True Then
|
|
|
'Fragen ob Beenden ohne zu speichern
|
|
|
|
|
|
If MyMsg.Show_MessageYesNo(21) = MsgBoxResult.Yes Then
|
|
|
e.Cancel = True
|
|
|
bExit = False
|
|
|
Else
|
|
|
Try
|
|
|
'Rel 3.2 bud
|
|
|
'Offene Dokumente schliessen und Word beenden.
|
|
|
Dim tempWordLib As New WordLib()
|
|
|
For lcnt = 1 To Globals.Words.Count
|
|
|
tempWordLib = Globals.Words(lcnt)
|
|
|
tempWordLib.CloseDocAndWord()
|
|
|
'Globals.Words.Remove(lcnt)
|
|
|
Next lcnt
|
|
|
|
|
|
fcheckdoc.Hide()
|
|
|
fcheckdoc.fnkt = 2
|
|
|
fcheckdoc.refresh_list()
|
|
|
If fcheckdoc.t.Rows.Count > 0 Then
|
|
|
'Problemdokumente bereinigen?
|
|
|
If MyMsg.Show_MessageYesNo(119) <> MsgBoxResult.No Then
|
|
|
e.Cancel = True
|
|
|
bExit = False
|
|
|
Me.fcheckdoc.Visible = True
|
|
|
End If
|
|
|
End If
|
|
|
Catch
|
|
|
End Try
|
|
|
End If
|
|
|
End If
|
|
|
|
|
|
' nur Fragen, wenn alles vorg<72>nige OK war...
|
|
|
If bExit = True Then
|
|
|
If Not IsNothing(objSpooler) Then
|
|
|
If objSpooler.FilesInSpooler = True Then
|
|
|
'Fragen ob Beenden obwohl noch files im Spooler?!!
|
|
|
If MyMsg.Show_MessageYesNo(141) = MsgBoxResult.No Then
|
|
|
e.Cancel = True
|
|
|
bExit = False
|
|
|
objSpooler.Visible = True
|
|
|
End If
|
|
|
End If
|
|
|
End If
|
|
|
End If
|
|
|
If bExit = True Then
|
|
|
Office_Freigeben()
|
|
|
Application.Exit()
|
|
|
Else
|
|
|
e.Cancel = True
|
|
|
Exit Sub
|
|
|
End If
|
|
|
|
|
|
|
|
|
'Dim nBeenden As Boolean
|
|
|
'Dim lcnt As Integer
|
|
|
'Dim boolSpoolerEndEDOKA As Boolean = False
|
|
|
'nBeenden = False
|
|
|
'If Globals.Bearbeitung_Problemdokumente = True Then
|
|
|
' Globals.Global_ForceExit = True
|
|
|
' Exit Sub
|
|
|
'End If
|
|
|
|
|
|
'If Not Me.forceexit Then
|
|
|
' If Globals.Words.Count > 0 Then
|
|
|
' nBeenden = True
|
|
|
' If MyMsg.Show_MessageYesNo(21) <> MsgBoxResult.No Then
|
|
|
' e.Cancel = True
|
|
|
' Exit Sub
|
|
|
' Else
|
|
|
' Try
|
|
|
' 'Rel 3.2 bud
|
|
|
' 'Offene Dokumente schliessen und Word beenden.
|
|
|
' Dim tempWordLib As New WordLib()
|
|
|
' For lcnt = 1 To Globals.Words.Count
|
|
|
' tempWordLib = Globals.Words(lcnt)
|
|
|
' tempWordLib.CloseDocAndWord()
|
|
|
' 'Globals.Words.Remove(lcnt)
|
|
|
' Next lcnt
|
|
|
|
|
|
' fcheckdoc.Hide()
|
|
|
' fcheckdoc.fnkt = 2
|
|
|
' fcheckdoc.refresh_list()
|
|
|
' If fcheckdoc.t.Rows.Count > 0 Then
|
|
|
' If MyMsg.Show_MessageYesNo(119) = MsgBoxResult.No Then
|
|
|
' Office_Freigeben()
|
|
|
' Exit Sub
|
|
|
' Else
|
|
|
' e.Cancel = True
|
|
|
' Me.fcheckdoc.Visible = True
|
|
|
' Exit Sub
|
|
|
' End If
|
|
|
' End If
|
|
|
' Catch
|
|
|
' End Try
|
|
|
' End If
|
|
|
' End If
|
|
|
' Try
|
|
|
' fcheckdoc.Hide()
|
|
|
' fcheckdoc.fnkt = 2
|
|
|
' fcheckdoc.refresh_list()
|
|
|
' If fcheckdoc.t.Rows.Count > 0 Then
|
|
|
' If MyMsg.Show_MessageYesNo(119) = MsgBoxResult.No Then
|
|
|
' Office_Freigeben()
|
|
|
' Exit Sub
|
|
|
' Else
|
|
|
' e.Cancel = True
|
|
|
' Me.fcheckdoc.Visible = True
|
|
|
' Exit Sub
|
|
|
' End If
|
|
|
' End If
|
|
|
|
|
|
' ' Check for Spooler Files
|
|
|
|
|
|
' If Not IsNothing(objSpooler) Then
|
|
|
' If objSpooler.FilesInSpooler = True Then
|
|
|
' If MyMsg.Show_MessageYesNo(141) = MsgBoxResult.No Then
|
|
|
' e.Cancel = True
|
|
|
' objSpooler.Visible = True
|
|
|
' Exit Sub
|
|
|
' Else
|
|
|
' boolSpoolerEndEDOKA = True
|
|
|
' End If
|
|
|
' End If
|
|
|
|
|
|
' End If
|
|
|
' If boolSpoolerEndEDOKA = False Then
|
|
|
' If MyMsg.Show_MessageYesNo(1) = MsgBoxResult.No Then
|
|
|
' Exit Sub
|
|
|
' End If
|
|
|
' End If
|
|
|
' Catch ex As Exception
|
|
|
' End Try
|
|
|
|
|
|
'End If
|
|
|
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
Private Sub Office_Freigeben()
|
|
|
Me.Cursor = Cursors.WaitCursor
|
|
|
Me.close_all_childs()
|
|
|
Dim f As New frmWaitforClosing()
|
|
|
f.ProgressBar1.Maximum = 100
|
|
|
f.ProgressBar1.Minimum = 0
|
|
|
f.ProgressBar1.Value = 10
|
|
|
f.Show()
|
|
|
Dim w As New WordLib()
|
|
|
w.Office_Freigeben(f)
|
|
|
w = Nothing
|
|
|
f.ProgressBar1.Value = 100
|
|
|
f.Hide()
|
|
|
f.Dispose()
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
Private Function check_doc_abschluss(ByVal START As Boolean) As Boolean
|
|
|
fcheckdoc.Hide()
|
|
|
fcheckdoc.fnkt = 2
|
|
|
fcheckdoc.refresh_list()
|
|
|
If fcheckdoc.t.Rows.Count > 0 Then
|
|
|
If START Then
|
|
|
fcheckdoc.Start = True
|
|
|
Me.ShowDefekteDokumente = True
|
|
|
fcheckdoc.TopMost = True
|
|
|
fcheckdoc.Show()
|
|
|
Return True
|
|
|
Exit Function
|
|
|
End If
|
|
|
Else
|
|
|
fcheckdoc.fnkt = 1
|
|
|
Return False
|
|
|
End If
|
|
|
End Function
|
|
|
|
|
|
#Region "SingleInstance"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
'Rel 4.02 20080820 - Save EDK-File
|
|
|
Public Sub save_edkfile(ByVal status As Integer, ByVal datei As FileInfo)
|
|
|
Dim Connection As New SqlConnection()
|
|
|
Dim DA As New SqlDataAdapter("select * from edk_log where rowid=-1 ", Connection)
|
|
|
Dim cb As SqlCommandBuilder = New SqlCommandBuilder(DA)
|
|
|
Dim ds As New DataSet()
|
|
|
Dim fs As New FileStream(datei.FullName, FileMode.OpenOrCreate, FileAccess.Read)
|
|
|
Dim mydata(fs.Length) As Byte
|
|
|
fs.Read(mydata, 0, fs.Length)
|
|
|
fs.Close()
|
|
|
Try
|
|
|
Connection.ConnectionString = Globals.sConnectionString
|
|
|
Connection.Open()
|
|
|
DA.Fill(ds, "edk_log")
|
|
|
Dim myRow As DataRow
|
|
|
If ds.Tables(0).Rows.Count = 0 Then
|
|
|
' Neues Dokument speichern
|
|
|
myRow = ds.Tables(0).NewRow
|
|
|
myRow.Item(1) = status
|
|
|
myRow.Item(2) = MitarbeiterNr
|
|
|
myRow.Item(5) = Now
|
|
|
myRow.Item(6) = mydata
|
|
|
myRow.Item(7) = datei.FullName
|
|
|
ds.Tables(0).Rows.Add(myRow)
|
|
|
DA.Update(ds, "edk_log")
|
|
|
End If
|
|
|
Catch ex As Exception
|
|
|
End Try
|
|
|
fs = Nothing
|
|
|
cb = Nothing
|
|
|
ds = Nothing
|
|
|
DA = Nothing
|
|
|
Connection.Close()
|
|
|
Connection = Nothing
|
|
|
End Sub
|
|
|
' Ende Rel. 4.02
|
|
|
|
|
|
|
|
|
Dim Parameters() As String
|
|
|
Dim on_Create As Boolean = False
|
|
|
|
|
|
'1st: sorry f<>r die dummy variable
|
|
|
'2nd: werd bruucht, weil cmd args <20>ntweder RECHTIG als cmdargs ch<63>med, oder aber als args vo enere andere
|
|
|
' edok<6F><6B> instanz. die rechtige args m<>end dorom bim app start ine dummy var gschrebe werde, dass es
|
|
|
' f<>r beidi lauft... super ech weiss...
|
|
|
'3th: CODE NIE <20>PPIS ESO WIE DAS DO SOSCHT CHOMI OND VERHAU DI!!
|
|
|
Public CmdArgsSimulated() As String
|
|
|
|
|
|
''' <summary>
|
|
|
''' Release 4.03 Folgeinstanzen anders behandeln (Folgeinstaz=True, wird aus MyApplication_StartupNextInstance <20>bergeben)
|
|
|
''' </summary>
|
|
|
''' <param name="strArgs"></param>
|
|
|
''' <param name="Folgeinstanz"></param>
|
|
|
''' <remarks></remarks>
|
|
|
Public Sub HandleCommand(ByVal strArgs() As String, Optional ByVal Folgeinstanz As Boolean = False)
|
|
|
Dim spoolerDone As Boolean = False
|
|
|
'Rel 4.02 20080820 - neue Variable
|
|
|
Dim EDKB12 As Boolean = False
|
|
|
|
|
|
If UCase(Microsoft.VisualBasic.Left(Globals.conn.scoDBConnection.DataSource.ToString, 3)) = "TGT" Then
|
|
|
Me.BackColor = Color.Yellow
|
|
|
End If
|
|
|
|
|
|
Try
|
|
|
If Not IsNothing(strArgs) Then
|
|
|
If strArgs.Length > 0 Then
|
|
|
'mindestens ein arg
|
|
|
If strArgs(0).Length > Consts.ACTION_FILE_EXTENSION.Length + 1 Then
|
|
|
'erstes argu <20>berpr<70>fen ob action extension hat
|
|
|
'argument muss mindestens so lang sein wie die extension + 1
|
|
|
If UCase(strArgs(0).Substring(strArgs(0).Length - Consts.ACTION_FILE_EXTENSION.Length, Consts.ACTION_FILE_EXTENSION.Length)) = UCase(Consts.ACTION_FILE_EXTENSION) Then
|
|
|
'arg hat action xml file extension -> ist warscheinlich au eis;)
|
|
|
Try
|
|
|
Dim fi As New FileInfo(strArgs(0).ToString())
|
|
|
Action.Action.Load(fi)
|
|
|
Catch exAction As ActionException
|
|
|
If IsNothing(objSpooler) = False Then
|
|
|
objSpooler.fileCorrupted = True
|
|
|
End If
|
|
|
TKBLib.Errorhandling.TraceHelper.Msg("Edoka.mMain.Main", exAction.Message & exAction.StackTrace, TraceLevel.Error)
|
|
|
'Rel 4.03 20080820
|
|
|
Dim fi As New FileInfo(strArgs(0).ToString())
|
|
|
Dim f As New frmErrorAVQ_File(strArgs(0).ToString)
|
|
|
f.ShowDialog()
|
|
|
If fi.Length > 0 Then
|
|
|
If Edoka_Gestartet = False Then
|
|
|
init_system()
|
|
|
End If
|
|
|
save_edkfile(-1, fi)
|
|
|
fi.Delete()
|
|
|
End If
|
|
|
strArgs = Nothing
|
|
|
'MsgBox("Bei der automatischen Verarbeitung ist ein Fehler aufgetreten." & vbCrLf & vbCrLf & "Die anglieferte Datei kann nicht verarbeitet werden", MsgBoxStyle.Exclamation)
|
|
|
'Ende Rel 4.02
|
|
|
'MsgBox("Bei der automatischen Verarbeitung ist ein Fehler aufgetreten. Die aus dem Fremdsystem generierte XML-Datei kann in EDOKA nicht geladen werden. Edoka wird normal gestartet.", MsgBoxStyle.Exclamation)
|
|
|
End Try
|
|
|
End If
|
|
|
End If
|
|
|
End If
|
|
|
End If
|
|
|
Catch ex As Exception
|
|
|
TKBLib.Errorhandling.TraceHelper.Msg("Edoka.mMain.Main", ex.Message & ex.StackTrace, TraceLevel.Error)
|
|
|
TKBLib.Errorhandling.TraceHelper.Msg("Schnittstelle", "Fehler", TraceLevel.Info)
|
|
|
End Try
|
|
|
|
|
|
|
|
|
Dim strCmd As String
|
|
|
'handlecommand wird von mehreren orten aufgerufen. weil keine ahnung wie alles zusammenh<6E>ngt auf
|
|
|
'nothing <20>berpr<70>fen
|
|
|
If Not IsNothing(strArgs) Then
|
|
|
If strArgs.Length > 0 And Edoka_Gestartet = True And IsNothing(objSpooler) Then
|
|
|
|
|
|
objSpooler = New frmAvaloqSpooler()
|
|
|
objSpooler.FileWatchDir = Globals.SpoolerDir
|
|
|
|
|
|
objSpooler.MdiParent = Me
|
|
|
|
|
|
objSpooler.Show()
|
|
|
objSpooler.actionIsRunning = False
|
|
|
|
|
|
End If
|
|
|
End If
|
|
|
|
|
|
|
|
|
If Edoka_Gestartet = False And IsNothing(objSpooler) = True Then
|
|
|
|
|
|
If IsNothing(strArgs) Then
|
|
|
Win32API.SetForegroundWindow(Me.Handle.ToInt32)
|
|
|
EDOKAMain_Load()
|
|
|
Else
|
|
|
If strArgs.Length = 0 Then
|
|
|
Win32API.SetForegroundWindow(Me.Handle.ToInt32)
|
|
|
EDOKAMain_Load()
|
|
|
Else
|
|
|
Win32API.SetForegroundWindow(Me.Handle.ToInt32)
|
|
|
init_system()
|
|
|
'Rel. 4.02 20080820 Save EDK-File in EDK_Log
|
|
|
Try
|
|
|
Dim fi As New FileInfo(strArgs(0).ToString())
|
|
|
save_edkfile(-1, fi)
|
|
|
Catch ex As Exception
|
|
|
End Try
|
|
|
' Ende Rel. 4.02
|
|
|
End If
|
|
|
End If
|
|
|
Edoka_Gestartet = True
|
|
|
Else
|
|
|
'Rel. 4.03 - korrektes EDK-File speichern
|
|
|
Try
|
|
|
|
|
|
If IsNothing(objSpooler) = False Then
|
|
|
If strArgs.Length > 0 Then
|
|
|
Dim fi As New FileInfo(strArgs(0).ToString())
|
|
|
save_edkfile(-1, fi)
|
|
|
End If
|
|
|
End If
|
|
|
Catch ex As Exception
|
|
|
End Try
|
|
|
End If
|
|
|
Me.Cursor = System.Windows.Forms.Cursors.WaitCursor
|
|
|
|
|
|
If Me.forceexit Then
|
|
|
Me.Close()
|
|
|
Exit Sub
|
|
|
End If
|
|
|
|
|
|
'Release 4.03 If um Folgeinstanz-Parameter erweitern
|
|
|
If Me.ShowDefekteDokumente = False And _
|
|
|
Me.ShowGeburtstag = False And _
|
|
|
Check_offene_dp_instanzen() = False And _
|
|
|
Action.Action.ActionType = 0 And Folgeinstanz = False Then
|
|
|
|
|
|
'BUD - 2007.04.16
|
|
|
Try
|
|
|
Dim f As New frmTrefferliste()
|
|
|
f.MdiParent = Me
|
|
|
f.Partner_Eingegeben = False
|
|
|
f.Show()
|
|
|
'f.refresh_list()
|
|
|
|
|
|
If DivFnkt.checkSpoolerDir And Action.Action.ActionType = 0 Then
|
|
|
' Einblenden des Spoolers fals true
|
|
|
If IsNothing(objSpooler) = True Then
|
|
|
objSpooler = New frmAvaloqSpooler
|
|
|
End If
|
|
|
|
|
|
objSpooler.MdiParent = Me
|
|
|
objSpooler.Show()
|
|
|
'objSpooler.Visible = True
|
|
|
objSpooler.actionIsRunning = False
|
|
|
objSpooler.refreshList()
|
|
|
End If
|
|
|
|
|
|
Catch ex As ActionException
|
|
|
|
|
|
End Try
|
|
|
|
|
|
End If
|
|
|
Try
|
|
|
Me.Cursor = System.Windows.Forms.Cursors.Default
|
|
|
Globals.Apphandle = Me.Handle.ToInt32
|
|
|
Globals.Apphandle = Win32API.FindWindowNullClassName(0, "EDOKA")
|
|
|
|
|
|
Win32API.SetForegroundWindow(Me.Handle.ToInt32)
|
|
|
'Rel 4.03 - Nur beim ersten Start maximieren
|
|
|
If Not Folgeinstanz Then Me.WindowState = FormWindowState.Maximized
|
|
|
Catch
|
|
|
End Try
|
|
|
'Rel 4.0 - BUD - neu den Action Typ pr<70>fen, Fehlerdokumente nur anzeigen wenn EDOKA ohne XML startet.
|
|
|
If Me.ShowDefekteDokumente And Action.Action.ActionType = 0 Then
|
|
|
Globals.Bearbeitung_Problemdokumente = True
|
|
|
Me.fcheckdoc.StartPosition = FormStartPosition.CenterScreen
|
|
|
Me.fcheckdoc.Show()
|
|
|
Me.fcheckdoc.TopMost = True
|
|
|
End If
|
|
|
|
|
|
'<27>berpr<70>fen ob erstes arguent xml file f<>r automatisierte aktion ist
|
|
|
Dim fileCorrupted As Boolean = False
|
|
|
Dim errString As String = ""
|
|
|
Try
|
|
|
If Action.Action.ActionType <> 0 Then
|
|
|
TKBLib.Errorhandling.TraceHelper.Msg("Edoka.frmEdokaMain.HandleCommand", "Analysing automated action for type " & Action.Action.ActionType.ToString(), TraceLevel.Info)
|
|
|
If IsNothing(objSpooler) Then
|
|
|
objSpooler = New frmAvaloqSpooler
|
|
|
objSpooler.MdiParent = Me
|
|
|
|
|
|
objSpooler.Show()
|
|
|
objSpooler.actionIsRunning = False
|
|
|
|
|
|
End If
|
|
|
|
|
|
objSpooler.Show()
|
|
|
Select Case Action.Action.ActionType
|
|
|
|
|
|
Case ActionType.AnzeigePartnerdossier
|
|
|
Dim CancelAction As Boolean
|
|
|
CancelAction = objSpooler.FilesInSpooler
|
|
|
objSpooler.refreshList()
|
|
|
If CancelAction = False Or objSpooler.StartManuell = True Then
|
|
|
objSpooler.StartManuell = False
|
|
|
|
|
|
objSpooler.actionIsRunning = True
|
|
|
Dim f As New frmTrefferliste()
|
|
|
f.MdiParent = objSpooler.MdiParent
|
|
|
f.Show()
|
|
|
|
|
|
Dim partner As Parameter
|
|
|
partner = Action.Action.GetParameterByName("PartnerNr")
|
|
|
f.txtnrpar00.Text = partner.Value
|
|
|
f.Partnernr = partner.Value
|
|
|
f.Partner_Eingegeben = True
|
|
|
f.refresh_list()
|
|
|
'Rel 4.03 - Refresh all ausbauen
|
|
|
'f.Refresh_All(True)
|
|
|
Me.Cursor = System.Windows.Forms.Cursors.Default
|
|
|
'Globals.Apphandle = Me.Handle.ToInt32
|
|
|
'Win32API.SetForegroundWindow(Me.Handle.ToInt32)
|
|
|
'Win32API.ShowWindow(Me.Handle.ToInt32, Win32API.SW_RESTORE)
|
|
|
spoolerDone = True
|
|
|
Exit Sub
|
|
|
End If
|
|
|
|
|
|
Case ActionType.DokumentAnzeige
|
|
|
Dim CancelAction As Boolean
|
|
|
Dim dokumentArt As String = Action.Action.GetParameterByName("DokumentTypNr").Value
|
|
|
If dokumentArt <> "" Then
|
|
|
dokumentArt = CInt(dokumentArt) - 900000000
|
|
|
End If
|
|
|
CancelAction = objSpooler.FilesInSpooler
|
|
|
objSpooler.refreshList()
|
|
|
If CancelAction = False Or objSpooler.StartManuell = True Then
|
|
|
objSpooler.StartManuell = False
|
|
|
|
|
|
objSpooler.actionIsRunning = True
|
|
|
|
|
|
|
|
|
Me.Cursor = System.Windows.Forms.Cursors.WaitCursor
|
|
|
Globals.profilnr = BusinessFacade.Profil.GetStandardProfilNr(Globals.MitarbeiterNr)
|
|
|
Dim f As New frmTrefferliste()
|
|
|
|
|
|
f.Partnernr = Action.Action.GetParameterByName("PartnerNr").Value
|
|
|
|
|
|
|
|
|
f.MdiParent = objSpooler.MdiParent
|
|
|
f.Form1_Load(Nothing, Nothing)
|
|
|
f.Show()
|
|
|
If Action.Action.GetParameterByName("fanummer3").Value <> "" Then
|
|
|
f.Geschaeftsfall = Action.Action.SourceApplication & ": " & Action.Action.GetParameterByName("fanummer3").Value
|
|
|
f.Alle_Dokumente_Des_Geschaeftsfalles()
|
|
|
f.Partner_Eingegeben = True
|
|
|
Else
|
|
|
f.txtnrpar00.Text = Action.Action.GetParameterByName("PartnerNr").Value
|
|
|
f.Partnernr = Action.Action.GetParameterByName("PartnerNr").Value
|
|
|
f.Partner_Eingegeben = True
|
|
|
f.refresh_list()
|
|
|
f.Refresh_All(True)
|
|
|
dokumentArt = DivFnkt.getDocArtByDocTypID(dokumentArt)
|
|
|
f.PosDok("", dokumentArt)
|
|
|
End If
|
|
|
Me.Cursor = System.Windows.Forms.Cursors.Default
|
|
|
spoolerDone = True
|
|
|
|
|
|
End If
|
|
|
|
|
|
Case ActionType.Statusmutation
|
|
|
'neuen status f<>r gesch<63>ftsfall setzen
|
|
|
Dim CancelAction As Boolean
|
|
|
CancelAction = objSpooler.FilesInSpooler
|
|
|
objSpooler.refreshList()
|
|
|
If CancelAction = False Or objSpooler.StartManuell = True Then
|
|
|
objSpooler.StartManuell = False
|
|
|
|
|
|
objSpooler.actionIsRunning = True
|
|
|
EDOKALib.BusinessFacade.Dokument.SetStatus()
|
|
|
spoolerDone = True
|
|
|
|
|
|
End If
|
|
|
Case ActionType.HostDokumentAnzeige
|
|
|
Dim CancelAction As Boolean
|
|
|
CancelAction = objSpooler.FilesInSpooler
|
|
|
objSpooler.refreshList()
|
|
|
If CancelAction = False Or objSpooler.StartManuell = True Then
|
|
|
objSpooler.StartManuell = False
|
|
|
|
|
|
objSpooler.actionIsRunning = True
|
|
|
'Host Dokument Anzeige
|
|
|
Dim PartnerNR As String
|
|
|
Dim DokumentId As String
|
|
|
Dim Valutadatum As String
|
|
|
PartnerNR = Action.Action.GetParameterByName("PartnerNr").Value
|
|
|
DokumentId = Action.Action.GetParameterByName("DokumentTypNr").Value
|
|
|
If DokumentId <> "" Then
|
|
|
DokumentId = CInt(DokumentId) - 900000000
|
|
|
End If
|
|
|
Dim i As Integer
|
|
|
For i = Len(PartnerNR) + 1 To 9
|
|
|
PartnerNR = "0" & PartnerNR
|
|
|
Next
|
|
|
|
|
|
'Valuta Datum eines Host Dokuments auslesen
|
|
|
Valutadatum = DivFnkt.GetHostValutaDAtum(DokumentId, PartnerNR)
|
|
|
|
|
|
DivFnkt.Erstellungsdatum = Valutadatum
|
|
|
DivFnkt.Belegart = "HOST"
|
|
|
DivFnkt.ShowColdDocHost(DokumentId, Me, DokumentId, PartnerNR, "partnername_inhaber", "dokumenttypnr")
|
|
|
Me.Cursor = Cursors.Default
|
|
|
spoolerDone = True
|
|
|
Exit Sub
|
|
|
End If
|
|
|
'2009-09-27 - UVM-Anzeige / ZVDokumentanzeige
|
|
|
Case ActionType.UVMDokumentanzeige
|
|
|
Dim CancelAction As Boolean
|
|
|
CancelAction = objSpooler.FilesInSpooler
|
|
|
objSpooler.refreshList()
|
|
|
If CancelAction = False Or objSpooler.StartManuell = True Then
|
|
|
objSpooler.StartManuell = False
|
|
|
objSpooler.actionIsRunning = True
|
|
|
Dim dokumentid As String = Action.Action.GetParameterByName("DokumentTypNr").Value
|
|
|
DivFnkt.Show_Spooler_UVM_Doc(dokumentid, Me)
|
|
|
Me.Cursor = Cursors.Default
|
|
|
spoolerDone = True
|
|
|
Exit Sub
|
|
|
End If
|
|
|
Case ActionType.ZVDokumentanzeige
|
|
|
Dim CancelAction As Boolean
|
|
|
CancelAction = objSpooler.FilesInSpooler
|
|
|
objSpooler.refreshList()
|
|
|
If CancelAction = False Or objSpooler.StartManuell = True Then
|
|
|
objSpooler.StartManuell = False
|
|
|
objSpooler.actionIsRunning = True
|
|
|
Dim dokumentid As String = Action.Action.GetParameterByName("DokumentTypNr").Value
|
|
|
DivFnkt.Show_Spooler_ZV_Doc(dokumentid, Me)
|
|
|
Me.Cursor = Cursors.Default
|
|
|
spoolerDone = True
|
|
|
Exit Sub
|
|
|
End If
|
|
|
|
|
|
Case ActionType.DokumentErstellung
|
|
|
|
|
|
Dim fi As New FileInfo(strArgs(0).ToString())
|
|
|
objAvaloqDokumentWerte.init(fi)
|
|
|
Dim DokumentTypNr As String
|
|
|
Dim Partnernr As String
|
|
|
Dim OrderNr As String
|
|
|
Dim SourceApp As String
|
|
|
Dim Ersteller As String
|
|
|
Dim strNoEdit As String
|
|
|
Dim isDokumentPaket As String
|
|
|
Dim iError As Integer = 0
|
|
|
SourceApp = Action.Action.SourceApplication
|
|
|
OrderNr = Action.Action.GetParameterByName("fanummer3").Value
|
|
|
Ersteller = Action.Action.CreatorTgNr
|
|
|
DokumentTypNr = Action.Action.GetParameterByName("DokumentTypNr").Value
|
|
|
Partnernr = Action.Action.GetParameterByName("PartnerNr").Value
|
|
|
strNoEdit = Action.Action.GetParameterByName("DirekteErstellung").Value
|
|
|
isDokumentPaket = Action.Action.GetParameterByName("Dokumentpaket").Value
|
|
|
' Rel 4.02 20080820
|
|
|
' Bei der direkten Dokumenterstellung pr<70>fen, ob das Dokument via EDKB12 generiert werden soll
|
|
|
' Bei der generierung mit EDKB12 Daten auf DB speichern und Meldung an Benutzer ausgeben
|
|
|
|
|
|
EDKB12 = False
|
|
|
If strNoEdit = 2 Then
|
|
|
Dim dtToReturn As DataTable = New DataTable()
|
|
|
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
|
|
Dim profilnr As Integer
|
|
|
scmCmdToExecute.Connection = Globals.conn.scoDBConnection
|
|
|
scmCmdToExecute.CommandText = "dbo.sp_edkb12_check"
|
|
|
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
|
|
Dim DataSet1 As DataSet = New DataSet()
|
|
|
Dim sdaAdapter As SqlDataAdapter = New SqlDataAdapter(scmCmdToExecute)
|
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@idokumenttypnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, DokumentTypNr))
|
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@odokumenttypnr", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, 0))
|
|
|
scmCmdToExecute.Connection = conn.scoDBConnection
|
|
|
scmCmdToExecute.Connection.Open()
|
|
|
sdaAdapter.Fill(dtToReturn)
|
|
|
dtToReturn.Dispose()
|
|
|
Dim check_edkb12 As Integer = scmCmdToExecute.Parameters("@odokumenttypnr").Value
|
|
|
scmCmdToExecute.Connection.Close()
|
|
|
scmCmdToExecute.Dispose()
|
|
|
If check_edkb12 <> 0 Then
|
|
|
EDKB12 = True
|
|
|
End If
|
|
|
End If
|
|
|
If EDKB12 = False Then
|
|
|
|
|
|
' Rel 4.0 Fensterhandling Problem
|
|
|
' Handle verweis auf Prozess EDOKA...
|
|
|
|
|
|
Dim p As Process
|
|
|
|
|
|
Dim MyProcesses() As Process = _
|
|
|
Process.GetProcessesByName( _
|
|
|
Process.GetCurrentProcess().ProcessName)
|
|
|
|
|
|
|
|
|
For Each p In MyProcesses
|
|
|
|
|
|
If (p.Id = Process.GetCurrentProcess().Id) Then
|
|
|
Globals.Apphandle = p.MainWindowHandle()
|
|
|
End If
|
|
|
|
|
|
Next
|
|
|
Win32API.SetActiveWindow(Globals.Apphandle)
|
|
|
Win32API.BringWindowToTop(Globals.Apphandle)
|
|
|
|
|
|
'Globals.Apphandle = Me.Handle.ToInt32
|
|
|
If isDokumentPaket = "" Then
|
|
|
isDokumentPaket = 0
|
|
|
End If
|
|
|
If DivFnkt.checkPartnerNr(Partnernr) = True Then
|
|
|
|
|
|
Dim CancelAction As Boolean
|
|
|
CancelAction = objSpooler.FilesInSpooler
|
|
|
objSpooler.refreshList()
|
|
|
If DokumentTypNr <> "" Then
|
|
|
DokumentTypNr = CInt(DokumentTypNr) - 900000000
|
|
|
End If
|
|
|
If DivFnkt.checkDokID(DokumentTypNr, isDokumentPaket) = True Then
|
|
|
|
|
|
If DokumentTypNr <> "" Then
|
|
|
DokumentTypNr = CInt(DokumentTypNr)
|
|
|
Else
|
|
|
DokumentTypNr = 0
|
|
|
End If
|
|
|
If isDokumentPaket = "" Then
|
|
|
isDokumentPaket = 0
|
|
|
Else
|
|
|
isDokumentPaket = CInt(isDokumentPaket)
|
|
|
End If
|
|
|
If CancelAction = False Or objSpooler.StartManuell = True Then
|
|
|
objSpooler.StartManuell = False
|
|
|
objSpooler.actionIsRunning = True
|
|
|
If strNoEdit = "" Then
|
|
|
strNoEdit = 0
|
|
|
End If
|
|
|
objSpooler.NoEdit = CInt(strNoEdit)
|
|
|
If isDokumentPaket = 0 Then
|
|
|
If OrderNr = "" Then
|
|
|
iError = DokErstellen(DokumentTypNr, Partnernr, Ersteller, Ersteller, "", "", "", "", "", False, False, False)
|
|
|
Else
|
|
|
iError = DokErstellen(DokumentTypNr, Partnernr, Ersteller, Ersteller, "", "", "OrderNr:" & OrderNr, "", SourceApp & ": " & OrderNr, False, False, False)
|
|
|
End If
|
|
|
Else
|
|
|
Globals.Individuelles_Dokumentpaket = False
|
|
|
Globals.DokumentPaket = True
|
|
|
Dim frmDP As New frmDokumentpaket(DokumentTypNr, False, Partnernr)
|
|
|
|
|
|
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
|
|
Dim profilnr As Integer
|
|
|
scmCmdToExecute.Connection = Globals.conn.scoDBConnection
|
|
|
scmCmdToExecute.CommandText = "dbo.pv_profil_select"
|
|
|
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
|
|
Dim DataSet1 As DataSet = New DataSet()
|
|
|
Dim sdaAdapter As SqlDataAdapter = New SqlDataAdapter(scmCmdToExecute)
|
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@mitarbeiternr", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, Globals.MitarbeiterNr))
|
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@mandantnr", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, 1))
|
|
|
scmCmdToExecute.Connection = conn.scoDBConnection
|
|
|
scmCmdToExecute.Connection.Open()
|
|
|
sdaAdapter.Fill(DataSet1)
|
|
|
scmCmdToExecute.Connection.Close()
|
|
|
frmDP.Profile = DataSet1.Tables(0)
|
|
|
profilnr = DataSet1.Tables(0).Rows(0).Item("profilnr")
|
|
|
Dim z As Integer = 0
|
|
|
For z = 0 To DataSet1.Tables(0).Columns.Count
|
|
|
If DataSet1.Tables(0).Rows(z).Item("standard") = True Then
|
|
|
profilnr = DataSet1.Tables(0).Rows(z).Item("profilnr")
|
|
|
' Avaloq Spooler massnahme
|
|
|
Exit For
|
|
|
End If
|
|
|
Next
|
|
|
frmDP.Profilnr = profilnr
|
|
|
'Rel 4.03 MID-F<>higkeit
|
|
|
frmDP.MdiParent = Me
|
|
|
frmDP.StartPosition = FormStartPosition.CenterParent
|
|
|
frmDP.TopMost = True
|
|
|
' objSpooler.WindowState = FormWindowState.Minimized
|
|
|
'Ende Rel 4.03
|
|
|
frmDP.Show()
|
|
|
End If
|
|
|
If iError > 0 Then
|
|
|
MsgBox("Bei der Dokumenterstellung trat ein Fehler auf.")
|
|
|
End If
|
|
|
spoolerDone = True
|
|
|
End If
|
|
|
Else
|
|
|
MsgBox("Dokumenttyp " & DokumentTypNr & " wurde nicht gefunden")
|
|
|
spoolerDone = True
|
|
|
End If
|
|
|
|
|
|
Else
|
|
|
MsgBox("Es wurde kein Partner mit der PartnerNr:" & Partnernr & " gefunden.")
|
|
|
spoolerDone = True
|
|
|
End If
|
|
|
End If
|
|
|
'Rel 4.02 20080816 SHU
|
|
|
'Sofern das Dokument <20>ber EDKB12 generiert wird, EDK-File auf DB sichern und Meldung am User ausgeben
|
|
|
If EDKB12 = True Then
|
|
|
spoolerDone = True
|
|
|
If Save_File_To_DB(fi.FullName) Then
|
|
|
MyMsg.show_standardmessage(50000, MsgBoxStyle.Information)
|
|
|
End If
|
|
|
End If
|
|
|
' Ende Rel 4.02
|
|
|
'20080401 RGL, Dokwerte l<>schen, da sonst immer aufgef<65>llt auch wenn Aufruf nicht von Spooler!
|
|
|
'Ist hier platziert da Aufrufe der Forms oben ShowDialog sind (Bei Bearbeitung ist der Code
|
|
|
' in frmDokumentliste)
|
|
|
If Not (IsNothing(objAvaloqDokumentWerte)) Then
|
|
|
objAvaloqDokumentWerte.clearAvaloqDokumentWerte()
|
|
|
End If
|
|
|
|
|
|
Case ActionType.DokumentBearbeitung
|
|
|
|
|
|
Dim fi As New FileInfo(strArgs(0).ToString())
|
|
|
objAvaloqDokumentWerte.init(fi)
|
|
|
Dim frm As New frmDokumentListe()
|
|
|
frm.MdiParent = objSpooler.MdiParent
|
|
|
Dim OrderNr As String
|
|
|
Dim PartnerNr As String
|
|
|
Dim DokumentTypNr As String
|
|
|
Dim ScoureApp As String
|
|
|
Dim Ersteller As String
|
|
|
Dim dtSearch As New DataTable()
|
|
|
Dim CancelAction As Boolean
|
|
|
Dim iError As Integer = 0
|
|
|
CancelAction = objSpooler.FilesInSpooler
|
|
|
objSpooler.refreshList()
|
|
|
If CancelAction = False Or objSpooler.StartManuell = True Then
|
|
|
objSpooler.StartManuell = False
|
|
|
'--
|
|
|
'SourceApp = Action.Action.SourceApplication
|
|
|
OrderNr = Action.Action.GetParameterByName("fanummer3").Value
|
|
|
Ersteller = Action.Action.CreatorTgNr
|
|
|
DokumentTypNr = Action.Action.GetParameterByName("DokumentTypNr").Value
|
|
|
PartnerNr = Action.Action.GetParameterByName("PartnerNr").Value
|
|
|
'strNoEdit = Action.Action.GetParameterByName("DirekteErstellung").Value
|
|
|
'isDokumentPaket = Action.Action.GetParameterByName("Dokumentpaket").Value
|
|
|
'--
|
|
|
If DokumentTypNr <> "" Then
|
|
|
DokumentTypNr = CInt(DokumentTypNr) - 900000000
|
|
|
End If
|
|
|
If DivFnkt.checkPartnerNr(PartnerNr) = True Then
|
|
|
|
|
|
|
|
|
dtSearch = frm.SearchDocuments(OrderNr, PartnerNr, DokumentTypNr)
|
|
|
|
|
|
''''''' Keine Dokumente mit Filter gefunden
|
|
|
If dtSearch.Rows.Count = 0 Then
|
|
|
If DokumentTypNr <> "" And OrderNr <> "" Then
|
|
|
'NEU ERSTELLEN MIT OrderNr
|
|
|
If MyMsg.Show_MessageYesNo(506) <> MsgBoxResult.No Then
|
|
|
ScoureApp = Action.Action.SourceApplication
|
|
|
Ersteller = Action.Action.CreatorTgNr
|
|
|
|
|
|
objSpooler.StartManuell = False
|
|
|
objSpooler.actionIsRunning = True
|
|
|
iError = DokErstellen(DokumentTypNr, PartnerNr, Ersteller, Ersteller, "", "", "OrderNr:" & OrderNr, "", ScoureApp & ": " & OrderNr, False, False, False)
|
|
|
|
|
|
End If
|
|
|
ElseIf DokumentTypNr <> "" And OrderNr = "" Then
|
|
|
'NEU ERSTELLEN OHNE OrderNr
|
|
|
If MyMsg.Show_MessageYesNo(506) <> MsgBoxResult.No Then
|
|
|
ScoureApp = Action.Action.SourceApplication
|
|
|
Ersteller = Action.Action.CreatorTgNr
|
|
|
|
|
|
objSpooler.StartManuell = False
|
|
|
objSpooler.actionIsRunning = True
|
|
|
iError = DokErstellen(DokumentTypNr, PartnerNr, Ersteller, Ersteller, "", "", "", "", "", False, False, False)
|
|
|
|
|
|
End If
|
|
|
ElseIf DokumentTypNr = "" And OrderNr <> "" Then
|
|
|
MsgBox("Kein Dokument gefunden." & vbNewLine & "Es kann kein neues Dokument ohne DokumentTypNr erstellt werden.")
|
|
|
ElseIf DokumentTypNr = "" And OrderNr = "" Then
|
|
|
MsgBox("Kein Dokument gefunden." & vbNewLine & "Es kann kein neues Dokument ohne DokumentTypNr erstellt werden.")
|
|
|
' Ist noch offen!
|
|
|
End If
|
|
|
ElseIf dtSearch.Rows.Count = 1 Then
|
|
|
'Genau 1 Dokument gefunden -> <20>ffnen
|
|
|
ScoureApp = Action.Action.SourceApplication
|
|
|
Ersteller = Action.Action.CreatorTgNr
|
|
|
|
|
|
objSpooler.StartManuell = False
|
|
|
objSpooler.actionIsRunning = True
|
|
|
frm.DokList.DataSource = dtSearch
|
|
|
frm.OpenDocument(frm.DokList.Columns("dokumentid").Text)
|
|
|
|
|
|
Else
|
|
|
'MEHRERE Dokumente gefunden, Ausfwahlliste anzeigen
|
|
|
If DokumentTypNr <> "" And OrderNr <> "" Then
|
|
|
objSpooler.actionIsRunning = True
|
|
|
frm.DokList.DataSource = dtSearch
|
|
|
frm.Show()
|
|
|
ElseIf DokumentTypNr <> "" And OrderNr = "" Then
|
|
|
objSpooler.actionIsRunning = True
|
|
|
frm.DokList.DataSource = dtSearch
|
|
|
frm.Show()
|
|
|
ElseIf DokumentTypNr = "" And OrderNr <> "" Then
|
|
|
objSpooler.actionIsRunning = True
|
|
|
frm.DokList.DataSource = dtSearch
|
|
|
frm.Show()
|
|
|
ElseIf DokumentTypNr = "" And OrderNr = "" Then
|
|
|
objSpooler.actionIsRunning = True
|
|
|
frm.DokList.DataSource = dtSearch
|
|
|
frm.Show()
|
|
|
End If
|
|
|
frm.BringToFront()
|
|
|
End If
|
|
|
If iError > 0 Then
|
|
|
MsgBox("Bei der Dokumenterstellung trat ein Fehler auf.")
|
|
|
End If
|
|
|
Else
|
|
|
MsgBox("Es wurde kein Partner mit der PartnerNr:" & PartnerNr & " gefunden.")
|
|
|
spoolerDone = True
|
|
|
End If
|
|
|
spoolerDone = True
|
|
|
End If
|
|
|
Case Else
|
|
|
TKBLib.Errorhandling.TraceHelper.Msg("Edoka.frmEdokaMain.HandleCommand", "Action type " & Action.Action.ActionType.ToString() & " not handled", TraceLevel.Warning)
|
|
|
End Select
|
|
|
End If
|
|
|
Catch ex As Exception
|
|
|
objSpooler.actionIsRunning = False
|
|
|
Me.Cursor = System.Windows.Forms.Cursors.Default
|
|
|
MsgBox("Bei der Automatischen Verarbeitung wurde ein Fehler verursacht")
|
|
|
objSpooler.fileCorrupted = True
|
|
|
spoolerDone = True
|
|
|
TKBLib.Errorhandling.TraceHelper.Msg("Edoka.frmEdokaMain.HandleCommand", "Unhandled ex for action type " & Action.Action.ActionType.ToString() & ex.Message & ex.StackTrace, TraceLevel.Error)
|
|
|
Finally
|
|
|
Try
|
|
|
If Not IsNothing(strArgs) Then
|
|
|
If strArgs.Length > 0 Then
|
|
|
'mindestens ein arg
|
|
|
If strArgs(0).Length > Consts.ACTION_FILE_EXTENSION.Length + 1 Then
|
|
|
If spoolerDone = True Then
|
|
|
objSpooler.NoEdit = 0
|
|
|
Dim fiAction As New FileInfo(strArgs(0).ToString())
|
|
|
If DeleteSpoolerFile = 0 Then
|
|
|
If Directory.Exists(SpoolerTempDir) Then
|
|
|
fiAction.MoveTo(SpoolerTempDir & "\" & Replace(DateTime.Now.ToShortDateString, ".", "") & Now.TimeOfDay.Hours & Now.TimeOfDay.Minutes & Now.TimeOfDay.Seconds & fiAction.Name)
|
|
|
Else
|
|
|
Directory.CreateDirectory(SpoolerTempDir)
|
|
|
fiAction.MoveTo(SpoolerTempDir & "\" & Replace(DateTime.Now.ToShortDateString, ".", "") & Now.TimeOfDay.Hours & Now.TimeOfDay.Minutes & Now.TimeOfDay.Seconds & fiAction.Name)
|
|
|
|
|
|
End If
|
|
|
Else
|
|
|
fiAction.Delete()
|
|
|
End If
|
|
|
objSpooler.refreshList()
|
|
|
If Action.Action.ActionType = ActionType.DokumentErstellung Or Action.Action.ActionType = ActionType.HostDokumentAnzeige Or Action.Action.ActionType = ActionType.Statusmutation Then
|
|
|
objSpooler.BringToFront()
|
|
|
End If
|
|
|
'Rel 4.03 - Spooler ausblenden, wenn keine Aktion mehr vorhanden ist
|
|
|
Try
|
|
|
If objSpooler.btnNextAction.Enabled = False Then
|
|
|
objSpooler.Hide()
|
|
|
End If
|
|
|
Catch
|
|
|
End Try
|
|
|
objSpooler.actionIsRunning = False
|
|
|
Cursor = Cursors.Default
|
|
|
Else
|
|
|
'20080401 RGL gab ein Error da objSpooler gar nicht instanziert (Bsp: V<>llig falscher Filename angeliefert)
|
|
|
If Not (IsNothing(objSpooler)) Then
|
|
|
objSpooler.NoEdit = 0
|
|
|
objSpooler.refreshList()
|
|
|
End If
|
|
|
End If
|
|
|
End If
|
|
|
End If
|
|
|
End If
|
|
|
Catch ex As Exception
|
|
|
MsgBox(ex.Message)
|
|
|
TKBLib.Errorhandling.TraceHelper.Msg("Edoka.frmEdokaMain.HandleCommand", "Error in Spooler" & ex.Message & ex.StackTrace, TraceLevel.Error)
|
|
|
End Try
|
|
|
|
|
|
End Try
|
|
|
End Sub
|
|
|
' Rel 4.02 20080816 Save EDK-File auf die DB
|
|
|
Private Function Save_File_To_DB(ByVal filename As String) As Boolean
|
|
|
Try
|
|
|
Dim edk_data As New DataSet
|
|
|
Dim Connection As New SqlConnection()
|
|
|
Dim DA As New SqlDataAdapter("select * from edk_data where rowid = -1", Connection)
|
|
|
Dim cb As SqlCommandBuilder = New SqlCommandBuilder(DA)
|
|
|
Connection.ConnectionString = Globals.sConnectionString
|
|
|
Connection.Open()
|
|
|
DA.Fill(edk_data, "EDK_Data")
|
|
|
|
|
|
Dim fs As New FileStream(filename, FileMode.Open, FileAccess.Read)
|
|
|
Dim mydata(fs.Length) As Byte
|
|
|
Dim myRow As DataRow
|
|
|
fs.Read(mydata, 0, fs.Length)
|
|
|
myRow = edk_data.Tables(0).NewRow
|
|
|
myRow.Item(1) = Globals.TGNummer
|
|
|
myRow.Item(2) = Now
|
|
|
myRow.Item(3) = 0
|
|
|
myRow.Item(4) = Now
|
|
|
myRow.Item(5) = mydata
|
|
|
edk_data.Tables(0).Rows.Add(myRow)
|
|
|
|
|
|
DA.Update(edk_data, "EDK_Data")
|
|
|
fs.Close()
|
|
|
fs = Nothing
|
|
|
cb = Nothing
|
|
|
DA = Nothing
|
|
|
|
|
|
edk_data.Dispose()
|
|
|
Return True
|
|
|
Catch ex As Exception
|
|
|
Return False
|
|
|
End Try
|
|
|
End Function
|
|
|
'Ende REL 4.02
|
|
|
|
|
|
|
|
|
#End Region
|
|
|
|
|
|
'Private Function GetProfile() As System.Data.DataTable
|
|
|
' Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
|
|
' scmCmdToExecute.Connection = Globals.conn.scoDBConnection
|
|
|
' scmCmdToExecute.CommandText = "dbo.pv_profil_select"
|
|
|
' scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
|
|
' Dim DataSet1 As DataSet = New DataSet()
|
|
|
' Dim sdaAdapter As SqlDataAdapter = New SqlDataAdapter(scmCmdToExecute)
|
|
|
' scmCmdToExecute.Parameters.Add(New SqlParameter("@mitarbeiternr", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, Globals.MitarbeiterNr))
|
|
|
' scmCmdToExecute.Parameters.Add(New SqlParameter("@mandantnr", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, 1))
|
|
|
' scmCmdToExecute.Connection.Open()
|
|
|
' sdaAdapter.Fill(DataSet1)
|
|
|
' scmCmdToExecute.Connection.Close()
|
|
|
' sdaAdapter.Dispose()
|
|
|
' scmCmdToExecute.Dispose()
|
|
|
' Return DataSet1.Tables(0)
|
|
|
' 'DataSet1.Dispose()
|
|
|
'End Function
|
|
|
Public Function DokErstellen(ByVal Dokumenttypnr As Integer, ByVal Partnernr As Integer, _
|
|
|
ByVal TGNRZustaendig As String, ByVal TGNrVerantwortlicher As String, ByVal TGNRUnterschriftlinks As String, _
|
|
|
ByVal TGNRUnterschriftrechts As String, ByVal FANummer1 As String, _
|
|
|
ByVal FANummer2 As String, ByVal FANummer3 As String, ByVal Partnerwechsel As Boolean, _
|
|
|
ByVal Statuswechsel As Boolean, ByVal VerantwortlicherWechsel As Boolean) As Integer
|
|
|
|
|
|
Try
|
|
|
Dim ma As New edokadb.clsMyMitarbeiter()
|
|
|
Dim dt As New DataTable()
|
|
|
Dim zustaendiger As Integer
|
|
|
Dim verantwortlicher As Integer
|
|
|
Dim unterschriftrechts As Integer
|
|
|
Dim unterschriftlinks As Integer
|
|
|
Dim ErrorCode As Integer
|
|
|
Dim DokumentID As String = ""
|
|
|
|
|
|
ma.sConnectionString = Globals.sConnectionString
|
|
|
|
|
|
'Mitarbeiter des Erstellers auslesen
|
|
|
ma.xtgnummer = TGNRZustaendig
|
|
|
dt = ma.SelectWithTGNummer
|
|
|
If dt.Rows.Count > 0 Then
|
|
|
zustaendiger = dt.Rows(0).Item("mitarbeiternr")
|
|
|
Else
|
|
|
ErrorCode = 15
|
|
|
Return 1
|
|
|
Exit Function
|
|
|
End If
|
|
|
|
|
|
'Verantwortlicher auslesen
|
|
|
ma.xtgnummer = TGNrVerantwortlicher
|
|
|
ma.cpMainConnectionProvider = Globals.conn
|
|
|
dt = ma.SelectWithTGNummer
|
|
|
If dt.Rows.Count > 0 Then
|
|
|
verantwortlicher = dt.Rows(0).Item("mitarbeiternr")
|
|
|
'todo: checke <20>b bruucht werd Globals.EDOKAFremdanwendungStellvertreter = verantwortlicher
|
|
|
Else
|
|
|
ErrorCode = 15
|
|
|
Return 1
|
|
|
Exit Function
|
|
|
End If
|
|
|
|
|
|
'If Ist_Berechtigt_Dokumenterstellung(Dokumenttypnr, Partnernr) = False Then
|
|
|
If BusinessFacade.Dokumenttyp.IsMitarbeiterBerechtigt(Dokumenttypnr, Partnernr, verantwortlicher) = False Then
|
|
|
ErrorCode = 45
|
|
|
Return 1
|
|
|
Exit Function
|
|
|
|
|
|
End If
|
|
|
|
|
|
If TGNRUnterschriftlinks <> "" Then
|
|
|
'Mitarbeiter Unterschrfitlinks auslesen
|
|
|
ma.xtgnummer = TGNRUnterschriftlinks
|
|
|
dt = ma.SelectWithTGNummer
|
|
|
If dt.Rows.Count > 0 Then
|
|
|
unterschriftlinks = dt.Rows(0).Item("mitarbeiternr")
|
|
|
Else
|
|
|
ErrorCode = 16
|
|
|
Return 1
|
|
|
Exit Function
|
|
|
End If
|
|
|
Else
|
|
|
unterschriftlinks = 0
|
|
|
End If
|
|
|
|
|
|
'Mitarbeiter Unterschrfitrechts
|
|
|
If TGNRUnterschriftrechts <> "" Then
|
|
|
ma.xtgnummer = TGNRUnterschriftrechts
|
|
|
dt = ma.SelectWithTGNummer
|
|
|
If dt.Rows.Count > 0 Then
|
|
|
unterschriftrechts = dt.Rows(0).Item("mitarbeiternr")
|
|
|
Else
|
|
|
ErrorCode = 17
|
|
|
Return 1
|
|
|
Exit Function
|
|
|
End If
|
|
|
Else
|
|
|
unterschriftrechts = 0
|
|
|
End If
|
|
|
|
|
|
'dt = Profile_laden(Globals.MitarbeiterNr, Globals.MandantNr)
|
|
|
BusinessFacade.Profil.GetListeByMitarbeiterNr(Globals.MitarbeiterNr, dt)
|
|
|
|
|
|
'20080401 RGL Anpassung f<>r Dokumentpakete/Einzeldokumente/Barcodedokumente/BedingtRetournierbar
|
|
|
Dim dt2 As New edokadb.clsDokumenttyp()
|
|
|
Dim showbc As Boolean
|
|
|
dt2.cpMainConnectionProvider = conn
|
|
|
Globals.bckdokument = False
|
|
|
dt2.iDokumenttypnr = New SqlInt32(Dokumenttypnr)
|
|
|
dt2.SelectOne()
|
|
|
If dt2.bAktiv.Value = True Then
|
|
|
If dt2.bDokument_wird_retourniert.Value = True And dt2.bDokument_wird_erstellt.Value = False Then showbc = True
|
|
|
If dt2.bDokument_wird_retourniert.Value = True And dt2.bDokument_wird_erstellt.Value = True Then
|
|
|
Dim f As New frmbcquestion()
|
|
|
f.ShowDialog()
|
|
|
If f.DialogResult = Windows.Forms.DialogResult.Abort Then showbc = True
|
|
|
If f.DialogResult = Windows.Forms.DialogResult.OK Then showbc = False
|
|
|
f.Dispose()
|
|
|
End If
|
|
|
If showbc Then
|
|
|
Dim f As New frmBarcodeKleber()
|
|
|
f.TopMost = True
|
|
|
f.ShowDialog()
|
|
|
If f.DialogResult = Windows.Forms.DialogResult.Abort Then
|
|
|
Exit Function
|
|
|
Else
|
|
|
If f.DialogResult = Windows.Forms.DialogResult.OK Then
|
|
|
Me.barcodeid = f.BarcodeID
|
|
|
Globals.bckdokument = True
|
|
|
Else
|
|
|
End If
|
|
|
End If
|
|
|
End If
|
|
|
|
|
|
If Globals.bckdokument = True Then
|
|
|
'CODE HIER Merge aus Code "Normal" von unten und frmDokumentpaket.barcodedokument_erstellen
|
|
|
Cursor = Cursors.WaitCursor
|
|
|
Dim fI As New frmDokumentbearbeitungBC()
|
|
|
fI.Edex_Folgestatus = 0 'In Bearbeitung
|
|
|
fI.Profile = dt
|
|
|
Dim i As Integer
|
|
|
fI.Profilnr = dt.Rows(0).Item("profilnr")
|
|
|
For i = 0 To dt.Rows.Count - 1
|
|
|
If dt.Rows(i).Item("standard") = True Then
|
|
|
fI.Profilnr = dt.Rows(i).Item("profilnr")
|
|
|
Exit For
|
|
|
End If
|
|
|
Next
|
|
|
fI.Partnernr = Partnernr
|
|
|
fI.BarcodeID = barcodeid
|
|
|
fI.Dokumenttypnr = Dokumenttypnr
|
|
|
fI.CreateDocument = True
|
|
|
Me.Cursor = Cursors.Default
|
|
|
If Partnernr > 91000000 And DivFnkt.EDOKA_Partner_Dokument(3, Dokumenttypnr) = False Then
|
|
|
MyMsg.show_standardmessage(110, MsgBoxStyle.Critical)
|
|
|
fI.Dispose()
|
|
|
Exit Function
|
|
|
End If
|
|
|
|
|
|
fI.Partnerwechsel = Partnerwechsel
|
|
|
fI.Statuswechsel = Statuswechsel
|
|
|
fI.Verantwortlicherwechsel = VerantwortlicherWechsel
|
|
|
fI.Zustaendiger = zustaendiger
|
|
|
fI.UnterschriftLinks = unterschriftlinks
|
|
|
fI.Unterschriftrechts = unterschriftrechts
|
|
|
fI.Verantwortlicher = verantwortlicher
|
|
|
fI.FANummer1 = FANummer1
|
|
|
fI.FANummer2 = FANummer2
|
|
|
fI.FANummer3 = FANummer3
|
|
|
If objSpooler.NoEdit > 0 Then
|
|
|
fI.DoNoEdit()
|
|
|
Else
|
|
|
fI.ShowDialog()
|
|
|
End If
|
|
|
|
|
|
DivFnkt.Status_Dokumentbearbeitung(2, fI.NeueDokumentid, False, "")
|
|
|
If objSpooler.NoEdit = 2 Then
|
|
|
DivFnkt.Dokumenterstellung_SetStatusBZA(fI.NeueDokumentid)
|
|
|
End If
|
|
|
fI.Dispose()
|
|
|
|
|
|
showbc = False
|
|
|
Globals.bckdokument = False
|
|
|
Else
|
|
|
If dt2.bNurnative.Value = True Then
|
|
|
'Einzeldokumente
|
|
|
Cursor = Cursors.WaitCursor
|
|
|
Dim fI As New frmDokumentbearbeitungED()
|
|
|
fI.Profile = dt
|
|
|
Dim i As Integer
|
|
|
fI.Profilnr = dt.Rows(0).Item("profilnr")
|
|
|
For i = 0 To dt.Rows.Count - 1
|
|
|
If dt.Rows(i).Item("standard") = True Then
|
|
|
fI.Profilnr = dt.Rows(i).Item("profilnr")
|
|
|
Exit For
|
|
|
End If
|
|
|
Next
|
|
|
fI.Partnernr = Partnernr
|
|
|
fI.Dokumenttypnr = Dokumenttypnr
|
|
|
fI.CreateDocument = True
|
|
|
Me.Cursor = Cursors.Default
|
|
|
If Partnernr > 91000000 And DivFnkt.EDOKA_Partner_Dokument(3, Dokumenttypnr) = False Then
|
|
|
MyMsg.show_standardmessage(110, MsgBoxStyle.Critical)
|
|
|
fI.Dispose()
|
|
|
Exit Function
|
|
|
End If
|
|
|
|
|
|
fI.Partnernr = Trim(Str(Partnernr))
|
|
|
'Rel. 4.03
|
|
|
'Handelt es sich bei der Partnernr um die Nr. 1 (urspr<70>nglich f<>r Einzeldokumente verwendet),
|
|
|
'Partnernr auf 9999999 <20>ndern.
|
|
|
If Partnernr = 1 Then
|
|
|
fI.Partnernr = ""
|
|
|
'fI.Partnernr = Trim(Str(9999999))
|
|
|
End If
|
|
|
fI.Partnerwechsel = Partnerwechsel
|
|
|
fI.Statuswechsel = Statuswechsel
|
|
|
fI.Verantwortlicherwechsel = VerantwortlicherWechsel
|
|
|
fI.Zustaendiger = zustaendiger
|
|
|
fI.UnterschriftLinks = unterschriftlinks
|
|
|
fI.Unterschriftrechts = unterschriftrechts
|
|
|
fI.Verantwortlicher = verantwortlicher
|
|
|
fI.FANummer1 = FANummer1
|
|
|
fI.FANummer2 = FANummer2
|
|
|
fI.FANummer3 = FANummer3
|
|
|
If objSpooler.NoEdit > 0 Then
|
|
|
fI.DoNoEdit()
|
|
|
Else
|
|
|
'Rel 4.03 MDI-F<>higkeit
|
|
|
fI.ShowDialog()
|
|
|
End If
|
|
|
|
|
|
DivFnkt.Status_Dokumentbearbeitung(2, fI.NeueDokumentid, False, "")
|
|
|
If objSpooler.NoEdit = 2 Then
|
|
|
DivFnkt.Dokumenterstellung_SetStatusBZA(fI.NeueDokumentid)
|
|
|
End If
|
|
|
' fI.Dispose()
|
|
|
'MyMsg.show_standardmessage(413, MsgBoxStyle.Information)
|
|
|
Else
|
|
|
'Normaldokument
|
|
|
Dim dokumentBearbeitungWindow As New frmDokumentbearbeitung()
|
|
|
|
|
|
|
|
|
dokumentBearbeitungWindow.Profilnr = dt.Rows(0).Item("profilnr")
|
|
|
'For i = 0 To dt.Rows.Count - 1
|
|
|
' If dt.Rows(i).Item("standard") = True Then
|
|
|
' dokumentBearbeitungWindow.Profilnr = dt.Rows(i).Item("profilnr")
|
|
|
' Exit For
|
|
|
' End If
|
|
|
'Next
|
|
|
|
|
|
dokumentBearbeitungWindow.Profile = dt
|
|
|
dokumentBearbeitungWindow.Dokumenttypnr = Dokumenttypnr
|
|
|
dokumentBearbeitungWindow.CreateDocument = True
|
|
|
If Partnernr > 91000000 And DivFnkt.EDOKA_Partner_Dokument(3, Dokumenttypnr) = False Then
|
|
|
MyMsg.show_standardmessage(110, MsgBoxStyle.Critical)
|
|
|
dokumentBearbeitungWindow.Dispose()
|
|
|
Exit Function
|
|
|
End If
|
|
|
|
|
|
dokumentBearbeitungWindow.Partnernr = Trim(Str(Partnernr))
|
|
|
dokumentBearbeitungWindow.Partnerwechsel = Partnerwechsel
|
|
|
dokumentBearbeitungWindow.Statuswechsel = Statuswechsel
|
|
|
dokumentBearbeitungWindow.Verantwortlicherwechsel = VerantwortlicherWechsel
|
|
|
dokumentBearbeitungWindow.Zustaendiger = zustaendiger
|
|
|
dokumentBearbeitungWindow.UnterschriftLinks = unterschriftlinks
|
|
|
dokumentBearbeitungWindow.Unterschriftrechts = unterschriftrechts
|
|
|
dokumentBearbeitungWindow.Verantwortlicher = verantwortlicher
|
|
|
dokumentBearbeitungWindow.FANummer1 = FANummer1
|
|
|
dokumentBearbeitungWindow.FANummer2 = FANummer2
|
|
|
dokumentBearbeitungWindow.FANummer3 = FANummer3
|
|
|
If objSpooler.NoEdit > 0 Then
|
|
|
dokumentBearbeitungWindow.DoNoEdit()
|
|
|
Else
|
|
|
dokumentBearbeitungWindow.ShowDialog()
|
|
|
dokumentBearbeitungWindow.Hide()
|
|
|
Windows.Forms.Application.DoEvents()
|
|
|
End If
|
|
|
|
|
|
DivFnkt.Status_Dokumentbearbeitung(2, dokumentBearbeitungWindow.NeueDokumentid, False, "")
|
|
|
If objSpooler.NoEdit = 2 Then
|
|
|
DivFnkt.Dokumenterstellung_SetStatusBZA(dokumentBearbeitungWindow.NeueDokumentid)
|
|
|
End If
|
|
|
End If
|
|
|
End If
|
|
|
Else
|
|
|
'Dokumenttyp nicht mehr aktiv
|
|
|
TKBLib.Errorhandling.TraceHelper.Msg("EdokaApp.frmEdokaMain.DokErstellen", "Dokumenttyp nicht mehr aktiv", TraceLevel.Error)
|
|
|
End If
|
|
|
'20080401 RGL Anpassung f<>r Dokumentpakete/Einzeldokumente/Barcodedokumente/BedingtRetournierbar
|
|
|
|
|
|
Catch ex As Exception
|
|
|
TKBLib.Errorhandling.TraceHelper.Msg("EdokaApp.frmEdokaMain.DokErstellen", ex.Message & ex.StackTrace, TraceLevel.Error)
|
|
|
Throw ex
|
|
|
End Try
|
|
|
|
|
|
End Function
|
|
|
|
|
|
Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem2.Click
|
|
|
Me.Cursor = System.Windows.Forms.Cursors.WaitCursor
|
|
|
Dim f As New frmTrefferliste()
|
|
|
f.MdiParent = Me
|
|
|
f.Show()
|
|
|
f.refresh_list()
|
|
|
Me.Cursor = System.Windows.Forms.Cursors.Default
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
Private Sub MenuItem3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem3.Click
|
|
|
Dim f As New frmMeldungen()
|
|
|
f.MdiParent = Me
|
|
|
f.Show()
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
Private Sub MenuItem20_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem20.Click
|
|
|
Dim f As New frmAbout()
|
|
|
f.ShowDialog()
|
|
|
f.Dispose()
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
Private Sub MenuItem5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem5.Click
|
|
|
Dim f As New frmRevision()
|
|
|
f.Show()
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MenuItem11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem11.Click
|
|
|
Dim w As New WordLib()
|
|
|
w.Create_Labels()
|
|
|
w = Nothing
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MenuItem18_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem18.Click
|
|
|
Dim f As New frmMitarbeitereinstellungen()
|
|
|
f.ShowDialog()
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MenuItem2_Popup(ByVal sender As Object, ByVal e As System.EventArgs) Handles MenuItem2.Popup
|
|
|
If Globals.Bearbeitung_Problemdokumente = True Then Me.MenuItem2.Enabled = False Else Me.MenuItem2.Enabled = True
|
|
|
refresh_menu_trefferliste()
|
|
|
End Sub
|
|
|
Private Sub MenuItem45_Popup(ByVal sender As Object, ByVal e As System.EventArgs) Handles MenuItem45.Popup
|
|
|
If Globals.Bearbeitung_Problemdokumente = True Then Me.MenuItem45.Enabled = False Else Me.MenuItem45.Enabled = True
|
|
|
refresh_menu_trefferliste()
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
Private Sub refresh_menu_trefferliste()
|
|
|
Me.DataSet1.Clear()
|
|
|
Me.SqlConnection1.ConnectionString = Globals.sConnectionString
|
|
|
Me.SqlDataAdapter1.SelectCommand.Parameters("@mitarbeiternr").Value = Globals.MitarbeiterNr
|
|
|
Me.SqlDataAdapter1.SelectCommand.Parameters("@mandantnr").Value = Globals.MandantNr
|
|
|
Me.SqlDataAdapter1.Fill(Me.DataSet1)
|
|
|
Dim i As Integer
|
|
|
|
|
|
For i = 0 To Me.MenuItem2.MenuItems.Count - 1
|
|
|
Me.MenuItem2.MenuItems(i).Visible = False
|
|
|
Me.MenuItem45.MenuItems(i + 3).Visible = False
|
|
|
Next
|
|
|
Try
|
|
|
For i = 0 To Me.DataSet1.Tables(0).Rows.Count - 1
|
|
|
If i < 10 Then
|
|
|
Me.MenuItem2.MenuItems(i).Text = Me.DataSet1.Tables(0).Rows(i).Item("bezeichnung")
|
|
|
pnr(i) = Me.DataSet1.Tables(0).Rows(i).Item("profilnr")
|
|
|
Me.MenuItem2.MenuItems(i).Visible = True
|
|
|
End If
|
|
|
Next
|
|
|
Catch
|
|
|
End Try
|
|
|
|
|
|
|
|
|
Dim d As New DataTable()
|
|
|
Try
|
|
|
d = Me.get_profile
|
|
|
For i = 0 To d.Rows.Count - 1
|
|
|
If i < 10 Then
|
|
|
Me.MenuItem45.MenuItems(i + 3).Text = d.Rows(i).Item("profilname")
|
|
|
Me.MenuItem45.MenuItems(i + 3).Visible = True
|
|
|
spnr(i) = d.Rows(i).Item("suchprofilnr")
|
|
|
End If
|
|
|
Next
|
|
|
Catch
|
|
|
Finally
|
|
|
d.Dispose()
|
|
|
End Try
|
|
|
Dim c As Integer = 0
|
|
|
For i = 3 To Me.MenuItem45.MenuItems.Count - 1
|
|
|
If Me.MenuItem45.MenuItems(i).Visible = True Then c = c + 1
|
|
|
Next
|
|
|
If c = 0 Then Me.MenuItem57.Visible = False Else Me.MenuItem57.Visible = True
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MenuItem22_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem22.Click
|
|
|
open_trefferliste(pnr(0))
|
|
|
End Sub
|
|
|
|
|
|
Private Sub open_trefferliste(ByVal profilnr As Integer)
|
|
|
Dim i As Integer
|
|
|
Me.Cursor = System.Windows.Forms.Cursors.WaitCursor
|
|
|
Globals.profilnr = profilnr
|
|
|
Dim f As New frmTrefferliste()
|
|
|
f.MdiParent = Me
|
|
|
f.Show()
|
|
|
f.Partner_Eingegeben = False
|
|
|
' f.refresh_list()
|
|
|
' f.Refresh_All(True)
|
|
|
Me.Cursor = System.Windows.Forms.Cursors.Default
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MenuItem23_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem23.Click
|
|
|
open_trefferliste(pnr(1))
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MenuItem24_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem24.Click
|
|
|
open_trefferliste(pnr(2))
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MenuItem25_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem25.Click
|
|
|
open_trefferliste(pnr(3))
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MenuItem26_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem26.Click
|
|
|
open_trefferliste(pnr(4))
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MenuItem27_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem27.Click
|
|
|
open_trefferliste(pnr(5))
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MenuItem28_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem28.Click
|
|
|
open_trefferliste(pnr(6))
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MenuItem29_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem29.Click
|
|
|
open_trefferliste(pnr(7))
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MenuItem30_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem30.Click
|
|
|
open_trefferliste(pnr(8))
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MenuItem31_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem31.Click
|
|
|
open_trefferliste(pnr(9))
|
|
|
End Sub
|
|
|
|
|
|
Public Sub TimerFired(ByVal sender As Object, ByVal e As System.Timers.ElapsedEventArgs) Handles MyTimer.Elapsed
|
|
|
If mytimerstopped = True Then Exit Sub
|
|
|
mytimerstopped = True
|
|
|
MyTimer.Stop()
|
|
|
Dim i As Integer
|
|
|
i = DivFnkt.Check_MessageTimer
|
|
|
If i > 0 Then
|
|
|
Me.MenuItem39.Visible = True
|
|
|
' Me.StatusBar1.Text = "Sie haben " & Str(i) & " ungelesene EDOKA-Meldunge(n)."
|
|
|
End If
|
|
|
If Not Globals.In_Bearbeitung Then check_doc()
|
|
|
If Not Globals.In_Bearbeitung Then DivFnkt.check_doc2()
|
|
|
MyTimer.Start()
|
|
|
mytimerstopped = False
|
|
|
End Sub
|
|
|
|
|
|
Private Sub check_doc() 'check Dok'
|
|
|
If Me.fcheckdoc.fnkt = 2 Then Exit Sub
|
|
|
If Not Globals.In_Bearbeitung Then
|
|
|
fcheckdoc.refresh_list()
|
|
|
If fcheckdoc.t.Rows.Count > 0 Then
|
|
|
fcheckdoc.Visible = True
|
|
|
fcheckdoc.Activate()
|
|
|
End If
|
|
|
' Dim t As DataTable
|
|
|
' Dim d As New DocMgmt()
|
|
|
' t = d.check_doc
|
|
|
' If t.Rows.Count > 0 Then
|
|
|
' Dim f As New frmDefekteDokumente()
|
|
|
' f.C1TrueDBGrid1.DataSource = t
|
|
|
' f.C1TrueDBGrid1.DataMember = t.TableName
|
|
|
' f.MdiParent = Me
|
|
|
' f.Show()
|
|
|
' ' f.Dispose()
|
|
|
' End If
|
|
|
' 't.Dispose()
|
|
|
'd = Nothing
|
|
|
End If
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
|
|
Private Sub StatusBar1_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles StatusBar1.DoubleClick
|
|
|
If Me.StatusBar1.Text <> "" Then
|
|
|
Dim f As New frmMeldungen()
|
|
|
f.MdiParent = Me
|
|
|
f.ShowDialog()
|
|
|
Me.StatusBar1.Text = ""
|
|
|
End If
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MenuItem33_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem33.Click
|
|
|
Dim f As New frmSearchDoc()
|
|
|
f.MdiParent = Me
|
|
|
f.Show()
|
|
|
End Sub
|
|
|
Private Sub MenuItem35_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem35.Click
|
|
|
'RGL 20080612 Nur von DB laden wenn angezeigt
|
|
|
getRelNotes(Globals.Applikationsdaten.Rows(Globals.AppldataRow).Item("relNotes"))
|
|
|
|
|
|
Dim f As New frmWordViewer()
|
|
|
f.addressBar.Text = "H:\TSSETTINGS\EDOKA\relNotes.doc"
|
|
|
f.Text = "Release-Informationen"
|
|
|
f.ShowDialog()
|
|
|
f.Dispose()
|
|
|
'f.MdiParent = formx
|
|
|
'Dim f As New frmReleaseNotes()
|
|
|
'f.ShowDialog()
|
|
|
'f.Dispose()
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MenuItem36_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem36.Click
|
|
|
Dim w As New WordLib()
|
|
|
Me.Cursor = Cursors.WaitCursor
|
|
|
w.ResetFunctions()
|
|
|
w = Nothing
|
|
|
Me.Cursor = Cursors.Default
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MenuItem21_Popup(ByVal sender As Object, ByVal e As System.EventArgs) Handles MenuItem21.Popup
|
|
|
If Globals.Words.Count > 0 Then
|
|
|
Me.MenuItem36.Enabled = False
|
|
|
Me.MenuItem40.Enabled = False
|
|
|
Else
|
|
|
Me.MenuItem36.Enabled = True
|
|
|
Me.MenuItem40.Enabled = True
|
|
|
End If
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MenuItem37_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem37.Click
|
|
|
Dim F As New frmFAQ()
|
|
|
F.MdiParent = Me
|
|
|
F.Show()
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MenuItem39_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem39.Click
|
|
|
MenuItem3_Click(sender, e)
|
|
|
Me.MenuItem39.Visible = False
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MenuItem39_DrawItem(ByVal sender As Object, ByVal e As System.Windows.Forms.DrawItemEventArgs) Handles MenuItem39.DrawItem
|
|
|
Try
|
|
|
Dim r As Rectangle = e.Bounds
|
|
|
r.Width = r.Width * 1.5
|
|
|
r.Height = r.Height * 0.9
|
|
|
e.Graphics.DrawImage(Me.ImageList1.Images(6), r)
|
|
|
Catch
|
|
|
End Try
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MenuItem40_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem40.Click
|
|
|
Dim w As New WordLib()
|
|
|
Me.Cursor = Cursors.WaitCursor
|
|
|
w.ResetFunctions_Excel()
|
|
|
w = Nothing
|
|
|
Me.Cursor = Cursors.Default
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
Private Sub Delete_Old_Files()
|
|
|
Dim di As New IO.DirectoryInfo(Globals.Applikationsdaten.Rows(Globals.AppldataRow).Item("pfad_temporaer_dokumente"))
|
|
|
Dim diar1 As IO.FileInfo() = di.GetFiles()
|
|
|
Dim dra As IO.FileInfo
|
|
|
|
|
|
Dim d1 As DateTime = Now
|
|
|
Dim d2 As DateTime
|
|
|
For Each dra In diar1
|
|
|
If DateDiff(DateInterval.Day, dra.CreationTime, Now) > 5 Or Microsoft.VisualBasic.Left(dra.Name, 4) = "View" Then
|
|
|
Try
|
|
|
dra.Delete()
|
|
|
Catch
|
|
|
End Try
|
|
|
Else
|
|
|
Try
|
|
|
'Auch alle Lyt Files l<>schen
|
|
|
If InStr(dra.Name, ".lyt") > 0 Then
|
|
|
dra.Delete()
|
|
|
End If
|
|
|
Catch
|
|
|
End Try
|
|
|
End If
|
|
|
Next
|
|
|
End Sub
|
|
|
|
|
|
Private Sub Timer1_Elapsed(ByVal sender As Object, ByVal e As System.Timers.ElapsedEventArgs) Handles Timer1.Elapsed
|
|
|
Dim i As Integer
|
|
|
i = DivFnkt.Check_MessageTimer
|
|
|
If i > 0 Then
|
|
|
Me.MenuItem39.Visible = True
|
|
|
End If
|
|
|
If Not Globals.In_Bearbeitung Then check_doc()
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MenuItem17_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem17.Click
|
|
|
' ' Koe und shu - 2004-08-01
|
|
|
Dim f As New frmReportSelection()
|
|
|
f.Text = Replace(MenuItem17.Text, "&", "")
|
|
|
Me.Cursor = Cursors.WaitCursor
|
|
|
f.MdiParent = Me
|
|
|
Try
|
|
|
f.Show()
|
|
|
Catch ex As Exception
|
|
|
Me.Cursor = Cursors.Default
|
|
|
MsgBox(ex.Message)
|
|
|
End Try
|
|
|
Me.Cursor = Cursors.Default
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MenuItem2_Select(ByVal sender As Object, ByVal e As System.EventArgs) Handles MenuItem2.Select
|
|
|
If Globals.Bearbeitung_Problemdokumente = True Then Me.MenuItem2.Enabled = False Else Me.MenuItem2.Enabled = True
|
|
|
End Sub
|
|
|
|
|
|
Private Sub StatusBar1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles StatusBar1.TextChanged
|
|
|
If Me.StatusBar1.Text <> "" Then
|
|
|
Me.Timer2.Start()
|
|
|
Else
|
|
|
Me.Timer2.Stop()
|
|
|
End If
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
Private Sub Timer2_Elapsed(ByVal sender As Object, ByVal e As System.Timers.ElapsedEventArgs) Handles Timer2.Elapsed
|
|
|
Me.StatusBar1.Text = ""
|
|
|
End Sub
|
|
|
|
|
|
Private Sub Timer3_Elapsed(ByVal sender As Object, ByVal e As System.Timers.ElapsedEventArgs) Handles Timer3.Elapsed
|
|
|
If on_Create Then Exit Sub
|
|
|
Me.Timer3.Enabled = False
|
|
|
on_Create = True
|
|
|
Dim f As New frmTrefferliste()
|
|
|
f.MdiParent = Me
|
|
|
f.Show()
|
|
|
f.Partner_Eingegeben = True
|
|
|
f.txtnrpar00.Text = Parameters(1)
|
|
|
f.refresh_list()
|
|
|
f.Partnernr = Parameters(1)
|
|
|
Me.Cursor = System.Windows.Forms.Cursors.Default
|
|
|
Globals.Apphandle = Me.Handle.ToInt32
|
|
|
Win32API.SetForegroundWindow(Me.Handle.ToInt32)
|
|
|
Win32API.ShowWindow(Me.Handle.ToInt32, Win32API.SW_RESTORE)
|
|
|
f.Create_Dokument(True, False)
|
|
|
on_Create = False
|
|
|
End Sub
|
|
|
|
|
|
Dim frmpartnerzusammenlegung As New frmPartnerzusammenlegung()
|
|
|
Private Sub MenuItem42_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem42.Click
|
|
|
Me.Cursor = Cursors.WaitCursor
|
|
|
Me.frmpartnerzusammenlegung.MdiParent = Me
|
|
|
Me.frmpartnerzusammenlegung.Refresh_All()
|
|
|
If Me.frmpartnerzusammenlegung.ListBox1.Items.Count > 0 Then
|
|
|
Me.frmpartnerzusammenlegung.Show()
|
|
|
End If
|
|
|
Me.Cursor = Cursors.Default
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MenuItem44_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem44.Click
|
|
|
Dim f As New frmSuchFormular()
|
|
|
f.show_checkmessage = True
|
|
|
f.MdiParent = Me
|
|
|
f.Show()
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
|
|
Private Function get_profile() As DataTable
|
|
|
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
|
|
scmCmdToExecute.Connection = Globals.conn.scoDBConnection
|
|
|
scmCmdToExecute.CommandText = "dbo.SP_suchprofildaten_get_profile"
|
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@mitarbeiternr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, Globals.MitarbeiterNr))
|
|
|
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
|
|
Dim dtToReturn As DataTable = New DataTable()
|
|
|
Dim sdaAdapter As SqlDataAdapter = New SqlDataAdapter(scmCmdToExecute)
|
|
|
scmCmdToExecute.Connection = conn.scoDBConnection
|
|
|
Try
|
|
|
sdaAdapter.Fill(dtToReturn)
|
|
|
Return dtToReturn
|
|
|
Catch ex As Exception
|
|
|
MsgBox(ex.Message)
|
|
|
' Throw New Exception("Dokumenterstellung::Generic_Select::" & scmCmdToExecute.CommandText & "::Error occured." & ex.Message, ex)
|
|
|
Finally
|
|
|
scmCmdToExecute.Dispose()
|
|
|
sdaAdapter.Dispose()
|
|
|
End Try
|
|
|
End Function
|
|
|
|
|
|
|
|
|
Private Sub open_suchprofil(ByVal spnr As Integer)
|
|
|
Dim f As New frmSuchFormular(False)
|
|
|
f.MdiParent = Me
|
|
|
f.show_checkmessage = False
|
|
|
f.Show()
|
|
|
f.show_checkmessage = True
|
|
|
f.cbProfile.SelectedValue = spnr
|
|
|
f.Update_Profildaten()
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MenuItem46_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem46.Click
|
|
|
open_suchprofil(spnr(0))
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MenuItem47_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem47.Click
|
|
|
open_suchprofil(spnr(1))
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MenuItem48_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem48.Click
|
|
|
open_suchprofil(spnr(2))
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MenuItem49_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem49.Click
|
|
|
open_suchprofil(spnr(3))
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MenuItem50_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem50.Click
|
|
|
open_suchprofil(spnr(4))
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
Private Sub MenuItem51_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem51.Click
|
|
|
open_suchprofil(spnr(5))
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MenuItem52_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem52.Click
|
|
|
open_suchprofil(spnr(6))
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MenuItem53_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem53.Click
|
|
|
open_suchprofil(spnr(7))
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MenuItem54_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem54.Click
|
|
|
open_suchprofil(spnr(8))
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MenuItem55_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem55.Click
|
|
|
open_suchprofil(spnr(9))
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
Private Sub MenuItem56_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem56.Click
|
|
|
Dim f As New frmSearchDoc()
|
|
|
f.MdiParent = Me
|
|
|
f.Show()
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MenuItem43_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem43.Click
|
|
|
Dim f As New frmSuchFormular(True)
|
|
|
f.show_checkmessage = True
|
|
|
f.MdiParent = Me
|
|
|
f.Show()
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
Private Sub MenuItem34_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem34.Click
|
|
|
Globals.HTMLHelp.ShowHelpTopic()
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MenuItem58_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem58.Click
|
|
|
Globals.HTMLHelp.ShowHelpIndex()
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MenuItem60_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem60.Click
|
|
|
Globals.HTMLHelp.ShowSearch()
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MenuItem61_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
|
|
|
'Hutter 2005-01-04
|
|
|
'EDEX_Dokumentpakete
|
|
|
Dim f As New frmDokumentpaket(1)
|
|
|
f.Show()
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
Private Overloads Sub EDOKAMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
|
|
|
Try
|
|
|
HandleCommand(CmdArgsSimulated)
|
|
|
|
|
|
'Rel 4.03
|
|
|
'Dim strargs = Get_Strargs(Environment.GetCommandLineArgs())
|
|
|
'HandleCommand(strargs)
|
|
|
'MsgBox(Environment.CommandLine)
|
|
|
'Dim strargs() As String = Environment.GetCommandLineArgs()
|
|
|
|
|
|
'HandleCommand(strargs)
|
|
|
'HandleCommand(CmdArgsSimulated)
|
|
|
Catch ex As Exception
|
|
|
TKBLib.Errorhandling.TraceHelper.Msg("frmEdokaMain.EDOKAMain_Load.Main", ex.Message & ex.StackTrace, TraceLevel.Error)
|
|
|
MsgBox("Beim Starten von Edoka ist ein Fehler aufgetreten. Das Programm wird fortgesetzt", MsgBoxStyle.OkOnly, "Fehler beim Starten")
|
|
|
MsgBox(ex.Message.ToString)
|
|
|
End Try
|
|
|
End Sub
|
|
|
|
|
|
'Rel 4.03
|
|
|
Private Function Get_Strargs(ByVal args() As String) As String()
|
|
|
Dim arg As String = ""
|
|
|
Dim i As Integer = 0
|
|
|
For Each s As String In args
|
|
|
If i <> 0 Then
|
|
|
If arg <> "" Then arg = arg + " "
|
|
|
arg = arg + s
|
|
|
End If
|
|
|
i = i + 1
|
|
|
Next
|
|
|
Dim tmpargs() As String = arg.Split(" ")
|
|
|
Return tmpargs
|
|
|
End Function
|
|
|
|
|
|
Dim mnucollection As New Collection()
|
|
|
Private Sub MenuItem62_PopUp(ByVal sender As Object, ByVal e As System.EventArgs) Handles MenuItem62.Popup
|
|
|
Dim i As Integer
|
|
|
Dim mnuitem As Integer
|
|
|
Try
|
|
|
While mnucollection.Count > 0
|
|
|
Me.mnucollection.Remove(1)
|
|
|
|
|
|
End While
|
|
|
Catch
|
|
|
End Try
|
|
|
|
|
|
For i = 2 To Me.MenuItem62.MenuItems.Count - 1
|
|
|
Me.MenuItem62.MenuItems.Item(i).Visible = False
|
|
|
Next
|
|
|
mnuitem = 2
|
|
|
Dim f As New frmOffeneDPInstanzen()
|
|
|
f.Load_Data()
|
|
|
i = 0
|
|
|
If f.dpdaten.Rows.Count = 0 Then
|
|
|
Me.MenuItem63.Enabled = False
|
|
|
Else
|
|
|
Me.MenuItem63.Enabled = True
|
|
|
End If
|
|
|
For i = 0 To f.dpdaten.Rows.Count - 1
|
|
|
If i < 10 Then
|
|
|
Me.MenuItem62.MenuItems.Item(mnuitem).Text = f.dpdaten.Rows(i).Item("Bezeichnung") + " (" + LTrim(Str(f.dpdaten.Rows(i).Item("nrpar00"))) + ")"
|
|
|
Me.MenuItem62.MenuItems.Item(mnuitem).Visible = True
|
|
|
Me.mnucollection.Add(f.dpdaten.Rows(i).Item("nreintrag"))
|
|
|
mnuitem = mnuitem + 1
|
|
|
End If
|
|
|
Next
|
|
|
f.Dispose()
|
|
|
End Sub
|
|
|
|
|
|
Private Sub mnudpinstanz_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnudp1.Click, mnudp2.Click, mnudp3.Click, mnudp4.Click, mnudp5.Click, mnudp6.Click, mnudp7.Click, mnudp8.Click, mnudp9.Click, mnudp10.Click
|
|
|
Dim mnuitem As New MenuItem()
|
|
|
mnuitem = sender
|
|
|
Dim f As New frmDokumentpaket(mnucollection(mnuitem.Index - 1))
|
|
|
f.MdiParent = Me
|
|
|
f.Show()
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MenuItem63_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem63.Click
|
|
|
Dim f As New frmOffeneDPInstanzen()
|
|
|
f.MdiParent = Me
|
|
|
f.Show()
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MenuItem61_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem61.Click
|
|
|
Try
|
|
|
Dim p As New Process()
|
|
|
p.Start(Globals.Applikationsdaten.Rows(0).Item("videomenu"))
|
|
|
p.Dispose()
|
|
|
Catch
|
|
|
End Try
|
|
|
End Sub
|
|
|
|
|
|
Private Sub mnuauslieferungen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuauslieferungen.Click
|
|
|
Dim frm As Windows.Forms.Form
|
|
|
For Each frm In Me.MdiChildren
|
|
|
If frm.Name = "frmBLAuslieferungen" Then
|
|
|
frm.BringToFront()
|
|
|
Exit Sub
|
|
|
End If
|
|
|
Next
|
|
|
Dim f As New frmBLAuslieferungen()
|
|
|
f.MdiParent = Me
|
|
|
f.Show()
|
|
|
End Sub
|
|
|
|
|
|
Private Sub mnuserienbriefe_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuserienbriefe.Click
|
|
|
Dim f As New frmSerienbriefe()
|
|
|
f.MdiParent = Me
|
|
|
f.Show()
|
|
|
Dim f1 As New frmDruckMessage()
|
|
|
f1.MdiParent = Me
|
|
|
f.Show()
|
|
|
End Sub
|
|
|
|
|
|
Private Sub mnuPartnerlisten_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuPartnerlisten.Click
|
|
|
Dim f As New frmPartnerlisteVerwalten()
|
|
|
f.MdiParent = Me
|
|
|
f.Show()
|
|
|
End Sub
|
|
|
|
|
|
Private Function Check_show_sb() As Boolean
|
|
|
Try
|
|
|
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
|
|
Dim s As String
|
|
|
Dim dtToReturn As DataTable = New DataTable()
|
|
|
Dim sdaAdapter As SqlDataAdapter = New SqlDataAdapter(scmCmdToExecute)
|
|
|
scmCmdToExecute.CommandText = "dbo.sp_edex_sb_showmenu"
|
|
|
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
|
|
scmCmdToExecute.Connection = conn.scoDBConnection
|
|
|
Try
|
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@show", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, 0))
|
|
|
sdaAdapter.Fill(dtToReturn)
|
|
|
If scmCmdToExecute.Parameters("@show").Value = 0 Then
|
|
|
Return False
|
|
|
Else
|
|
|
Return True
|
|
|
End If
|
|
|
Catch ex As Exception
|
|
|
Throw New Exception("::Error occured." & ex.Message, ex)
|
|
|
Finally
|
|
|
scmCmdToExecute.Dispose()
|
|
|
sdaAdapter.Dispose()
|
|
|
dtToReturn.Dispose()
|
|
|
End Try
|
|
|
Catch
|
|
|
|
|
|
End Try
|
|
|
End Function
|
|
|
|
|
|
Private Sub menuSpooler_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
|
|
|
objSpooler.Visible = True
|
|
|
End Sub
|
|
|
|
|
|
Private Sub menuSpooler_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles menuSpooler.Click
|
|
|
If IsNothing(objSpooler) = False Then
|
|
|
objSpooler.Visible = True
|
|
|
objSpooler.refreshList()
|
|
|
objSpooler.BringToFront()
|
|
|
Else
|
|
|
objSpooler = New frmAvaloqSpooler()
|
|
|
objSpooler.refreshList()
|
|
|
objSpooler.MdiParent = Me
|
|
|
objSpooler.Visible = True
|
|
|
objSpooler.BringToFront()
|
|
|
End If
|
|
|
End Sub
|
|
|
|
|
|
#Region "4.03"
|
|
|
|
|
|
Public Sub show_vorlagen(ByVal imglist As ImageList, ByVal profilnr As Integer, ByVal showfavoriten As Boolean, ByVal profile As DataTable, ByVal docart As String, ByVal BestehenderPartner As Boolean, ByVal BestBPNr As String)
|
|
|
Dim vorlagen As New frmVorlagenauswahl
|
|
|
'f.TopMost = True
|
|
|
vorlagen.TVStruktur.ImageList = imglist
|
|
|
Me.Cursor = System.Windows.Forms.Cursors.WaitCursor
|
|
|
vorlagen.Show_Favoriten = showfavoriten
|
|
|
vorlagen.ProfilNr = profilnr
|
|
|
vorlagen.Profile = profile
|
|
|
vorlagen.Bestehenderpartner = BestehenderPartner
|
|
|
Try
|
|
|
vorlagen.BestBPNr = BestBPNr
|
|
|
Catch ex As Exception
|
|
|
vorlagen.BestBPNr = 0
|
|
|
End Try
|
|
|
vorlagen.Dokumentart = docart
|
|
|
Globals.Individuelles_Dokumentpaket = False
|
|
|
Globals.DokumentPaket = False
|
|
|
vorlagen.ShowDialog()
|
|
|
If vorlagen.DialogResult = Windows.Forms.DialogResult.OK And vorlagen.DocType_To_Create = "N" Then
|
|
|
startdoc(vorlagen.ProfilNr, vorlagen.Profile, vorlagen.BestehenderBP, vorlagen.Dokumentvorlage, vorlagen.BarcodeID)
|
|
|
End If
|
|
|
If vorlagen.DialogResult = Windows.Forms.DialogResult.OK And vorlagen.DocType_To_Create = "DP" Then
|
|
|
StartDP(vorlagen.ProfilNr, vorlagen.Profile, vorlagen.BestehenderBP, vorlagen.Dokumentvorlage, vorlagen.BarcodeID)
|
|
|
End If
|
|
|
If vorlagen.DialogResult = Windows.Forms.DialogResult.OK And vorlagen.DocType_To_Create = "BCK" Then
|
|
|
StartBCK(vorlagen.ProfilNr, vorlagen.Profile, vorlagen.BestehenderBP, vorlagen.Dokumentvorlage, vorlagen.BarcodeID)
|
|
|
End If
|
|
|
If vorlagen.DialogResult = Windows.Forms.DialogResult.OK And vorlagen.DocType_To_Create = "ED" Then
|
|
|
StartED(vorlagen.ProfilNr, vorlagen.Profile, vorlagen.BestehenderBP, vorlagen.Dokumentvorlage, vorlagen.BarcodeID)
|
|
|
End If
|
|
|
|
|
|
Me.Cursor = Cursors.Default
|
|
|
End Sub
|
|
|
|
|
|
#End Region
|
|
|
|
|
|
Private Sub startdoc(ByVal Profilnr As Integer, ByVal Profile As System.Data.DataTable, ByVal bestbpnr As String, ByVal Dokumentvorlage As Integer, ByVal Barcodeid As String)
|
|
|
Dim fI As New frmDokumentbearbeitung()
|
|
|
fI.Profilnr = Profilnr
|
|
|
fI.Profile = Profile
|
|
|
fI.Partnernr = bestbpnr
|
|
|
fI.Dokumenttypnr = Dokumentvorlage
|
|
|
fI.CreateDocument = True
|
|
|
fI.BarcodeID = Barcodeid
|
|
|
fI.ShowDialog()
|
|
|
Me.Cursor = System.Windows.Forms.Cursors.Default
|
|
|
End Sub
|
|
|
|
|
|
Private Sub StartDP(ByVal Profilnr As Integer, ByVal Profile As System.Data.DataTable, ByVal bestbpnr As String, ByVal Dokumentvorlage As Integer, ByVal Barcodeid As String)
|
|
|
Dim dp1 As New frmDokumentpaket(Dokumentvorlage, Globals.Individuelles_Dokumentpaket, bestbpnr)
|
|
|
dp1.Profile = Profile
|
|
|
dp1.Profilnr = Profilnr
|
|
|
dp1.ShowDialog()
|
|
|
Me.Cursor = System.Windows.Forms.Cursors.Default
|
|
|
End Sub
|
|
|
|
|
|
Private Sub StartBCK(ByVal Profilnr As Integer, ByVal Profile As System.Data.DataTable, ByVal bestbpnr As String, ByVal Dokumentvorlage As Integer, ByVal Barcodeid As String)
|
|
|
Dim fi As New frmDokumentbearbeitungBC()
|
|
|
fi.Profilnr = Profilnr
|
|
|
fi.Profile = Profile
|
|
|
fi.Partnernr = bestbpnr
|
|
|
fi.Dokumenttypnr = Dokumentvorlage
|
|
|
fi.CreateDocument = True
|
|
|
fi.BarcodeID = Barcodeid
|
|
|
fi.ShowDialog()
|
|
|
Me.Cursor = System.Windows.Forms.Cursors.Default
|
|
|
End Sub
|
|
|
|
|
|
Private Sub StartED(ByVal Profilnr As Integer, ByVal Profile As System.Data.DataTable, ByVal bestbpnr As String, ByVal Dokumentvorlage As Integer, ByVal Barcodeid As String)
|
|
|
|
|
|
Dim fi As New frmDokumentbearbeitungED()
|
|
|
fi.Profilnr = Profilnr
|
|
|
fi.Profile = Profile
|
|
|
fi.Partnernr = bestbpnr
|
|
|
fi.Dokumenttypnr = Dokumentvorlage
|
|
|
fi.CreateDocument = True
|
|
|
fi.BarcodeID = Me.barcodeid
|
|
|
fi.MdiParent = Me.MdiParent
|
|
|
fi.ShowDialog()
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
Public Event WndProc2(ByVal m As System.Windows.Forms.Message, ByRef Cancel As Boolean) Implements mMain.SingleInstance.ISingleInstanceForm.WndProc
|
|
|
|
|
|
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
|
|
|
Dim bCancel As Boolean = False
|
|
|
|
|
|
RaiseEvent WndProc2(m, bCancel)
|
|
|
If Not bCancel Then MyBase.WndProc(m)
|
|
|
End Sub
|
|
|
|
|
|
Public ReadOnly Property hWnd() As System.IntPtr Implements EDOKAApp.mMain.SingleInstance.ISingleInstanceForm.Handle
|
|
|
Get
|
|
|
Return Handle
|
|
|
End Get
|
|
|
End Property
|
|
|
|
|
|
Public Sub HandleCommand(ByVal strCmd As String) Implements EDOKAApp.mMain.SingleInstance.ISingleInstanceForm.HandleCommand
|
|
|
Dim arrCmd() As String
|
|
|
Me.BringToFront()
|
|
|
Try
|
|
|
arrCmd = SerialHelper.DeserializeFromBase64String(strCmd)
|
|
|
TKBLib.Errorhandling.TraceHelper.Msg("Schnittstelle", "Agrument <20>bergeben: " + arrCmd(0), TraceLevel.Info)
|
|
|
HandleCommand(arrCmd)
|
|
|
Catch ex As Exception
|
|
|
HandleCommand(New String() {strCmd})
|
|
|
Finally
|
|
|
Erase arrCmd
|
|
|
End Try
|
|
|
End Sub
|
|
|
End Class |