Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'AJOUT
- Private Sub ajouterModeleFormation()
- BDD.ouvertureBDD()
- 'On appelle la requête pour ajouter un élément de formation
- If checkedTypeFormation.Count() > 0 Then
- If clbElementType.CheckedItems.Count() > 0 Then
- modeleFormationBdd.ajouterModeleFormation(txtNomModeleFormation.Text, chkArchiverModeleFormation.CheckState)
- For Each typeFormation In clbTypeFormation.SelectedItems
- modeleTypeFormationBdd.ajouterModeleTypeFormation(modeleFormationBdd.getMaxIdModeleFormation(), typeFormation.idTypeFormation)
- Next
- txtNomModeleFormation.Clear()
- Else
- MsgBox("Veuillez sélectionner au moins un élement de type de formation.", MsgBoxStyle.Critical, "Attention !")
- End If
- Else
- MsgBox("Veuillez sélectionner au moins un type de formation.", MsgBoxStyle.Critical, "Attention !")
- End If
- BDD.fermetureBDD()
- End Sub
- 'MODIFICATION
- Private Sub modifierModeleFormation(ByVal index As Integer)
- Dim modeleFormation As New ModeleFormation
- modeleFormation.idModeleFormation = lbxModeleFormation.SelectedItem.idModeleFormation
- modeleFormation.archive = chkArchiverModeleFormation.CheckState
- If index = 1 Then
- modeleFormation.nomModele = lbxModeleFormation.SelectedItem.nomModele
- ElseIf index = 2 Then
- modeleFormation.nomModele = txtNomModeleFormation.Text
- End If
- BDD.ouvertureBDD()
- modeleFormationBdd.modifierModeleFormation(ModeleFormation)
- BDD.fermetureBDD()
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement