neu
This commit is contained in:
@@ -41,6 +41,9 @@ Public Class frmAnzeige
|
||||
Private Font6 As New Font(FontFamily.GenericSansSerif, 30, FontStyle.Bold)
|
||||
Private Font7 As New Font(FontFamily.GenericSansSerif, 30, FontStyle.Bold)
|
||||
|
||||
|
||||
Private Font_LkwOK_LKWNr As New Font(FontFamily.GenericSansSerif, 30, FontStyle.Bold)
|
||||
|
||||
Dim GridBackgroundColor As Color = Color.FromArgb(240, 245, 255)
|
||||
Dim TESTSYSTEM As Boolean = False
|
||||
Private isloaded As Boolean = False
|
||||
@@ -197,6 +200,42 @@ Public Class frmAnzeige
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Function getSQL(ByRef where As String, seiten As Boolean, onlyOK As Boolean) As String
|
||||
Dim buero As String = ""
|
||||
If StandortATILLA Then
|
||||
buero = " , Buero "
|
||||
End If
|
||||
Dim stat_tmp As String = cGlobal.Status_Ankunft.ToString
|
||||
Dim ank_tmp As String = ""
|
||||
If seiten Then ank_tmp = " And Ankunft > " & SQLDatumZeitSekunden(Merk_Ankunftsdatum)
|
||||
If onlyOK Then ank_tmp = " And LKW_fertig = 1 "
|
||||
|
||||
If False Then 'alle Staten
|
||||
stat_tmp = "3,99,4,5,0"
|
||||
ank_tmp = ""
|
||||
End If
|
||||
|
||||
where = " WHERE "
|
||||
Dim hSQL As String = "SELECT AvisoID, Status, UPPER(LKW_Nr) as LKW_Nr, Ankunft, Dauer, letzterMitarbeiter, LKW_fertig " & buero & " , AvisoTVHinweis, ImEx FROM Aviso "
|
||||
where &= " Status IN( " & stat_tmp & ") "
|
||||
If CLUSTER <> "" Then
|
||||
where &= " AND (Firma= '" & VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA & "' OR Cluster= '" & CLUSTER & "') "
|
||||
ElseIf Standort <> "WAI" And Standort <> "ABG" And Standort <> "NKD" Then
|
||||
where &= " AND Firma= '" & VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA & "' "
|
||||
End If
|
||||
|
||||
If Standort <> "" Then where &= " AND Grenzstelle = '" & Standort.Replace("IMEX", "SUB").Replace("UNISPED", "SUB").Replace("FRONTOFFICE", "SUB") & "'" 'nur die IMEX-LKW in SUB anzeigen
|
||||
If Standort = "FRONTOFFICE" Then where &= " AND isnull(ImEx,'IMPORT') IN ('IMPORT','') "
|
||||
hSQL &= where
|
||||
hSQL += ank_tmp & " ORDER BY CASE " &
|
||||
" when [Status] =3 then 1 " &
|
||||
" when [Status] =99 then 2 " &
|
||||
" when [Status] =4 then 3 " &
|
||||
" when [Status] =5 then 4 " &
|
||||
" when [Status] =0 then 4 " &
|
||||
" END , Ankunft"
|
||||
Return hSQL
|
||||
End Function
|
||||
|
||||
Dim contrnamecnt As Integer = 0
|
||||
Public Sub Listen_ermitteln()
|
||||
@@ -226,38 +265,11 @@ Public Class frmAnzeige
|
||||
Merk_Ankunftsdatum = LeerDatum 'falls letzte Seite angezeigt, dann wieder von vorne anfangen
|
||||
Aktive_Seite = 1
|
||||
End If
|
||||
Dim buero As String = ""
|
||||
If StandortATILLA Then
|
||||
buero = " , Buero "
|
||||
End If
|
||||
Dim stat_tmp As String = cGlobal.Status_Ankunft.ToString
|
||||
Dim ank_tmp As String = " AND Ankunft > " & SQLDatumZeitSekunden(Merk_Ankunftsdatum)
|
||||
Dim where As String = ""
|
||||
|
||||
If False Then 'alle Staten
|
||||
stat_tmp = "3,99,4,5,0"
|
||||
ank_tmp = ""
|
||||
End If
|
||||
Dim hSQL = getSQL(where, True, False)
|
||||
|
||||
Dim where As String = " WHERE "
|
||||
Dim hSQL As String = "SELECT AvisoID, Status, UPPER(LKW_Nr) as LKW_Nr, Ankunft, Dauer, letzterMitarbeiter, LKW_fertig " & buero & " , AvisoTVHinweis, ImEx FROM Aviso "
|
||||
where &= " Status IN( " & stat_tmp & ") "
|
||||
If CLUSTER <> "" Then
|
||||
where &= " AND (Firma= '" & VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA & "' OR Cluster= '" & CLUSTER & "') "
|
||||
ElseIf Standort <> "WAI" And Standort <> "ABG" And Standort <> "NKD" Then
|
||||
where &= " AND Firma= '" & VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA & "' "
|
||||
End If
|
||||
|
||||
If Standort <> "" Then where &= " AND Grenzstelle = '" & Standort.Replace("IMEX", "SUB").Replace("UNISPED", "SUB").Replace("FRONTOFFICE", "SUB") & "'" 'nur die IMEX-LKW in SUB anzeigen
|
||||
If Standort = "FRONTOFFICE" Then where &= " AND isnull(ImEx,'IMPORT') IN ('IMPORT','') "
|
||||
hSQL &= where
|
||||
hSQL += ank_tmp & " ORDER BY CASE " &
|
||||
" when [Status] =3 then 1 " &
|
||||
" when [Status] =99 then 2 " &
|
||||
" when [Status] =4 then 3 " &
|
||||
" when [Status] =5 then 4 " &
|
||||
" when [Status] =0 then 4 " &
|
||||
" END , Ankunft"
|
||||
' MsgBox(hSQL)
|
||||
'Anzahl der Aviso mit Status Ankunft ermitteln
|
||||
Dim CheckAnzahl As String = "SELECT AvisoID FROM Aviso " & where 'WHERE Status IN( " & stat_tmp & ") "
|
||||
' If Standort <> "" Then CheckAnzahl += " AND Grenzstelle = '" & Standort.Replace("IMEX", "SUB") & "'"
|
||||
@@ -293,7 +305,7 @@ Public Class frmAnzeige
|
||||
Dim hMitarbeiter As String = VarToStr(dr.Item("LetzterMitarbeiter"))
|
||||
Dim ImEx As String = VarToStr(dr.Item("ImEx"))
|
||||
|
||||
If StandortATILLA Or Standort = "IMEX" Then
|
||||
If StandortATILLA Or Standort = "IMEX" Or Standort = "FRONTOFFICE" Then
|
||||
'bei Mitarbeiter nur User aus letzter Bearbeiter rausfiltern
|
||||
Dim x As String = ""
|
||||
Dim n As Integer = 0
|
||||
@@ -381,9 +393,24 @@ Public Class frmAnzeige
|
||||
End If
|
||||
dr.Close()
|
||||
End Using
|
||||
|
||||
'gridFertig:
|
||||
Using cmd As New SqlCommand(getSQL("", False, True), conn)
|
||||
Dim dr = cmd.ExecuteReader()
|
||||
If Not IsNothing(dr) Then
|
||||
gridFertig.Rows.Clear() 'Ansicht löschen
|
||||
|
||||
While dr.Read()
|
||||
anz += 1
|
||||
Dim LKW_Nr As String = VarToStr(dr.Item("LKW_Nr"))
|
||||
gridFertig.Rows.Add(My.Resources.okRound, LKW_Nr)
|
||||
|
||||
End While
|
||||
End If
|
||||
dr.Close()
|
||||
End Using
|
||||
Catch ex As Exception
|
||||
MsgBox("ERR: " & ex.Message)
|
||||
MsgBox("ERR: " & ex.StackTrace)
|
||||
MsgBox("ERR: " & ex.Message & ex.StackTrace)
|
||||
End Try
|
||||
|
||||
'Ermitteln
|
||||
@@ -520,6 +547,9 @@ Public Class frmAnzeige
|
||||
' picVERAG.Image = My.Resources.Verag_AG_Logopng
|
||||
'End If
|
||||
|
||||
gridFertig.Visible = cbxGridLKWOK.Checked
|
||||
|
||||
|
||||
If txtBreite.Text <> "" Then
|
||||
If VarToInt(txtBreite.Text) < 800 Then
|
||||
MsgBox("Breite ist zu klein - mind. 800")
|
||||
@@ -574,6 +604,16 @@ Public Class frmAnzeige
|
||||
Font3 = New Font(FontFamily.GenericSansSerif, VarToInt(txtSchrift3.Text), FontStyle.Bold)
|
||||
End If
|
||||
|
||||
If txtLkwOK_LKWNrSchrift.Text <> "" Then
|
||||
If VarToInt(txtLkwOK_LKWNrSchrift.Text) < 10 Then
|
||||
MsgBox("txtLkwOK_LKWNrSchrift ist zu klein - mind. 10")
|
||||
txtLkwOK_LKWNrSchrift.Focus()
|
||||
Exit Sub
|
||||
End If
|
||||
Font_LkwOK_LKWNr = New Font(FontFamily.GenericSansSerif, VarToInt(txtLkwOK_LKWNrSchrift.Text), FontStyle.Bold)
|
||||
End If
|
||||
|
||||
|
||||
If txtSekunden.Text <> "" Then
|
||||
If VarToInt(txtSekunden.Text) < 10 Then
|
||||
MsgBox("Resfresh unter 10 Sekunden ist nicht erlaubt.")
|
||||
@@ -593,6 +633,9 @@ Public Class frmAnzeige
|
||||
gridAnkunft.Columns(3).DefaultCellStyle.Font = Font4
|
||||
gridAnkunft.Columns(4).DefaultCellStyle.Font = Font5
|
||||
|
||||
gridFertig.Columns(1).DefaultCellStyle.Font = Font_LkwOK_LKWNr
|
||||
|
||||
|
||||
If StandortATILLA And gridAnkunft.Columns("clmnBuero") IsNot Nothing Then
|
||||
gridAnkunft.Columns("clmnBuero").Width = CInt(IIf(IsNumeric(txtBreite6.Text), txtBreite6.Text, 50))
|
||||
gridAnkunft.Columns("clmnBuero").DefaultCellStyle.Font = Font6
|
||||
@@ -613,6 +656,9 @@ Public Class frmAnzeige
|
||||
If txtBreite4.Text <> "" Then gridAnkunft.Columns(3).Width = CInt(txtBreite4.Text)
|
||||
gridAnkunft.Columns(4).AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
|
||||
|
||||
If txtLkwOK_BildBreite.Text <> "" Then gridFertig.Columns(0).Width = CInt(txtLkwOK_BildBreite.Text)
|
||||
|
||||
If txtBreiteGridLKWOK.Text <> "" Then gridFertig.Width = CInt(txtBreiteGridLKWOK.Text)
|
||||
|
||||
'gridAnkunft.Columns(4).Width = Me.Width - gridAnkunft.Columns(0).Width - gridAnkunft.Columns(1).Width - gridAnkunft.Columns(2).Width - gridAnkunft.Columns(3).Width - 20
|
||||
'txtBreite5.Text = gridAnkunft.Columns(4).Width.ToString
|
||||
@@ -660,6 +706,10 @@ Public Class frmAnzeige
|
||||
Dim p As String = getProperty(DirectCast(c, TextBox).Name)
|
||||
If p <> "" Then DirectCast(c, TextBox).Text = p
|
||||
End If
|
||||
If c.GetType.Name = "CheckBox" Then
|
||||
Dim p As String = getProperty(DirectCast(c, CheckBox).Name)
|
||||
If p <> "" Then DirectCast(c, CheckBox).Checked = CBool(p)
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
@@ -685,6 +735,13 @@ Public Class frmAnzeige
|
||||
|
||||
If txtSekunden.Text <> "" Then setProperty("txtSekunden", txtSekunden.Text)
|
||||
|
||||
|
||||
If txtLkwOK_LKWNrSchrift.Text <> "" Then setProperty("txtLkwOK_LKWNrSchrift", txtLkwOK_LKWNrSchrift.Text)
|
||||
If txtLkwOK_BildBreite.Text <> "" Then setProperty("txtLkwOK_BildBreite", txtLkwOK_BildBreite.Text)
|
||||
If txtBreiteGridLKWOK.Text <> "" Then setProperty("txtBreiteGridLKWOK", txtBreiteGridLKWOK.Text)
|
||||
|
||||
setProperty("cbxGridLKWOK", CInt(cbxGridLKWOK.Checked).ToString)
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -724,7 +781,8 @@ Public Class frmAnzeige
|
||||
|
||||
Private Sub txtBreite1_KeyUp(sender As Object, e As KeyEventArgs) Handles txtSchrift1_MESS.KeyUp, txtSekunden.KeyUp,
|
||||
txtSchrift1.KeyUp, txtSchrift2.KeyUp, txtSchrift3.KeyUp, txtSchrift4.KeyUp, txtSchrift5.KeyUp, txtSchrift6.KeyUp, txtSchrift7.KeyUp,
|
||||
txtBreite1.KeyUp, txtBreite2.KeyUp, txtBreite3.KeyUp, txtBreite4.KeyUp, txtBreite5.KeyUp, txtBreite6.KeyUp, txtBreite7.KeyUp
|
||||
txtBreite1.KeyUp, txtBreite2.KeyUp, txtBreite3.KeyUp, txtBreite4.KeyUp, txtBreite5.KeyUp, txtBreite6.KeyUp, txtBreite7.KeyUp,
|
||||
txtLkwOK_BildBreite.KeyUp, txtLkwOK_LKWNrSchrift.KeyUp, txtBreiteGridLKWOK.KeyUp
|
||||
|
||||
If e.KeyCode = Keys.Return Then
|
||||
btnTestAnzeige.PerformClick()
|
||||
@@ -750,6 +808,10 @@ Public Class frmAnzeige
|
||||
End If
|
||||
secondmonitorSelected = Not secondmonitorSelected
|
||||
End Sub
|
||||
|
||||
Private Sub gridFertig_SelectionChanged(sender As Object, e As EventArgs) Handles gridFertig.SelectionChanged
|
||||
gridFertig.ClearSelection()
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user