Merge branch 'newMaster2024' of https://dev.azure.com/VeragAG/_git/SDL into newMaster2024

This commit is contained in:
2024-11-13 09:04:57 +01:00
7 changed files with 905 additions and 38 deletions

View File

@@ -237,6 +237,63 @@ Public Class cAvisoBenachrichtigungen
End Function
Public Shared Function send_BENACHRICHTIGUNG_AKTIV_AVISOUSER(AvisoId As Integer, SendungsId As Integer, TXT_Titel As String, TXT_Mitteilung As String, code As Integer, Optional firma As String = "")
'Benachrichtigung
Try
Dim SQL As New SQL
Dim sendToID As String = SQL.DLookup("tblSnd_VG_MA", "tblSendungen", "tblSnd_SendungID='" & SendungsId & "'", "AVISO", -1)
Dim art = "B"
'Wenn Benutzer vorschreiben nicht online, dann Benutzer der Sendung...
If sendToID <= 0 OrElse (Not VERAG_PROG_ALLGEMEIN.cSession.IS_ONLINE(sendToID, True)) Then
sendToID = SQL.DLookup("LetzterMitarbeiterId", "tblSendungen", "tblSnd_SendungID='" & SendungsId & "'", "AVISO", -1)
art = "B"
End If
'Wenn Benutzer der Sendung nicht online, dann Benutzer des LKW ..
If sendToID <= 0 OrElse (Not VERAG_PROG_ALLGEMEIN.cSession.IS_ONLINE(sendToID, True)) Then
sendToID = SQL.DLookup("LetzterMitarbeiterId", "Aviso", "AvisoId='" & AvisoId & "'", "AVISO", -1)
art = "B"
End If
'Wenn Benutzer des LKWs nicht online, Team...
If sendToID <= 0 OrElse (Not VERAG_PROG_ALLGEMEIN.cSession.IS_ONLINE(sendToID, True)) Then
sendToID = SQL.DLookup("tblSnd_TeamId", "tblSendungen", "tblSnd_SendungID='" & SendungsId & "'", "AVISO", -1)
art = "T"
End If
'Wenn TEAM nicht gefunden, Firma...
If sendToID <= 0 Then
If firma IsNot Nothing AndAlso firma <> "" Then
sendToID = firma
art = "F"
End If
End If
'Wenn gefunden
If (art = "F" AndAlso If(sendToID, "") <> "") OrElse sendToID >= 0 Then
Dim statusAVISO = SQL.DLookup("Status", "Aviso", "AvisoID='" & AvisoId & "'", "AVISO")
' Dim GrenzstelleAVISO = SQL.DLookup("Grenzstelle", "Aviso", "AvisoID='" & DY_TMP.dy_AvisoId & "'", "AVISO")
' If GrenzstelleAVISO = "???" Then 'lt. ML 27.03.-> für alle freigeben
Select Case statusAVISO
Case VERAG_PROG_ALLGEMEIN.cGlobal.Status_NichtEingetroffen, VERAG_PROG_ALLGEMEIN.cGlobal.Status_Freigegeben
'Nicht
Case Else
VERAG_PROG_ALLGEMEIN.cAvisoBenachrichtigungen.INSERT_BENACHRICHTIGUNG(AvisoId, SendungsId, code, art, sendToID, TXT_Titel, 1, , (TXT_Mitteilung).Trim,,, firma <> "")
Return True
End Select
' End If
End If
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace & vbNewLine, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
Return False
End Function
End Class
Public Class cAvisoBenachrichtigungenCodes
@@ -251,5 +308,6 @@ Public Class cAvisoBenachrichtigungenCodes
Public Shared ZOLL_Rueckweisung As Integer = 8
Public Shared ZOLL_Mitteilung As Integer = 9
Public Shared AAE_Benachrichtigung As Integer = 10
Public Shared Verwahrung_Foto As Integer = 20
End Class

View File

@@ -1,9 +1,16 @@

