Kundenanlage VERIMEX (AMVAR); cbo Erwe. hasItems

This commit is contained in:
2023-06-12 08:27:47 +02:00
parent 012e8b4996
commit 090b81ffb5
5 changed files with 63 additions and 0 deletions

View File

@@ -123,6 +123,9 @@ Public Class usrcntlKundeBearbeitenFull
btnUIDPruef.Visible = True
End If
If VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA = "VERIMEX" Then
If Not cboKundenkreis.hasItem("3000000-3099990") Then cboKundenkreis.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("3000000-3099999: AMBAR", "3000000-3099990"))
End If
If VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA = "FRONTOFFICE" Then
cboKundenkreis.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem(" 9900000-9999999: FRONT-OFFICE - Kunden", "9900000-9999999"))

View File

@@ -96,6 +96,38 @@ Public Class MyComboBox
Return False
End Function
Function hasItem(v) As Boolean
'
Try
If v Is Nothing Then Me.Text = "" : Return True
If v Is DBNull.Value Then Me.Text = "" : Return True
If Me.Items.Count = 0 Then Me.Text = "" : Return True
If Me.Items(0).GetType.Name = "MyListItem" Then
For Each i In Me.Items
' MsgBox(DirectCast(i, MyListItem).Value & " - " & v)
If DirectCast(i, MyListItem).Value.ToUpper = CStr(v).ToUpper Then
'me.SelectedIndex = i : Return True
Return True
End If
Next
For Each i In Me.Items
' MsgBox(DirectCast(i, MyListItem).Value & " - " & v)
If DirectCast(i, MyListItem).Text.ToUpper = CStr(v).ToUpper Then
Return True
End If
Next
End If
Catch ex As Exception
' MsgBox(ex.Message)
End Try
Return False
End Function
Function getValueOfItem() As String
If Me.Items.Count = 0 Then Return ""
Try : Return DirectCast(MyBase.SelectedItem, MyListItem).Value

View File

@@ -211,6 +211,10 @@
' If datum = CDate("08.08." & _Year) Then Return True ' Augsburger Friedensfest
If datum = CDate("01.05." & _Year) Then Return True ' Maifeiertag
If datum = Karfreitag Then Return True
Case "GB" 'BAYERN
Return False
Case Else
Return False
End Select
Return False
End Function

View File

@@ -112,6 +112,8 @@ Public Class cSendungen
Property tblSnd_AbfertigungTRAnzahl As Object = Nothing
Property tblSnd_AbfertigungTRAnzahlPos As Object = Nothing
Property tblSnd_Firma As Object = Nothing
Property tblSnd_Cluster As Object = Nothing
Public saveSachbearbeiter As Boolean = False
@@ -254,6 +256,10 @@ Public Class cSendungen
Public Function SAVE(Optional saveStatus = True) As Boolean 'obj As Object, tablename As String, where As String) As Boolean
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList(saveStatus)
'WITH(updlock,serializable)
tblSnd_Firma = VERAG_PROG_ALLGEMEIN.cAllgemein.getFirmaFromFiliale2(FilialenNr,, "")
tblSnd_Cluster = VERAG_PROG_ALLGEMEIN.cAllgemein.getClusterFromFiliale(FilialenNr,, "")
Dim sqlstr = " BEGIN TRAN IF EXISTS(SELECT * FROM [tblSendungen] WHERE tblSnd_SendungID=@tblSnd_SendungID) " &
" BEGIN " & getUpdateCmd(saveStatus) & " END " &
" Else " &
@@ -425,6 +431,9 @@ Public Class cSendungen
Me.tblSnd_AbfertigungTR_MA = SQL.checkNullReturnValue(dr.Item("tblSnd_AbfertigungTR_MA"), Nothing)
Me.tblSnd_AbfertigungTRAnzahl = SQL.checkNullIntegerZero(dr.Item("tblSnd_AbfertigungTRAnzahl"))
Me.tblSnd_AbfertigungTRAnzahlPos = SQL.checkNullIntegerZero(dr.Item("tblSnd_AbfertigungTRAnzahlPos"))
Me.tblSnd_Firma = SQL.checkNullReturnValue(dr.Item("tblSnd_Firma"), Nothing)
Me.tblSnd_Cluster = SQL.checkNullReturnValue(dr.Item("tblSnd_Cluster"), Nothing)
End If
@@ -650,6 +659,9 @@ Public Class cSendungen
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("tblSnd_AbfertigungTR_MA", tblSnd_AbfertigungTR_MA))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("tblSnd_AbfertigungTRAnzahl", tblSnd_AbfertigungTRAnzahl))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("tblSnd_AbfertigungTRAnzahlPos", tblSnd_AbfertigungTRAnzahlPos))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("tblSnd_Firma", tblSnd_Firma))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("tblSnd_Cluster", tblSnd_Cluster))
'End If
Return list
End Function

View File

@@ -338,6 +338,18 @@ Public Class cAllgemein
Return FirmaTMP
End Function
Public Shared Function getClusterFromFiliale(FilialenNr As Object, Optional usedefaultCLUSTER As Boolean = True, Optional defaultCLUSTER As String = "VERAG") As String
Dim FirmaTMP = ""
If FilialenNr IsNot Nothing AndAlso IsNumeric(FilialenNr) Then
' FirmaTMP = SQL.getValueTxtBySql("SELECT TOP 1 [Firma] FROM [Filialen] WHERE FilialenNr='" & FilialenNr & "' ", "FMZOLL")
If FILIALEN Is Nothing Then LOAD_FILIALEN()
Dim FILIALE = FILIALEN.Find(Function(x) x.FilialenNr = FilialenNr)
If FILIALE IsNot Nothing Then FirmaTMP = If(FILIALE.Cluster, "")
End If
If usedefaultCLUSTER AndAlso FirmaTMP = "" Then FirmaTMP = defaultCLUSTER
Return FirmaTMP
End Function
Public Shared Function getFirmaFromFiliale(FilialenNr As Object, Optional defaultVERAG As Boolean = True) As String
Dim FirmaTMP = ""