Feature_Gesamtsicherheiten
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
Imports System.Reflection
|
||||
Imports System.Web.UI.WebControls
|
||||
Imports System.Web.UI.WebControls.Expressions
|
||||
Imports DocumentFormat.OpenXml.Bibliography
|
||||
Imports DocumentFormat.OpenXml.Presentation
|
||||
@@ -99,7 +100,7 @@ Public Class frmGesamtsicherheitenNEU
|
||||
|
||||
'Dim addtosqlstring As String = ""
|
||||
|
||||
Dim SQLStringSicherheit As String = "select [gs_gsId], [gs_gsnr], [gs_ATBNr], [gs_posNr], [gs_datum], [gs_warenwert], [gs_sicherheitsbetrag], [gs_saldo] " & sqladd1 & " , [gs_freitext] from [tblGesamtsicherheit] where [gs_gsnr] = '" & gessicherheitID & "'" & sqlSearchSting & "order by [gs_gsId]"
|
||||
Dim SQLStringSicherheit As String = "select [gs_gsId], [gs_gsnr], [gs_posNr], [gs_ATBNr], [gs_datum], [gs_warenwert], [gs_sicherheitsbetrag], [gs_saldo] " & sqladd1 & " , [gs_freitext] from [tblGesamtsicherheit] where [gs_gsnr] = '" & gessicherheitID & "'" & sqlSearchSting & "order by [gs_gsId]"
|
||||
|
||||
dgvGesamtsicherheit.SET_SQL(SQLStringSicherheit, "AVISO", ,)
|
||||
dgvGesamtsicherheit.LOAD()
|
||||
@@ -108,8 +109,8 @@ Public Class frmGesamtsicherheitenNEU
|
||||
If dgvGesamtsicherheit.Columns.Count > 0 Then
|
||||
With dgvGesamtsicherheit
|
||||
.RowHeadersWidth = 10
|
||||
.Columns("gs_gsId").Visible = True
|
||||
.Columns("gs_gsnr").Visible = True
|
||||
.Columns("gs_gsId").Visible = False
|
||||
.Columns("gs_gsnr").Visible = False
|
||||
.Columns("gs_warenwert").DefaultCellStyle.Format = "c"
|
||||
.Columns("gs_sicherheitsbetrag").DefaultCellStyle.Format = "c"
|
||||
.Columns("gs_saldo").DefaultCellStyle.Format = "c"
|
||||
@@ -118,24 +119,33 @@ Public Class frmGesamtsicherheitenNEU
|
||||
Case True
|
||||
.Columns("gs_ATBNr").HeaderText = "ATB"
|
||||
.Columns("gs_atr").HeaderText = "MRN"
|
||||
.Columns("gs_atr").Visible = True
|
||||
.Columns("gs_atr").Width = 33
|
||||
.Columns("gs_ust").Width = 69
|
||||
.Columns("gs_ust").HeaderText = "Ust"
|
||||
Case Else
|
||||
.Columns("gs_ATBNr").HeaderText = "ATB"
|
||||
End Select
|
||||
.Columns("gs_ATBNr").Width = 146
|
||||
|
||||
.Columns("gs_posNr").Width = 20
|
||||
.Columns("gs_posNr").Width = 35
|
||||
.Columns("gs_posNr").HeaderText = "Pos#"
|
||||
.Columns("gs_datum").Width = 95
|
||||
.Columns("gs_datum").HeaderText = "Datum"
|
||||
.Columns("gs_warenwert").Width = 100
|
||||
.Columns("gs_warenwert").HeaderText = "Warenwert"
|
||||
.Columns("gs_saldo").Width = 100
|
||||
.Columns("gs_saldo").HeaderText = "Saldo"
|
||||
|
||||
.Columns("gs_sicherheitsbetrag").Width = 100
|
||||
.Columns("gs_sicherheitsbetrag").Width = 85
|
||||
.Columns("gs_sicherheitsbetrag").HeaderText = "S-Betrag"
|
||||
.Columns("gs_freitext").AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
|
||||
End With
|
||||
|
||||
End If
|
||||
|
||||
calcGesamtsummen()
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
@@ -178,7 +188,10 @@ Public Class frmGesamtsicherheitenNEU
|
||||
If dgvSicherheitsPos.Columns.Count > 0 Then
|
||||
With dgvSicherheitsPos
|
||||
.RowHeadersWidth = 10
|
||||
.Columns("gsp_gsId").Visible = True
|
||||
.Columns("gsp_gspPosId").Width = 35
|
||||
.Columns("gsp_gspPosId").HeaderText = "Pos#"
|
||||
.Columns("gsp_gsId").Visible = False
|
||||
.Columns("gsp_gsnr").Visible = False
|
||||
.Columns("gsp_warenwert").DefaultCellStyle.Format = "c"
|
||||
.Columns("gsp_sicherheitsbetrag").DefaultCellStyle.Format = "c"
|
||||
'.Columns("gs_saldo").DefaultCellStyle.Format = "c"
|
||||
@@ -187,13 +200,17 @@ Public Class frmGesamtsicherheitenNEU
|
||||
Case True
|
||||
.Columns("gsp_ATCNr").HeaderText = "ATC / MRN"
|
||||
Case Else
|
||||
.Columns("gsp_ATCNr").HeaderText = "CRN"
|
||||
.Columns("gsp_ATCNr").HeaderText = "CRN / MRN"
|
||||
End Select
|
||||
.Columns("gsp_ATCNr").Width = 120
|
||||
.Columns("gsp_erstellungsdatum").Width = 140
|
||||
.Columns("gsp_erstellungsdatum").Width = 100
|
||||
.Columns("gsp_erstellungsdatum").HeaderText = "Datum"
|
||||
.Columns("gsp_warenwert").Width = 100
|
||||
.Columns("gsp_sicherheitsbetrag").Width = 100
|
||||
.Columns("gsp_freitext").Width = 220
|
||||
.Columns("gsp_warenwert").HeaderText = "Warenwert"
|
||||
.Columns("gsp_sicherheitsbetrag").Width = 85
|
||||
.Columns("gsp_sicherheitsbetrag").HeaderText = "S-Betrag"
|
||||
.Columns("gsp_freitext").Width = 110
|
||||
.Columns("gsp_freitext").HeaderText = "Freitext"
|
||||
End With
|
||||
|
||||
End If
|
||||
@@ -288,18 +305,6 @@ Public Class frmGesamtsicherheitenNEU
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub btnSaveOben_Click(sender As Object, e As EventArgs) Handles btnSaveOben.Click
|
||||
Try
|
||||
Dim a As Date = Date.ParseExact(txtSicherheitDate.Text, "dd.MM.yyyy", System.Globalization.DateTimeFormatInfo.InvariantInfo)
|
||||
Dim b As Date = Date.ParseExact(txtSicherheitTime.Text, "HH:mm", System.Globalization.DateTimeFormatInfo.InvariantInfo)
|
||||
|
||||
Dim ab As Date = a.AddHours(b.Hour).AddMinutes(b.Minute)
|
||||
MsgBox(ab.ToString)
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub txtMRNDate_GotFocus(sender As Object, e As EventArgs) Handles txtSicherheitDate.GotFocus, txtPosDate.GotFocus, txtSicherheitTime.GotFocus, txtPosTime.GotFocus
|
||||
Select Case sender.name
|
||||
Case "txtSicherheitDate"
|
||||
@@ -865,8 +870,8 @@ Public Class frmGesamtsicherheitenNEU
|
||||
|
||||
lbloffenerSaldo.Text = "offener S-Saldo: "
|
||||
Dim offernerSB As Double = Me.calcOffenerSicherheitsbetrag()
|
||||
If offernerSB > 0 Then
|
||||
lbloffenerSaldo.Text &= Me.calcOffenerSicherheitsbetrag().ToString
|
||||
If offernerSB <> 0 Then
|
||||
lbloffenerSaldo.Text &= Math.Round(calcOffenerSicherheitsbetrag(), 2).ToString
|
||||
isOpen = True
|
||||
Else
|
||||
lbloffenerSaldo.Text &= "0"
|
||||
@@ -874,9 +879,6 @@ Public Class frmGesamtsicherheitenNEU
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub rearangePosNr()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Function setPrevAndNextGesIDAllOpen()
|
||||
|
||||
@@ -894,13 +896,20 @@ Public Class frmGesamtsicherheitenNEU
|
||||
prevGessicherheitID = -1 ' no prev Sicherheit
|
||||
Else
|
||||
prevGessicherheitID = onlyOpenDT.Rows(i - 1).Item("gs_gsnr")
|
||||
|
||||
End If
|
||||
|
||||
'MsgBox("prevOPENGessicherheitID " & prevGessicherheitID)
|
||||
|
||||
If i = onlyOpenDT.Rows.Count - 1 Then
|
||||
nextGessicherheitID = -1 ' no next Sicherheit
|
||||
Else
|
||||
nextGessicherheitID = onlyOpenDT.Rows(i + 1).Item("gs_gsnr")
|
||||
|
||||
End If
|
||||
|
||||
'MsgBox("nextOPENGessicherheitID " & nextGessicherheitID)
|
||||
|
||||
End If
|
||||
|
||||
Next
|
||||
@@ -917,6 +926,7 @@ Public Class frmGesamtsicherheitenNEU
|
||||
For j As Integer = i To 0
|
||||
If dt.Rows(j).Item("gs_isOpen") Then
|
||||
prevGessicherheitID = dt.Rows(j).Item("gs_gsnr")
|
||||
'MsgBox("prevGessicherheitID " & prevGessicherheitID)
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
@@ -929,6 +939,7 @@ Public Class frmGesamtsicherheitenNEU
|
||||
For k As Integer = i To dt.Rows.Count - 1
|
||||
If dt.Rows(k).Item("gs_isOpen") Then
|
||||
nextGessicherheitID = dt.Rows(k).Item("gs_gsnr")
|
||||
'MsgBox("nextGessicherheitID " & nextGessicherheitID)
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
@@ -948,11 +959,16 @@ Public Class frmGesamtsicherheitenNEU
|
||||
For i As Integer = 0 To dt.Rows.Count - 1
|
||||
If dt.Rows(i).Item("gs_gsnr") = Me.gessicherheitID Then
|
||||
|
||||
prevGessicherheitID = i - 1
|
||||
nextGessicherheitID = i + 1
|
||||
prevGessicherheitID = dt.Rows(i).Item("gs_gsnr") - 1
|
||||
|
||||
nextGessicherheitID = dt.Rows(i).Item("gs_gsnr") + 1
|
||||
|
||||
|
||||
If i = 0 Then prevGessicherheitID = -1 ' no prev Sicherheit
|
||||
If i = dt.Rows.Count - 1 Then nextGessicherheitID = -1 ' ' no next Sicherheit
|
||||
|
||||
'MsgBox("prevGessicherheitID " & prevGessicherheitID)
|
||||
'MsgBox("nextGessicherheitID " & nextGessicherheitID)
|
||||
Return i
|
||||
End If
|
||||
|
||||
@@ -999,14 +1015,14 @@ Public Class frmGesamtsicherheitenNEU
|
||||
|
||||
Private Sub initPrevNextButtons()
|
||||
If nextGessicherheitID = -1 Then
|
||||
btnNext.Enabled = False
|
||||
btnNext.Enabled = True
|
||||
Else
|
||||
btnNext.Enabled = True
|
||||
End If
|
||||
|
||||
|
||||
If prevGessicherheitID = -1 Then
|
||||
btnPrev.Enabled = False
|
||||
btnPrev.Enabled = True
|
||||
Else
|
||||
btnPrev.Enabled = True
|
||||
End If
|
||||
@@ -1026,8 +1042,57 @@ Public Class frmGesamtsicherheitenNEU
|
||||
|
||||
Private Sub txtZollsatzueberschreiben_TextChanged(sender As Object, e As EventArgs) Handles txtZollsatzueberschreiben.TextChanged
|
||||
lblZollsatz.Text = "Zollsatz: " & txtZollsatzueberschreiben.Text & "%"
|
||||
|
||||
Zollsatz = CDbl(setNullToZero(txtZollsatzueberschreiben.Text))
|
||||
ZollsatzMulti = CDbl(setNullToZero(txtZollsatzueberschreiben.Text)) / 100
|
||||
End Sub
|
||||
|
||||
Private Sub btnSaveDatetime_Click(sender As Object, e As EventArgs) Handles btnSaveDatetime.Click
|
||||
Try
|
||||
Dim a As Date = Date.ParseExact(txtSicherheitDate.Text, "dd.MM.yyyy", System.Globalization.DateTimeFormatInfo.InvariantInfo)
|
||||
Dim b As Date = Date.ParseExact(txtSicherheitTime.Text, "HH:mm", System.Globalization.DateTimeFormatInfo.InvariantInfo)
|
||||
|
||||
Dim ab As Date = a.AddHours(b.Hour).AddMinutes(b.Minute)
|
||||
MsgBox(ab.ToString)
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message)
|
||||
End Try
|
||||
End Sub
|
||||
Private Sub calcGesamtsummen()
|
||||
|
||||
txtAnzalPosGes.Text = DirectCast(dgvGesamtsicherheit.Rows.Count().ToString(), String)
|
||||
|
||||
txtPosAnzalPosGes.Text = DirectCast(dgvSicherheitsPos.Rows.Count().ToString(), String)
|
||||
|
||||
Dim countSicherheitsbetrag As Double = 0
|
||||
Dim countWarenwert As Double = 0
|
||||
|
||||
For i As Integer = 0 To dgvGesamtsicherheit.Rows.Count - 1
|
||||
countSicherheitsbetrag += CDbl(dgvGesamtsicherheit.Rows(i).Cells("gs_sicherheitsbetrag").Value)
|
||||
countWarenwert += CDbl(dgvGesamtsicherheit.Rows(i).Cells("gs_warenwert").Value)
|
||||
|
||||
|
||||
Next
|
||||
|
||||
txtSicherheitsbGes._value = countSicherheitsbetrag.ToString
|
||||
txtWarenwertGes._value = countWarenwert.ToString
|
||||
|
||||
Dim countSicherheitsbetragPos As Double = 0
|
||||
Dim countWarenwertPos As Double = 0
|
||||
|
||||
For i As Integer = 0 To dgvSicherheitsPos.Rows.Count - 1
|
||||
|
||||
countSicherheitsbetragPos += CDbl(dgvSicherheitsPos.Rows(i).Cells("gsp_sicherheitsbetrag").Value)
|
||||
countWarenwertPos += CDbl(dgvSicherheitsPos.Rows(i).Cells("gsp_warenwert").Value)
|
||||
|
||||
Next
|
||||
|
||||
txtPosSicherheitsbGes._value = countSicherheitsbetragPos.ToString
|
||||
txtPosWarenwertGes._value = countWarenwertPos.ToString
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
Reference in New Issue
Block a user