Imports System.Data.SqlClient
Imports System.IO
Imports System.Net
Imports System.Reflection
Imports System.Windows.Forms
Imports com.sun.xml.internal.ws.api.pipe
Imports javax.print.attribute.standard
Imports Microsoft.Office.Interop
Public Class cIDS
Property transaction_id As Integer
Property YearMonthDay As Object = Nothing
Property Paymentsummarynumber As Object = Nothing
@@ -40,10 +47,27 @@ Public Class cIDS
Dim SQL As New SQL
Sub New()
End Sub
Sub New(transaction_id)
Me.transaction_id = transaction_id
LOAD()
LOADID()
End Sub
Sub New(YearMonthDay, Paymentsummarynumber, CustomerCode, OutletCountryCode, OutletCode, ProductTypeCode)
Me.YearMonthDay = YearMonthDay
Me.Paymentsummarynumber = Paymentsummarynumber
Me.CustomerCode = CustomerCode
Me.OutletCountryCode = OutletCountryCode
Me.OutletCode = OutletCode
Me.ProductTypeCode = ProductTypeCode
LOAD()
End Sub
Function getParameterList() As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
Dim list As New List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("transaction_id", transaction_id,, True))
@@ -76,30 +100,30 @@ Public Class cIDS
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("UStVAn_ID", UStVAn_ID))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("VRNumber", VRNumber))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("OBONumber", OBONumber))
Return list
End Function
Public Function SAVE() As Boolean
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
Dim sqlstr = " BEGIN TRAN IF EXISTS(SELECT * FROM tblIDSTransactions WHERE transaction_id=@transaction_id) " &
" BEGIN " & getUpdateCmd() & " END " &
" Else " &
" BEGIN " & getInsertCmd() & " END " &
" commit tran "
Dim sqlstr = " BEGIN TRAN IF EXISTS(SELECT * FROM tblIDSTransactionsNew WHERE YearMonthDay=@YearMonthDay AND Paymentsummarynumber=@Paymentsummarynumber AND CustomerCode=@CustomerCode AND OutletCountryCode=@OutletCountryCode AND OutletCode=@OutletCode AND ProductTypeCode=@ProductTypeCode) " &
" BEGIN " & getUpdateCmd() & " END " &
" Else " &
" BEGIN " & getInsertCmd() & " END " &
" commit tran "
Return SQL.doSQLVarList(sqlstr, "FMZOLL", , list)
End Function
Public Sub LOAD()
Public Sub LOADID()
Try
hasEntry = False
Using conn As SqlConnection = SQL.GetNewOpenConnectionFMZOLL()
Using cmd As New SqlCommand("SELECT * FROM tblIDSTransactions WHERE transaction_id=@transaction_id ", conn)
Using cmd As New SqlCommand("SELECT * FROM tblIDSTransactionsNew WHERE transaction_id=@transaction_id ", conn)
cmd.Parameters.AddWithValue("@transaction_id", transaction_id)
Dim dr = cmd.ExecuteReader()
If dr.Read Then
@@ -111,7 +135,39 @@ Public Class cIDS
Else
propInfo.SetValue(Me, dr.Item(li.Text))
End If
Next
hasEntry = True
End If
dr.Close()
End Using
End Using
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
End Sub
Public Sub LOAD()
Try
hasEntry = False
Using conn As SqlConnection = SQL.GetNewOpenConnectionFMZOLL()
Using cmd As New SqlCommand("SELECT * FROM tblIDSTransactionsNew WHERE YearMonthDay=@YearMonthDay AND Paymentsummarynumber=@Paymentsummarynumber AND CustomerCode=@CustomerCode AND OutletCountryCode=@OutletCountryCode AND OutletCode=@OutletCode AND ProductTypeCode=@ProductTypeCode ", conn)
cmd.Parameters.AddWithValue("@YearMonthDay", YearMonthDay)
cmd.Parameters.AddWithValue("@Paymentsummarynumber", Paymentsummarynumber)
cmd.Parameters.AddWithValue("@CustomerCode", CustomerCode)
cmd.Parameters.AddWithValue("@OutletCountryCode", OutletCountryCode)
cmd.Parameters.AddWithValue("@OutletCode", OutletCode)
cmd.Parameters.AddWithValue("@ProductTypeCode", ProductTypeCode)
Dim dr = cmd.ExecuteReader()
If dr.Read Then
For Each li In getParameterList()
Dim propInfo As PropertyInfo = Me.GetType.GetProperty(li.Scalarvariable)
If dr.Item(li.Text) Is DBNull.Value Then
propInfo.SetValue(Me, Nothing)
Else
propInfo.SetValue(Me, dr.Item(li.Text))
End If
Next
hasEntry = True
End If
@@ -136,7 +192,7 @@ Public Class cIDS
End If
Next
str = str.Substring(0, str.Length - 1) 'wg. ','
Return (" UPDATE [tblIDSTransactions] SET " & str & " WHERE transaction_id=@transaction_id ")
Return (" UPDATE [tblIDSTransactionsNew] SET " & str & " WHERE YearMonthDay=@YearMonthDay AND Paymentsummarynumber=@Paymentsummarynumber AND CustomerCode=@CustomerCode AND OutletCountryCode=@OutletCountryCode AND OutletCode=@OutletCode AND ProductTypeCode=@ProductTypeCode ")
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
@@ -158,13 +214,82 @@ Public Class cIDS
Next
str = str.Substring(0, str.Length - 1) 'wg. ','
values = values.Substring(0, values.Length - 1) 'wg. ','
Return (" INSERT INTO tblIDSTransactions (" & str & ") VALUES(" & values & ") ")
Return (" INSERT INTO tblIDSTransactionsNew (" & str & ") VALUES(" & values & ") ")
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
Return ""
End Function
Public Function readAndSaveIDS(objFileRead As StreamReader, fi As FileInfo, cnt As Integer) As Boolean
Dim lngRecordCount As Long = 0
objFileRead.DiscardBufferedData()
objFileRead.BaseStream.Seek(0, System.IO.SeekOrigin.Begin)
Do While (objFileRead.Peek() > -1) 'header ignoríeren
Dim currentRow As String()
currentRow = objFileRead.ReadLine().Split(",")
lngRecordCount = lngRecordCount + 1
If lngRecordCount = 1 Then
If Not isleernothing((currentRow(0))) = "Year Month Day" Then
Return False
End If
Else
Dim ymd = isleernothing((currentRow(0)))
Dim cc = isleernothing((currentRow(1)))
Dim pyn = isleernothing((currentRow(2)))
Dim occ = isleernothing((currentRow(5)))
Dim oc = isleernothing((currentRow(6)))
Dim ptc = isleernothing((currentRow(7)))
Dim ids As New cIDS(ymd, pyn, cc, occ, oc, ptc)
With ids
.YearMonthDay = isleernothing((currentRow(0)))
.CustomerCode = isleernothing((currentRow(1)))
.Paymentsummarynumber = isleernothing((currentRow(2)))
.CustomerName = isleernothing((currentRow(4)))
.OutletCountry = isleernothing((currentRow(5)))
.OutletCountryCode = isleernothing((currentRow(6)))
.OutletCode = isleernothing((currentRow(7)))
.TransactionVolume = isleernothing((currentRow(8)))
.AmminclVAT = isleernothing((currentRow(9)))
.TotalNetAmount = isleernothing((currentRow(10)))
.VATAmount = isleernothing((currentRow(11)))
.avpriceexclVAT = isleernothing((currentRow(12)))
.VRNumber = isleernothing((currentRow(13)))
.OBONumber = isleernothing((currentRow(14)))
.SAVE()
End With
End If
Loop
cnt = CInt(lngRecordCount)
objFileRead.Close()
Return True
End Function
Function isleernothing(s) As Object
If s Is DBNull.Value Then Return Nothing
If s.ToString.Trim = "" Then Return Nothing
Return s.trim
End Function
Public VERARBEITUNG_PFAD
Public ARCHIV_PFAD
Public ERROR_PFAD
@@ -189,7 +314,7 @@ Public Class cIDS
MsgBox("Verabreitungspfad nicht gesetzt!")
End If
Return Paramter.getFTPConenction(API_STRING, API, programName)
Return True
End Function
@@ -198,9 +323,8 @@ Public Class cIDS
Shared apiSettingsloaded As Boolean = False
Shared SQL As New VERAG_PROG_ALLGEMEIN.SQL
Shared Function GET_PARAM_ByName(tcParam_name, TESTSYSTEM) As String
Return SQL.getValueTxtBySql("SELECT TOP 1 [Param_value] FROM [tblPartnersystem_Paramter] WHERE Param_system='UTA' AND [Param_name]='" & tcParam_name & "'", , , SQL.GetNewOpenConnectionFMZOLL_SYSTEM(TESTSYSTEM))
Return SQL.getValueTxtBySql("SELECT TOP 1 [Param_value] FROM [tblPartnersystem_Paramter] WHERE Param_system='IDS' AND [Param_name]='" & tcParam_name & "'", , , SQL.GetNewOpenConnectionFMZOLL_SYSTEM(TESTSYSTEM))
End Function
Shared Function getFTPConenction(ByRef API_String As String, ByRef API As DataTable, ByRef program As String) As Boolean
@@ -222,3 +346,231 @@ Public Class cIDS
End Class
Public Class cIDSInvoice
Property invoice_id As Integer
Property YearMonthDay As Object = Nothing
Property CustomerCode As Object = Nothing
Property Invoicenumber As Object = Nothing
Property DocumentName As Object = Nothing
Property Zeitstempel As Object = Nothing
Property daid As Object = Nothing
Property archiv As Boolean
Property archiviertDatum As Object = Nothing
Public hasEntry = False
Dim SQL As New SQL
Sub New()
End Sub
Sub New(invoice_id)
Me.invoice_id = invoice_id
LOADID()
End Sub
Sub New(YearMonthDay, CustomerCode, Invoicenumber)
Me.YearMonthDay = YearMonthDay
Me.Invoicenumber = Invoicenumber
Me.CustomerCode = CustomerCode
LOAD()
End Sub
Function getParameterList() As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
Dim list As New List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("invoice_id", invoice_id,, True))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("YearMonthDay", YearMonthDay))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("CustomerCode", CustomerCode))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("Invoicenumber", Invoicenumber))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("DocumentName", DocumentName))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("Zeitstempel", Zeitstempel))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("daid", daid))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("archiv", archiv))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("archiviertDatum", archiviertDatum))
Return list
End Function
Public Function SAVE() As Boolean
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
Dim sqlstr = " BEGIN TRAN IF EXISTS(SELECT * FROM tblIDSInvoicesNew WHERE YearMonthDay=@YearMonthDay AND CustomerCode=@CustomerCode AND Invoicenumber=@Invoicenumber) " &
" BEGIN " & getUpdateCmd() & " END " &
" Else " &
" BEGIN " & getInsertCmd() & " END " &
" commit tran "
Return SQL.doSQLVarList(sqlstr, "FMZOLL", , list)
End Function
Public Sub LOADID()
Try
hasEntry = False
Using conn As SqlConnection = SQL.GetNewOpenConnectionFMZOLL()
Using cmd As New SqlCommand("SELECT * FROM tblIDSInvoicesNew WHERE invoice_id=@invoice_id ", conn)
cmd.Parameters.AddWithValue("@invoice_id", invoice_id)
Dim dr = cmd.ExecuteReader()
If dr.Read Then
For Each li In getParameterList()
Dim propInfo As PropertyInfo = Me.GetType.GetProperty(li.Scalarvariable)
If dr.Item(li.Text) Is DBNull.Value Then
propInfo.SetValue(Me, Nothing)
Else
propInfo.SetValue(Me, dr.Item(li.Text))
End If
Next
hasEntry = True
End If
dr.Close()
End Using
End Using
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
End Sub
Public Sub LOAD()
Try
hasEntry = False
Using conn As SqlConnection = SQL.GetNewOpenConnectionFMZOLL()
Using cmd As New SqlCommand("SELECT * FROM tblIDSInvoicesNew WHEREYearMonthDay=@YearMonthDay AND CustomerCode=@CustomerCode AND Invoicenumber=@Invoicenumber ", conn)
cmd.Parameters.AddWithValue("@YearMonthDay", YearMonthDay)
cmd.Parameters.AddWithValue("@Invoicenumber", Invoicenumber)
cmd.Parameters.AddWithValue("@CustomerCode", CustomerCode)
Dim dr = cmd.ExecuteReader()
If dr.Read Then
For Each li In getParameterList()
Dim propInfo As PropertyInfo = Me.GetType.GetProperty(li.Scalarvariable)
If dr.Item(li.Text) Is DBNull.Value Then
propInfo.SetValue(Me, Nothing)
Else
propInfo.SetValue(Me, dr.Item(li.Text))
End If
Next
hasEntry = True
End If
dr.Close()
End Using
End Using
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
End Sub
Public Function getUpdateCmd() As String
Try
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
Dim str As String = ""
For Each i In list
If Not i.isPrimaryParam Then
str &= "[" & i.Text & "] = @" & i.Scalarvariable & "," '.Replace("-", "").Replace(" ", "") & ","
End If
Next
str = str.Substring(0, str.Length - 1) 'wg. ','
Return (" UPDATE [tblIDSInvoicesNew] SET " & str & " WHERE YearMonthDay=@YearMonthDay AND CustomerCode=@CustomerCode AND Invoicenumber=@Invoicenumber")
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
Return ""
End Function
Public Function getInsertCmd() As String
Try
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
Dim str As String = ""
Dim values As String = ""
For Each i In list
If Not i.isPrimaryParam Then
str &= "[" & i.Text & "],"
values &= "@" & i.Scalarvariable & "," '.Replace("-", "").Replace(" ", "") & ","
End If
Next
str = str.Substring(0, str.Length - 1) 'wg. ','
values = values.Substring(0, values.Length - 1) 'wg. ','
Return (" INSERT INTO tblIDSInvoicesNew (" & str & ") VALUES(" & values & ") ")
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
Return ""
End Function
Shared Function isMail_IDS(mailItem As Outlook.MailItem) As Boolean
Try
If mailItem IsNot Nothing Then
Dim srch As String = "https://admin.unifiedpost.com/umadmin/viewDoc?doc="
Return mailItem.HTMLBody.ToString.Contains(srch)
End If
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
Return False
End Function
Shared Function getPDF_IDS(ByRef mailItem As Outlook.MailItem, ByRef filename As String, ByRef targetpath As String) As Boolean
Try
If mailItem Is Nothing Then Return False
Dim html = mailItem.HTMLBody
Dim srch As String = "https://admin.unifiedpost.com/"
If html.ToString.Contains(srch) Then
Dim myDelims As String() = New String() {srch}
Dim sp = html.Split(myDelims, StringSplitOptions.None)
Dim cnt = 0
For Each txtHTML In sp
If cnt > 0 AndAlso txtHTML.Contains(""">") Then
System.Net.ServicePointManager.SecurityProtocol = System.Net.ServicePointManager.SecurityProtocol Or SecurityProtocolType.Tls11 Or SecurityProtocolType.Tls12
Dim pdfNameWithCounter As String = ""
Dim counter As Integer = 1
Dim lastPdfName As String = ""
Dim linkinHTML = "umadmin/viewDoc?doc="
Dim lastIndexLink = txtHTML.ToString.IndexOf(linkinHTML) + linkinHTML.Length
Dim link = ("https://admin.unifiedpost.com/umadmin/viewDoc?doc=" & txtHTML.ToString.Substring(lastIndexLink, txtHTML.ToString.IndexOf(("Open document")) - lastIndexLink - 2))
Dim pdf = VERAG_PROG_ALLGEMEIN.cFormularManager.getPDFViaSpirePDF_FromURLStream(link, , targetpath, False)
If pdf <> "" Then
Dim fi As New FileInfo(pdf)
filename = fi.Name
Return True
End If
End If
cnt += 1
Next
End If
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
Return False
End Function
End Class

View File

@@ -414,7 +414,17 @@ Public Class frmMitarbeitersuche
If MA.mit_nname.ToLower = "celan" Then 'aktuell Hardcoded, wenn Zeit ist dynamisch (per SQL-tbl)
Dim f As New frmZEButtons(art)
Dim f As New frmZEButtons(art, {"IMEX", "ATILLA", "VERAG", "FO"})
f.ShowDialog()
If f.DialogResult = DialogResult.OK AndAlso f.resultCode >= 0 Then
resultCode = f.resultCode
Else
Exit Sub
End If
ElseIf VERAG_PROG_ALLGEMEIN.cAllgemein.MITARBEITER.mit_nname.ToLower = "arslan" AndAlso VERAG_PROG_ALLGEMEIN.cAllgemein.MITARBEITER.mit_vname.ToLower = "cihan" Then
Dim f As New frmZEButtons(art, {"IMEX", "ATILLA"})
f.ShowDialog()
If f.DialogResult = DialogResult.OK AndAlso f.resultCode >= 0 Then

View File

@@ -3,10 +3,12 @@
Public Class frmZEButtons
Dim art As String
Dim firma As String()
Public resultCode As Integer = -1
Sub New(art As String)
Sub New(art As String, Firma As String())
Me.art = art
Me.firma = Firma
InitializeComponent()
End Sub
@@ -28,15 +30,26 @@ Public Class frmZEButtons
Select Case art
Case "in"
btnIMEXKommen.Enabled = True
btnATTKommen.Enabled = True
btnFOKommen.Enabled = True
btnVergKommen.Enabled = True
If firma IsNot Nothing AndAlso firma.Length > 0 Then
If firma.Contains("ATILLA") Then btnATTKommen.Enabled = True
If firma.Contains("IMEX") Then btnIMEXKommen.Enabled = True
If firma.Contains("FO") Then btnFOKommen.Enabled = True
If firma.Contains("VERAG") Then btnVergKommen.Enabled = True
End If
Case "out"
btnIMEXGehen.Enabled = True
btnATTGehen.Enabled = True
btnFOGehen.Enabled = True
btnVergGehen.Enabled = True
If firma IsNot Nothing AndAlso firma.Length > 0 Then
If firma.Contains("ATILLA") Then btnATTGehen.Enabled = True
If firma.Contains("IMEX") Then btnIMEXGehen.Enabled = True
If firma.Contains("FO") Then btnFOGehen.Enabled = True
If firma.Contains("VERAG") Then btnVergGehen.Enabled = True
End If
Case Else
End Select