Projektdateien hinzufügen.
This commit is contained in:
116
Aviso/frmEintragOptionen.vb
Normal file
116
Aviso/frmEintragOptionen.vb
Normal file
@@ -0,0 +1,116 @@
|
||||
Imports VERAG_PROG_ALLGEMEIN
|
||||
|
||||
Public Class frmEintragOptionen
|
||||
|
||||
Dim OptionenDAL As New cOptionenDAL
|
||||
Dim myOptionen As New cOption
|
||||
Dim hÄnderung As Boolean = False
|
||||
Dim Neuanlage As Boolean = False
|
||||
|
||||
|
||||
Public Sub New()
|
||||
InitializeComponent()
|
||||
Icon = cMeineFunktionenAVISO.GetProgrammIcon
|
||||
End Sub
|
||||
|
||||
Private Sub frmEintragOptionen_KeyDown(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
|
||||
'Escape händisch abfangen und auf Abbruch-Taste legen
|
||||
If e.KeyCode = Keys.Escape Then
|
||||
btnAbbruch.PerformClick()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub frmEintragOptionen_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
|
||||
Me.CenterToParent()
|
||||
|
||||
If cGlobal.Aktive_ID = 0 Then
|
||||
'es erfolgt eine Neuanlage
|
||||
Neuanlage = True
|
||||
Me.Text = "Neuanlage Optionen"
|
||||
Else
|
||||
Me.Text = "Änderung Optionen-Stammdaten"
|
||||
'ausgewählter Datensatz wird geladen
|
||||
myOptionen = OptionenDAL.LesenOptionen(cGlobal.Aktive_ID, "")
|
||||
|
||||
'Werte(zuweisen)
|
||||
txtAnkunft_Betreff.Text = myOptionen.eMail_Ankunft_Betreff
|
||||
txtAnkunft_Text.Text = myOptionen.eMail_Ankunft_Text
|
||||
txtFreigabe_Betreff.Text = myOptionen.eMail_Freigabe_Betreff
|
||||
txtFreigabe_Text.Text = myOptionen.eMail_Freigabe_Text
|
||||
End If
|
||||
|
||||
hÄnderung = False
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub btnAbbruch_Click(sender As System.Object, e As System.EventArgs) Handles btnAbbruch.Click
|
||||
'Irgendwas wurde geändert, deshalb ein Hinweis, ob auch wirklich abgebrochen werden soll
|
||||
'If hÄnderung Then
|
||||
' Dim antwort As MsgBoxResult = MsgBox("Wollen Sie wirklich abbrechen?" & vbCrLf & vbCrLf & "Alle Änderungen gehen dabei verloren.", CType(MsgBoxStyle.YesNo + MsgBoxStyle.Exclamation, MsgBoxStyle),
|
||||
' "Dateneingabe wird abgebrochen")
|
||||
' If antwort = vbNo Then
|
||||
' Exit Sub
|
||||
' End If
|
||||
'End If
|
||||
|
||||
Me.Close()
|
||||
End Sub
|
||||
|
||||
'Private Sub txtFeld_GotFocus(sender As Object, e As System.EventArgs) Handles txtAnkunft_Betreff.GotFocus, txtFreigabe_Betreff.GotFocus
|
||||
' CType(sender, TextBox).SelectAll()
|
||||
'End Sub
|
||||
|
||||
'Private Sub txtBilanzart_TextChanged(sender As System.Object, e As System.EventArgs) Handles txtBilanzart.TextChanged, txtBilanzart.TextChanged, txtAIS_Bilanzart.TextChanged, txtInfo.TextChanged, txtOptionen.TextChanged
|
||||
' hÄnderung = True 'es wurde etwas geändert
|
||||
'End Sub
|
||||
|
||||
'Private Sub txtOptionen_KeyPress(sender As Object, e As System.Windows.Forms.KeyPressEventArgs)
|
||||
' 'Es sind nur Zahleneingaben erlaubt
|
||||
' Dim asc As Integer = Convert.ToInt32(e.KeyChar)
|
||||
' Select Case asc
|
||||
' 'Folgende Tasten sind erlaubt
|
||||
' '8 = Rücktaste (Back)
|
||||
' '13 = Enter
|
||||
' '27 = Esc
|
||||
' '48 To 57 = 0 bis 9
|
||||
' Case 8, 13, 27, 48 To 57
|
||||
' Case Else
|
||||
' e.Handled = True
|
||||
' End Select
|
||||
'End Sub
|
||||
|
||||
Private Sub btnOK_Click(sender As System.Object, e As System.EventArgs) Handles btnOK.Click
|
||||
'Falls keine Änderung oder Neuanlage, dann kann Fenster geschlossen werden
|
||||
'If Not hÄnderung And myOptionen.OptionID > 0 Then Me.Close()
|
||||
|
||||
'Logische Prüfungen vor dem Speichern
|
||||
If txtAnkunft_Betreff.Text.Trim = "" Then
|
||||
MsgBox("Bitte den Betreff beim Ankunftsmail eingeben.", MsgBoxStyle.Exclamation)
|
||||
txtAnkunft_Betreff.Focus()
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If txtFreigabe_Betreff.Text.Trim = "" Then
|
||||
MsgBox("Bitte den Betreff beim Freigabemail eingeben.", MsgBoxStyle.Exclamation)
|
||||
txtFreigabe_Betreff.Focus()
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
'Änderungen werden gespeichert
|
||||
myOptionen.eMail_Ankunft_Betreff = txtAnkunft_Betreff.Text.Trim
|
||||
myOptionen.eMail_Ankunft_Text = txtAnkunft_Text.Text.Trim
|
||||
myOptionen.eMail_Freigabe_Betreff = txtFreigabe_Betreff.Text.Trim
|
||||
myOptionen.eMail_Freigabe_Text = txtFreigabe_Text.Text.Trim
|
||||
|
||||
OptionenDAL.SpeichernOptionen(myOptionen)
|
||||
|
||||
If Neuanlage Then
|
||||
'bei Neuanlage KZ setzen, damit Tabelle neu anzeigt wird
|
||||
cGlobal.Aktive_ID = 1
|
||||
End If
|
||||
|
||||
'Jetzt wird Fenster geschlossen
|
||||
Me.Close()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user