Fehlerhandling verbessert -> falsche von Nutzer eingegebene Werte werden in div. Spalten geprüft/entfernt.
This commit is contained in:
@@ -113,11 +113,13 @@ Public Class frmGesamtsicherheitenMenuNEU
|
|||||||
|
|
||||||
|
|
||||||
For Each row As DataGridViewRow In dgvListe.Rows
|
For Each row As DataGridViewRow In dgvListe.Rows
|
||||||
If row.Cells("gs_SicherheitsSaldo").Value <> 0 Then
|
If Not IsDBNull(row.Cells("gs_SicherheitsSaldo").Value) Then
|
||||||
|
If row.Cells("gs_SicherheitsSaldo").Value <> 0 Then
|
||||||
|
|
||||||
dataTable.Rows.Add(row.Cells("gs_gsnr").Value, True)
|
dataTable.Rows.Add(row.Cells("gs_gsnr").Value, True)
|
||||||
Else
|
Else
|
||||||
dataTable.Rows.Add(row.Cells("gs_gsnr").Value, False)
|
dataTable.Rows.Add(row.Cells("gs_gsnr").Value, False)
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
|
|
||||||
@@ -130,11 +132,12 @@ Public Class frmGesamtsicherheitenMenuNEU
|
|||||||
|
|
||||||
|
|
||||||
For Each row As DataGridViewRow In dgvListe.Rows
|
For Each row As DataGridViewRow In dgvListe.Rows
|
||||||
|
If Not IsDBNull(row.Cells("gs_SicherheitsSaldo").Value) Then
|
||||||
If row.Cells("gs_SicherheitsSaldo").Value <> 0 Then
|
If row.Cells("gs_SicherheitsSaldo").Value <> 0 Then
|
||||||
row.DefaultCellStyle.BackColor = Color.Red
|
row.DefaultCellStyle.BackColor = Color.Red
|
||||||
Else
|
Else
|
||||||
row.DefaultCellStyle.BackColor = Color.Green
|
row.DefaultCellStyle.BackColor = Color.Green
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
|
|
||||||
|
|||||||
@@ -344,6 +344,8 @@ Public Class frmGesamtsicherheitenNEU
|
|||||||
|
|
||||||
Private Sub Warenwert_TextChanged(sender As Object, e As EventArgs) Handles txtSicherheitWarenwert.TextChanged, txtPosWarenwert.TextChanged
|
Private Sub Warenwert_TextChanged(sender As Object, e As EventArgs) Handles txtSicherheitWarenwert.TextChanged, txtPosWarenwert.TextChanged
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
If Not IsNumeric(txtSicherheitWarenwert.Text) And sender.name = "txtSicherheitWarenwert" Then
|
If Not IsNumeric(txtSicherheitWarenwert.Text) And sender.name = "txtSicherheitWarenwert" Then
|
||||||
txtSicherheitWarenwert.ForeColor = Color.Red
|
txtSicherheitWarenwert.ForeColor = Color.Red
|
||||||
Exit Sub
|
Exit Sub
|
||||||
@@ -361,6 +363,11 @@ Public Class frmGesamtsicherheitenNEU
|
|||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
txtSicherheitWarenwert.Text = Replace(txtSicherheitWarenwert.Text, ".", "")
|
||||||
|
txtPosWarenwert.Text = Replace(txtPosWarenwert.Text, ".", "")
|
||||||
|
txtSicherheitWarenwert.Text = Replace(txtSicherheitWarenwert.Text, "€", "")
|
||||||
|
txtPosWarenwert.Text = Replace(txtPosWarenwert.Text, "€", "")
|
||||||
|
|
||||||
Try
|
Try
|
||||||
Select Case sender.name
|
Select Case sender.name
|
||||||
Case "txtSicherheitWarenwert"
|
Case "txtSicherheitWarenwert"
|
||||||
@@ -1332,4 +1339,15 @@ Public Class frmGesamtsicherheitenNEU
|
|||||||
dgvSicherheitsPos.Enabled = True
|
dgvSicherheitsPos.Enabled = True
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub txtAbfertNum_TextChanged(sender As Object, e As EventArgs) Handles txtAbfertNum.TextChanged
|
||||||
|
If Not IsNumeric(txtAbfertNum.Text) Then
|
||||||
|
txtAbfertNum.ForeColor = Color.Red
|
||||||
|
btnSave.Enabled = False
|
||||||
|
Exit Sub
|
||||||
|
Else
|
||||||
|
txtAbfertNum.ForeColor = Color.Black
|
||||||
|
btnSave.Enabled = True
|
||||||
|
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
Reference in New Issue
Block a user