204 lines
7.9 KiB
VB.net
204 lines
7.9 KiB
VB.net
Imports System.Windows.Forms
|
|
Imports com.sun.org.apache.xml.internal.security.keys.content
|
|
|
|
Public Class frmAuditFlow_Pruefungsojekt
|
|
|
|
Dim AF_PO As cAuditFlow_Pruefobjekte = Nothing
|
|
|
|
Sub New()
|
|
|
|
' Dieser Aufruf ist für den Designer erforderlich.
|
|
InitializeComponent()
|
|
|
|
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
|
|
|
|
End Sub
|
|
|
|
Sub New(wartPO_Id)
|
|
|
|
' Dieser Aufruf ist für den Designer erforderlich.
|
|
InitializeComponent()
|
|
|
|
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
|
|
AF_PO = New cAuditFlow_Pruefobjekte(wartPO_Id)
|
|
End Sub
|
|
|
|
|
|
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
|
|
If vbYes = MsgBox("Wollen Sie wirklich alle offenen Fälligkeiten löschen?", MsgBoxStyle.YesNo + MsgBoxStyle.Question, "Löschen?") Then
|
|
Try
|
|
Me.Cursor = Cursors.WaitCursor
|
|
If AF_PO IsNot Nothing Then
|
|
|
|
Dim cnt = cAuditFlow.DELETE_ALL_OPEN_FAELLIGE(AF_PO.wartPO_Id)
|
|
If cnt > 0 Then
|
|
MsgBox(cnt & " offene Fälligkeiten gelöscht!")
|
|
End If
|
|
End If
|
|
Catch ex As Exception
|
|
MsgBox(ex.Message & ex.StackTrace)
|
|
End Try
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
|
|
Try
|
|
Me.Cursor = Cursors.WaitCursor
|
|
If checkValues() Then
|
|
|
|
getValues()
|
|
If AF_PO.SAVE Then
|
|
Me.Close()
|
|
End If
|
|
|
|
End If
|
|
|
|
Catch ex As Exception
|
|
MsgBox(ex.Message & ex.StackTrace)
|
|
End Try
|
|
Me.Cursor = Cursors.Default
|
|
End Sub
|
|
|
|
Function checkValues() As Boolean
|
|
If cboFirma._value = "" Then MsgBox("Firma angeben!") : Return False
|
|
If cboNL._value = "" Then MsgBox("Niederlassung angeben!") : Return False
|
|
If cboStandort._value = "" Then MsgBox("Standort angeben!") : Return False
|
|
If cboKategorie._value = "" Then MsgBox("Kategorie angeben!") : Return False
|
|
If cboIntervall._value = "" Then MsgBox("Intervall angeben!") : Return False
|
|
If cboMA._value = "" Then MsgBox("Mitarbeiter angeben!") : Return False
|
|
If txtIntervallWert.Text = "" Then MsgBox("Intervall-Wert angeben!") : Return False
|
|
If datVon._value = "" Then MsgBox("Startdatum angeben!") : Return False
|
|
If txtBezeichnung.Text = "" Then MsgBox("Bezeichnung angeben!") : Return False
|
|
If txtZustaendigIntern_Mail.Text = "" Then MsgBox("Email angeben!") : Return False
|
|
Return True
|
|
End Function
|
|
Sub getValues()
|
|
Try
|
|
|
|
AF_PO.wartPO_Firma = cboFirma._value
|
|
AF_PO.wartPO_Niederlasung = cboNL._value
|
|
AF_PO.wartPO_StandortId = cboStandort._value
|
|
AF_PO.wartPO_Kategorie = cboKategorie._value
|
|
|
|
AF_PO.wartPO_Bezeichnung = txtBezeichnung.Text
|
|
AF_PO.wartPO_Kennung = txtKennung.Text
|
|
AF_PO.wartPO_zustaendigIntern_Mail = txtZustaendigIntern_Mail.Text
|
|
AF_PO.wartPO_IntervallWert = txtIntervallWert.Text
|
|
AF_PO.wartPO_IntervallTyp = cboIntervall._value
|
|
AF_PO.wartPO_zustaendigIntern_MaId = cboMA._value
|
|
AF_PO.wartPO_zustaendigIntern_Name = cboMA.Text
|
|
|
|
AF_PO.wartPO_startdatum = datVon._value
|
|
If datBis._value <> "" Then
|
|
AF_PO.wartPO_enddatum = datBis._value
|
|
Else
|
|
AF_PO.wartPO_enddatum = Nothing
|
|
End If
|
|
|
|
AF_PO.wartPO_Erinnerung_VorlaufInTagen = txtErinnerungVorlaubInTagen.Text
|
|
AF_PO.wartPO_Aktiv = CheckBox1.Checked
|
|
|
|
If cboMA._value <> "" Then
|
|
Dim MA As New cMitarbeiter(cboMA._value)
|
|
AF_PO.wartPO_zustaendigIntern_Tel = MA.mit_telefonnr
|
|
'AF_PO= MA.mit_telefonnr
|
|
End If
|
|
|
|
|
|
Catch ex As Exception
|
|
MsgBox(ex.Message & ex.StackTrace)
|
|
End Try
|
|
|
|
End Sub
|
|
|
|
Sub setValues()
|
|
|
|
cboFirma.changeItem(AF_PO.wartPO_Firma)
|
|
cboNL.changeItem(AF_PO.wartPO_Niederlasung)
|
|
cboStandort.changeItem(AF_PO.wartPO_StandortId)
|
|
cboKategorie.changeItem(AF_PO.wartPO_Kategorie)
|
|
|
|
txtBezeichnung.Text = AF_PO.wartPO_Bezeichnung
|
|
txtKennung.Text = AF_PO.wartPO_Kennung
|
|
|
|
datVon._value = AF_PO.wartPO_startdatum
|
|
datBis._value = If(AF_PO.wartPO_enddatum, "")
|
|
txtIntervallWert.Text = AF_PO.wartPO_IntervallWert
|
|
cboIntervall.changeItem(AF_PO.wartPO_IntervallTyp)
|
|
cboMA.changeItem(AF_PO.wartPO_zustaendigIntern_MaId)
|
|
'cboMA.Text = AF_PO.wartPO_zustaendigIntern_Name
|
|
txtErinnerungVorlaubInTagen.Text = AF_PO.wartPO_Erinnerung_VorlaufInTagen
|
|
CheckBox1.Checked = AF_PO.wartPO_Aktiv
|
|
|
|
txtZustaendigIntern_Mail.Text = AF_PO.wartPO_zustaendigIntern_Mail 'zuletzt, sonst bei MA Wechsel überschrieben
|
|
|
|
End Sub
|
|
|
|
Private Sub frmAuditFlow_Pruefungsojekt_Load(sender As Object, e As EventArgs) Handles Me.Load
|
|
cboKategorie.Items.Clear()
|
|
cboKategorie.fillWithSQL("SELECT wartK_Kategorie,[wartK_KategorieBezeichnung] FROM [tblAuditFlow_Kategorien] order by wartK_KategorieBezeichnung", False, "ADMIN", True)
|
|
|
|
cboNL.Items.Clear()
|
|
cboNL.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("", ""))
|
|
cboNL.SelectedItem = 0
|
|
|
|
cboFirma.Items.Clear()
|
|
cboFirma.fillWithSQL("SELECT distinct(Firma) FROM [Filialen] order by Firma", False, "FMZOLL", True)
|
|
cboFirma.changeItem(cAllgemein.FIRMA)
|
|
|
|
cboIntervall.Items.Clear()
|
|
cboIntervall.fillWithSQL("SELECT [wartK_IntervallTyp] ,[wartK_IntervallBez] FROM [tblAuditFlow_Intervalle] Order by [wartK_IntervallBez]", False, "ADMIN", True)
|
|
cboIntervall.SelectedItem = 0
|
|
|
|
cboMA.fillWithSQL("SELECT [mit_id],[mit_vname] + ' '+ [mit_nname] as Name " &
|
|
" FROM [ADMIN].[dbo].[tblMitarbeiter] WHERE [mit_gekuendigt]=0 order by name", False, "ADMIN", True)
|
|
|
|
|
|
If AF_PO Is Nothing Then
|
|
AF_PO = New cAuditFlow_Pruefobjekte()
|
|
Else
|
|
setValues()
|
|
End If
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
Private Sub cboFirma_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboFirma.SelectedIndexChanged
|
|
cboNL.Items.Clear()
|
|
cboNL.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("", ""))
|
|
If cboFirma._value <> "" Then
|
|
cboNL.fillWithSQL("SELECT nl_kuerzel,nl_bezeichnung FROM [tblNiederlassungen] where [nl_firma]='" & cboFirma._value & "' order by nl_bezeichnung", False, "ADMIN", False)
|
|
End If
|
|
|
|
End Sub
|
|
|
|
Private Sub cboNL_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboNL.SelectedIndexChanged
|
|
cboStandort.Items.Clear()
|
|
cboStandort.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("", ""))
|
|
If cboFirma._value <> "" AndAlso cboNL._value <> "" Then
|
|
cboStandort.fillWithSQL("SELECT [wartSt_Id],[wartSt_Standort] FROM [tblAuditFlow_Standorte] where [wartSt_Aktiv]=1 and [wartSt_Firma]='" & cboFirma._value & "' AND [wartSt_Niederlasung]='" & cboNL._value & "' order by wartSt_Standort", False, "ADMIN", True)
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub cboMA_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboMA.SelectedIndexChanged
|
|
If cboMA._value <> "" Then
|
|
Dim MA As New cMitarbeiter(cboMA._value)
|
|
txtZustaendigIntern_Mail.Text = MA.mit_email
|
|
'AF_PO= MA.mit_telefonnr
|
|
End If
|
|
|
|
End Sub
|
|
|
|
Private Sub frmAuditFlow_Pruefungsojekt_Shown(sender As Object, e As EventArgs) Handles Me.Shown
|
|
|
|
End Sub
|
|
|
|
Private Sub cboIntervall_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboIntervall.SelectedIndexChanged
|
|
If cboIntervall._value = "EINMALIG" Then
|
|
datBis.Enabled = False
|
|
Else
|
|
datBis.Enabled = True
|
|
End If
|
|
End Sub
|
|
End Class |