neu
This commit is contained in:
@@ -17,8 +17,8 @@ Public Class usrctStatistik
|
||||
cboArt.SelectedIndex = 0
|
||||
End Sub
|
||||
|
||||
Private Sub Panel1_Paint(sender As Object, e As PaintEventArgs) Handles Panel1.Paint
|
||||
Dim g As Graphics = e.Graphics
|
||||
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
|
||||
Dim g As Graphics = Panel1.CreateGraphics
|
||||
g.Clear(Color.FromArgb(245, 245, 245))
|
||||
Dim p As Panel = DirectCast(sender, Panel)
|
||||
'Jahre:
|
||||
@@ -81,11 +81,11 @@ Public Class usrctStatistik
|
||||
Next
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Sub changeYear(sender As Object, e As EventArgs)
|
||||
year = CInt(DirectCast(sender, Button).Text)
|
||||
Panel1_Paint(Panel1, New PaintEventArgs(Panel1.CreateGraphics, Panel1.ClientRectangle))
|
||||
' Panel1_Paint(Panel1, New PaintEventArgs(Panel1.CreateGraphics, Panel1.ClientRectangle))
|
||||
End Sub
|
||||
Function CoordRectangle(w As Integer, h As Integer, x0 As Integer, y0 As Integer, x As Integer, y As Integer) As Rectangle
|
||||
' MsgBox(" x0: " & x0 & " y0: " & CStr(h - y0 - y) & " x: " & x & " y: " & y)
|
||||
@@ -96,12 +96,12 @@ Public Class usrctStatistik
|
||||
End Function
|
||||
|
||||
Private Sub txtAuswJahrDauer_TextChanged(sender As Object, e As EventArgs)
|
||||
Panel1_Paint(Panel1, New PaintEventArgs(Panel1.CreateGraphics, Panel1.ClientRectangle))
|
||||
' Panel1_Paint(Panel1, New PaintEventArgs(Panel1.CreateGraphics, Panel1.ClientRectangle))
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Private Sub AuswertungWoToag(sender As Object, e As EventArgs) Handles Button11.Click, cboTag.SelectedIndexChanged
|
||||
Private Sub AuswertungWoToag(sender As Object, e As EventArgs) Handles Button11.Click ', cboTag.SelectedIndexChanged
|
||||
Dim s(17, 2) As String
|
||||
Dim t As String = Button11.Text
|
||||
Dim datVon As Date = CDate(txtdatVon.Value)
|
||||
@@ -115,6 +115,7 @@ Public Class usrctStatistik
|
||||
Dim art = ""
|
||||
If cboArt.SelectedIndex = 0 Then art = "Ankunft"
|
||||
If cboArt.SelectedIndex = 1 Then art = "Freigabe"
|
||||
If cboArt.SelectedIndex = 2 Then art = "AvisoEingang"
|
||||
|
||||
For i = 6 To 22
|
||||
Dim cnt As Integer = 0
|
||||
@@ -194,47 +195,91 @@ Public Class usrctStatistik
|
||||
|
||||
|
||||
Private Sub AuswertungWoToag2(sender As Object, e As EventArgs) Handles Button5.Click ', cboTag.SelectedIndexChanged
|
||||
Exit Sub
|
||||
Dim s(17, 2) As String
|
||||
'Exit Sub
|
||||
Dim s(7, 2) As String
|
||||
Dim s_Weekdays() As String = {"SO", "MO", "DI", "MI", "DO", "FR", "SA"}
|
||||
Dim t As String = Button5.Text
|
||||
Dim datVon As Date = CDate(txtdatVon.Value)
|
||||
Dim datBis As Date = CDate(txtdatBis.Value)
|
||||
Dim datVon As Date = CDate(DateTimePicker1.Value)
|
||||
Dim datBis As Date = CDate(DateTimePicker2.Value)
|
||||
|
||||
Dim TESTgesLKWs = 0
|
||||
Dim TESTgesLKWs2 = 0
|
||||
Dim SQLstat As New StatDB
|
||||
Dim c As Integer = 0
|
||||
' Dim c As Integer = 0
|
||||
|
||||
Dim art = ""
|
||||
If cboArt.SelectedIndex = 0 Then art = "Ankunft"
|
||||
If cboArt.SelectedIndex = 1 Then art = "Freigabe"
|
||||
If cboArt.SelectedIndex = 1 Then art = "Erfasst" 'asdasdasd
|
||||
|
||||
For i = 0 To 6
|
||||
If ComboBox1.SelectedIndex = 0 Then art = "Ankunft"
|
||||
If ComboBox1.SelectedIndex = 1 Then art = "Freigabe"
|
||||
'If ComboBox1.SelectedIndex = 2 Then art = "Erfasst" 'asdasdasd
|
||||
If ComboBox1.SelectedIndex = 2 Then art = "AvisoEingang" 'asdasdasd
|
||||
For i = 1 To 7
|
||||
Dim c = CInt(i.ToString.Replace("7", "0")) 'Sonntag
|
||||
|
||||
Dim cnt As Integer = 0
|
||||
Dim gesLKWs As Integer = 0
|
||||
|
||||
Dim datTmp As Date = datVon
|
||||
While datTmp <= datBis
|
||||
If datTmp.DayOfWeek = cboTag.SelectedIndex Then
|
||||
gesLKWs += SQLstat.getAnzahlLkwAnkunft(art, datTmp, i, cboFirma2.Text)
|
||||
If datTmp.DayOfWeek = i Then
|
||||
gesLKWs += SQLstat.getAnzahlLkwAnkunft(art, datTmp, cboFirma2.Text)
|
||||
cnt += 1
|
||||
End If
|
||||
datTmp = datTmp.AddDays(1)
|
||||
End While
|
||||
|
||||
s(c, 0) = i & ":00"
|
||||
s((i - 1), 0) = s_Weekdays(c)
|
||||
|
||||
If gesLKWs > 0 And cnt > 0 Then
|
||||
s(c, 1) = CStr(CInt(gesLKWs / cnt))
|
||||
s((i - 1), 1) = CStr(CInt(gesLKWs / cnt))
|
||||
Else
|
||||
s(c, 1) = CStr(0)
|
||||
s((i - 1), 1) = CStr(0)
|
||||
End If
|
||||
c += 1
|
||||
' c += 1
|
||||
Next
|
||||
StatAuswertungWoToag(s)
|
||||
StatAuswertungWo(s)
|
||||
Button5.Text = t
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
Private Sub StatAuswertungWo(s(,) As String) 'Handles Panel1.Paint
|
||||
Dim g As Graphics = Panel8.CreateGraphics
|
||||
g.Clear(Color.FromArgb(245, 245, 245))
|
||||
Dim p As Panel = Panel8
|
||||
'Jahre:
|
||||
Dim topbound = 10
|
||||
|
||||
|
||||
|
||||
|
||||
Dim y0 As Integer = 0
|
||||
Dim x0 As Integer = 0
|
||||
Dim yMax As Integer = p.Height - 50
|
||||
Dim xMax As Integer = p.Width
|
||||
|
||||
Dim h As Integer = p.Height
|
||||
Dim w As Integer = p.Width
|
||||
|
||||
|
||||
|
||||
' MsgBox(s(i, 0) & " - " & s(i, 1))
|
||||
|
||||
Dim sMax As Long = getMax(s)
|
||||
|
||||
Dim xLeftBound As Integer = 0
|
||||
For i = 0 To s.GetUpperBound(0) - 1
|
||||
Dim hoehe = 0
|
||||
If sMax > 0 Then hoehe = CInt(yMax * (CLng(s(i, 1)) * 100 / sMax) / 100)
|
||||
' MsgBox(hoehe)
|
||||
' g.FillRectangle(Brushes.Red, New Rectangle(x0 + xLeftBound, y0, 20, hoehe))
|
||||
g.FillRectangle(Brushes.Red, CoordRectangle(w, h, x0 + xLeftBound, y0 + 20, 20, hoehe))
|
||||
g.DrawString(CInt(s(i, 1)).ToString, p.Font, Brushes.Black, CoordPoint(h, x0 + xLeftBound, 20 + hoehe + 15))
|
||||
g.DrawString(CStr(s(i, 0)).ToString, p.Font, Brushes.Black, CoordPoint(h, x0 + xLeftBound, 15))
|
||||
xLeftBound += 60
|
||||
Next
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub Button12_Click(sender As Object, e As EventArgs) Handles Button12.Click
|
||||
|
||||
Dim i As Image = cProgramFunctions.TakeScreenShot(Panel5)
|
||||
@@ -259,4 +304,7 @@ Public Class usrctStatistik
|
||||
i.Save(s, Drawing.Imaging.ImageFormat.Png)
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user