diff --git a/Aviso/frmGesamtsicherheitenMenuNEU.vb b/Aviso/frmGesamtsicherheitenMenuNEU.vb index 91775d5..a48b344 100644 --- a/Aviso/frmGesamtsicherheitenMenuNEU.vb +++ b/Aviso/frmGesamtsicherheitenMenuNEU.vb @@ -113,11 +113,13 @@ Public Class frmGesamtsicherheitenMenuNEU 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) - Else - dataTable.Rows.Add(row.Cells("gs_gsnr").Value, False) + dataTable.Rows.Add(row.Cells("gs_gsnr").Value, True) + Else + dataTable.Rows.Add(row.Cells("gs_gsnr").Value, False) + End If End If Next @@ -130,11 +132,12 @@ Public Class frmGesamtsicherheitenMenuNEU For Each row As DataGridViewRow In dgvListe.Rows - - If row.Cells("gs_SicherheitsSaldo").Value <> 0 Then - row.DefaultCellStyle.BackColor = Color.Red - Else - row.DefaultCellStyle.BackColor = Color.Green + If Not IsDBNull(row.Cells("gs_SicherheitsSaldo").Value) Then + If row.Cells("gs_SicherheitsSaldo").Value <> 0 Then + row.DefaultCellStyle.BackColor = Color.Red + Else + row.DefaultCellStyle.BackColor = Color.Green + End If End If Next diff --git a/Aviso/frmGesamtsicherheitenNEU.vb b/Aviso/frmGesamtsicherheitenNEU.vb index c9c8cd4..55c4e12 100644 --- a/Aviso/frmGesamtsicherheitenNEU.vb +++ b/Aviso/frmGesamtsicherheitenNEU.vb @@ -344,6 +344,8 @@ Public Class frmGesamtsicherheitenNEU 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 txtSicherheitWarenwert.ForeColor = Color.Red Exit Sub @@ -361,6 +363,11 @@ Public Class frmGesamtsicherheitenNEU End If + txtSicherheitWarenwert.Text = Replace(txtSicherheitWarenwert.Text, ".", "") + txtPosWarenwert.Text = Replace(txtPosWarenwert.Text, ".", "") + txtSicherheitWarenwert.Text = Replace(txtSicherheitWarenwert.Text, "€", "") + txtPosWarenwert.Text = Replace(txtPosWarenwert.Text, "€", "") + Try Select Case sender.name Case "txtSicherheitWarenwert" @@ -1332,4 +1339,15 @@ Public Class frmGesamtsicherheitenNEU dgvSicherheitsPos.Enabled = True 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