neu
This commit is contained in:
@@ -159,100 +159,116 @@ Public Class KdSearchBox
|
||||
End Sub
|
||||
|
||||
Sub doKeyDown(srchdate As DateTime)
|
||||
If Eingabe_verarbeitet Then Exit Sub ' Bereits abgearbetiet -> Timer
|
||||
Try
|
||||
If usrcntl Is Nothing Then Exit Sub
|
||||
If Eingabe_verarbeitet Then Exit Sub ' Bereits abgearbetiet -> Timer
|
||||
|
||||
Dim span_last_search = CInt(DirectCast((srchdate - last_search), TimeSpan).TotalMilliseconds)
|
||||
Dim span_last_eingabe = CInt(DirectCast((srchdate - last_eingabe), TimeSpan).TotalMilliseconds)
|
||||
Dim span_last_search = CInt(DirectCast((srchdate - last_search), TimeSpan).TotalMilliseconds)
|
||||
Dim span_last_eingabe = CInt(DirectCast((srchdate - last_eingabe), TimeSpan).TotalMilliseconds)
|
||||
|
||||
'TIMER_SEARCH
|
||||
If TIMER_SEARCH Then
|
||||
If span_last_search < 500 And span_last_eingabe < 500 Then
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
If usrcntl.Visible = False Then
|
||||
usrcntl.Width = usrcntlWIDTH
|
||||
usrcntl.Height = usrcntlHEIGHT
|
||||
|
||||
Dim locationOnForm As Point = Nothing
|
||||
If Me.FindForm IsNot Nothing Then
|
||||
If dgvpos = "LEFT" Or dgvpos = "" Then
|
||||
locationOnForm = Me.FindForm().PointToClient(Me.Parent.PointToScreen(Me.Location))
|
||||
ElseIf dgvpos = "RIGHT" Then
|
||||
locationOnForm = Me.FindForm().PointToClient(Me.Parent.PointToScreen(Me.Location))
|
||||
locationOnForm.X = locationOnForm.X - (usrcntl.Width - Me.Width)
|
||||
'TIMER_SEARCH
|
||||
If TIMER_SEARCH Then
|
||||
If span_last_search < 500 And span_last_eingabe < 500 Then
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
If locationOnForm.Y + usrcntl.Height + Me.Height > form.ClientRectangle.Height Then
|
||||
usrcntl.Height = form.ClientRectangle.Height - locationOnForm.Y - Me.Height
|
||||
End If
|
||||
|
||||
usrcntl.Location = locationOnForm
|
||||
usrcntl.Top += Me.Height
|
||||
End If
|
||||
|
||||
With usrcntl.dgvKundenAktiv
|
||||
|
||||
If usrcntl.Visible = False Then
|
||||
.AllowUserToAddRows = False
|
||||
.AllowUserToDeleteRows = False
|
||||
.AllowUserToOrderColumns = False
|
||||
.AllowUserToResizeColumns = False
|
||||
.AllowUserToResizeRows = False
|
||||
.ReadOnly = True
|
||||
.MultiSelect = False
|
||||
.SelectionMode = DataGridViewSelectionMode.FullRowSelect
|
||||
.BackgroundColor = Color.White
|
||||
.ForeColor = Color.Black
|
||||
.GridColor = Color.White
|
||||
usrcntl.Width = usrcntlWIDTH
|
||||
usrcntl.Height = usrcntlHEIGHT
|
||||
|
||||
Dim locationOnForm As Point = Nothing
|
||||
If Me.FindForm IsNot Nothing Then
|
||||
If dgvpos = "LEFT" Or dgvpos = "" Then
|
||||
locationOnForm = Me.FindForm().PointToClient(Me.Parent.PointToScreen(Me.Location))
|
||||
ElseIf dgvpos = "RIGHT" Then
|
||||
locationOnForm = Me.FindForm().PointToClient(Me.Parent.PointToScreen(Me.Location))
|
||||
locationOnForm.X = locationOnForm.X - (usrcntl.Width - Me.Width)
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
If locationOnForm.Y + usrcntl.Height + Me.Height > form.ClientRectangle.Height Then
|
||||
usrcntl.Height = form.ClientRectangle.Height - locationOnForm.Y - Me.Height
|
||||
End If
|
||||
|
||||
usrcntl.Location = locationOnForm
|
||||
usrcntl.Top += Me.Height
|
||||
End If
|
||||
|
||||
'THREADING AKTIV
|
||||
Me.ThreadInitAKTIV()
|
||||
' Dim ThreadInitAKTIV = New System.Threading.Thread(AddressOf Me.ThreadInitAKTIV)
|
||||
' ThreadInitAKTIV.IsBackground = True
|
||||
' ThreadInitAKTIV.Start()
|
||||
If usrcntl IsNot Nothing AndAlso usrcntl.dgvKundenAktiv IsNot Nothing Then
|
||||
|
||||
End With
|
||||
With usrcntl.dgvKundenAktiv
|
||||
|
||||
If usrcntl.Visible = False Then
|
||||
.AllowUserToAddRows = False
|
||||
.AllowUserToDeleteRows = False
|
||||
.AllowUserToOrderColumns = False
|
||||
.AllowUserToResizeColumns = False
|
||||
.AllowUserToResizeRows = False
|
||||
.ReadOnly = True
|
||||
.MultiSelect = False
|
||||
.SelectionMode = DataGridViewSelectionMode.FullRowSelect
|
||||
.BackgroundColor = Color.White
|
||||
.ForeColor = Color.Black
|
||||
Try
|
||||
.GridColor = Color.White
|
||||
Catch ex As Exception
|
||||
'Keine Ahnung warum hier ein Fehler kommt
|
||||
End Try
|
||||
|
||||
End If
|
||||
|
||||
|
||||
If nurAktive Then
|
||||
'THREADING AKTIV
|
||||
Me.ThreadInitAKTIV()
|
||||
' Dim ThreadInitAKTIV = New System.Threading.Thread(AddressOf Me.ThreadInitAKTIV)
|
||||
' ThreadInitAKTIV.IsBackground = True
|
||||
' ThreadInitAKTIV.Start()
|
||||
|
||||
End With
|
||||
End If
|
||||
|
||||
If nurAktive Then
|
||||
usrcntl.dgvKundenInAktiv.Visible = False
|
||||
usrcntl.Panel1.Visible = False
|
||||
Else
|
||||
With usrcntl.dgvKundenInAktiv
|
||||
If usrcntl.Visible = False Then
|
||||
.AllowUserToAddRows = False
|
||||
.AllowUserToDeleteRows = False
|
||||
.AllowUserToOrderColumns = False
|
||||
.AllowUserToResizeColumns = False
|
||||
.AllowUserToResizeRows = False
|
||||
.ReadOnly = True
|
||||
.MultiSelect = False
|
||||
.SelectionMode = DataGridViewSelectionMode.FullRowSelect
|
||||
.BackgroundColor = Color.White
|
||||
.ForeColor = Color.Black
|
||||
.GridColor = Color.White
|
||||
.DefaultCellStyle.ForeColor = Color.Gray
|
||||
If usrcntl IsNot Nothing AndAlso usrcntl.dgvKundenInAktiv IsNot Nothing Then
|
||||
|
||||
With usrcntl.dgvKundenInAktiv
|
||||
If usrcntl.Visible = False Then
|
||||
.AllowUserToAddRows = False
|
||||
.AllowUserToDeleteRows = False
|
||||
.AllowUserToOrderColumns = False
|
||||
.AllowUserToResizeColumns = False
|
||||
.AllowUserToResizeRows = False
|
||||
.ReadOnly = True
|
||||
.MultiSelect = False
|
||||
.SelectionMode = DataGridViewSelectionMode.FullRowSelect
|
||||
.BackgroundColor = Color.White
|
||||
.ForeColor = Color.Black
|
||||
Try
|
||||
.GridColor = Color.White
|
||||
Catch ex As Exception
|
||||
'Keine Ahnung warum hier ein Fehler kommt
|
||||
End Try
|
||||
.DefaultCellStyle.ForeColor = Color.Gray
|
||||
End If
|
||||
|
||||
|
||||
Me.ThreadInitINAKTIV()
|
||||
'THREADING INAKTIV
|
||||
'Dim ThreadInitINAKTIV = New System.Threading.Thread(AddressOf Me.ThreadInitINAKTIV)
|
||||
'ThreadInitINAKTIV.IsBackground = True
|
||||
'ThreadInitINAKTIV.Start()
|
||||
|
||||
End With
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
Me.ThreadInitINAKTIV()
|
||||
'THREADING INAKTIV
|
||||
'Dim ThreadInitINAKTIV = New System.Threading.Thread(AddressOf Me.ThreadInitINAKTIV)
|
||||
'ThreadInitINAKTIV.IsBackground = True
|
||||
'ThreadInitINAKTIV.Start()
|
||||
|
||||
End With
|
||||
|
||||
End If
|
||||
|
||||
If _hideIfListEmpty Then
|
||||
If _hideIfListEmpty Then
|
||||
|
||||
If usrcntl.dgvKundenAktiv.RowCount = 0 And usrcntl.dgvKundenInAktiv.RowCount = 0 Then
|
||||
setObjectVisible(usrcntl, False)
|
||||
@@ -281,6 +297,9 @@ Public Class KdSearchBox
|
||||
Eingabe_verarbeitet = True
|
||||
last_search = Now
|
||||
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message & ex.StackTrace)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Public Sub hideDgv(o) '(sender As Object, e As EventArgs)
|
||||
@@ -345,6 +364,9 @@ Public Class KdSearchBox
|
||||
If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG_bool("OFFERTE_FREMD_VERAGIMEX", "SDL") Then
|
||||
SQLstr &= " OR Filialen.Firma IN ('IMEX','VERAG') " ' Wenn die OFFERTE_FREMD_VERAGIMEX --> Beide
|
||||
End If
|
||||
If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG_bool("OFFERTE_FREMD_UNISPED_BREXIT", "SDL") Then
|
||||
SQLstr &= " OR (Filialen.Firma IN ('UNISPED') AND Kunden.[FilialenNr]=7002) " ' Wenn die OFFERTE_FREMD_VERAGIMEX --> Beide
|
||||
End If
|
||||
If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG_bool("FAKTURIERUNG_FRONTOFFICE", "SDL") Then
|
||||
SQLstr &= " OR Filialen.Firma IN ('FRONTOFFICE') " ' Wenn die Firmenbezeichnung im CLUSter vorkommt .--> Frontoffice
|
||||
End If
|
||||
@@ -432,6 +454,9 @@ Public Class KdSearchBox
|
||||
If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG_bool("OFFERTE_FREMD_VERAGIMEX", "SDL") Then
|
||||
SQLstr &= " OR Filialen.Firma IN ('IMEX','VERAG') " ' Wenn die OFFERTE_FREMD_VERAGIMEX --> Beide
|
||||
End If
|
||||
If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG_bool("OFFERTE_FREMD_UNISPED_BREXIT", "SDL") Then
|
||||
SQLstr &= " OR (Filialen.Firma IN ('UNISPED') AND Kunden.[FilialenNr]=7002) " ' Wenn die OFFERTE_FREMD_VERAGIMEX --> Beide
|
||||
End If
|
||||
If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG_bool("FAKTURIERUNG_FRONTOFFICE", "SDL") Then
|
||||
SQLstr &= " OR Filialen.Firma IN ('FRONTOFFICE') " ' Wenn die Firmenbezeichnung im CLUSter vorkommt .--> Frontoffice
|
||||
End If
|
||||
|
||||
@@ -8,6 +8,7 @@ Public Class MyTextBox
|
||||
Implements INotifyPropertyChanged
|
||||
Property _numbersOnly As Boolean = False
|
||||
Property _numbersOnlyKommastellen As String = ""
|
||||
Property _numbersOnlyTrennzeichen As Boolean = True
|
||||
Property _ShortDateOnly As Boolean = False ' nicht mehr public , da fehler
|
||||
Property _ShortDateNew As Boolean = False
|
||||
Property _DateTimeOnly As Boolean = False
|
||||
@@ -294,7 +295,9 @@ Public Class MyTextBox
|
||||
sender.text = sender.text.ToString.Replace(" ", "").Replace(Chr(160), "") ' 160: irgend ein Sonder-Leerzeichen
|
||||
pruefungHandled = True
|
||||
Try
|
||||
If IsNumeric(_numbersOnlyKommastellen) And IsNumeric(sender.text) Then
|
||||
If Not _numbersOnlyTrennzeichen And IsNumeric(sender.text) Then
|
||||
Me._value = CInt(sender.text)
|
||||
ElseIf IsNumeric(_numbersOnlyKommastellen) And IsNumeric(sender.text) Then
|
||||
sender.text = CDbl(sender.text).ToString("N" & _numbersOnlyKommastellen) ' , CultureInfo.InvariantCulture)
|
||||
Me._value = CDbl(sender.text)
|
||||
' Else
|
||||
@@ -582,7 +585,10 @@ Public Class MyTextBox
|
||||
End If
|
||||
ElseIf _numbersOnly Then
|
||||
|
||||
If IsNumeric(Me._numbersOnlyKommastellen) And IsNumeric(v) Then
|
||||
If Not _numbersOnlyTrennzeichen And IsNumeric(v) Then
|
||||
Propvalue = CInt(v)
|
||||
Me.Text = v
|
||||
ElseIf IsNumeric(Me._numbersOnlyKommastellen) And IsNumeric(v) Then
|
||||
Propvalue = CDbl(v)
|
||||
Me.Text = CDbl(v).ToString("N" & Me._numbersOnlyKommastellen) ' , CultureInfo.InvariantCulture)
|
||||
ElseIf IsNumeric(v) Then
|
||||
@@ -623,7 +629,9 @@ Public Class MyTextBox
|
||||
If _numbersOnly Then
|
||||
Try
|
||||
'String.Format("{0:N2}", CDbl(sender.text))
|
||||
If IsNumeric(_numbersOnlyKommastellen) And IsNumeric(sender.text) Then
|
||||
If Not _numbersOnlyTrennzeichen And IsNumeric(sender.text) Then
|
||||
sender.text = CInt(sender.text)
|
||||
ElseIf IsNumeric(_numbersOnlyKommastellen) And IsNumeric(sender.text) Then
|
||||
sender.text = CDbl(sender.text).ToString("N" & _numbersOnlyKommastellen) ' , CultureInfo.InvariantCulture)
|
||||
Else
|
||||
sender.text = CDbl(sender.text)
|
||||
|
||||
Reference in New Issue
Block a user