Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.66 KB | None | 0 0
  1.     'AJOUT
  2.     Private Sub ajouterModeleFormation()
  3.         BDD.ouvertureBDD()
  4.         'On appelle la requête pour ajouter un élément de formation
  5.         If checkedTypeFormation.Count() > 0 Then
  6.             If clbElementType.CheckedItems.Count() > 0 Then
  7.                 modeleFormationBdd.ajouterModeleFormation(txtNomModeleFormation.Text, chkArchiverModeleFormation.CheckState)
  8.                 For Each typeFormation In clbTypeFormation.SelectedItems
  9.                     modeleTypeFormationBdd.ajouterModeleTypeFormation(modeleFormationBdd.getMaxIdModeleFormation(), typeFormation.idTypeFormation)
  10.                 Next
  11.                 txtNomModeleFormation.Clear()
  12.             Else
  13.                 MsgBox("Veuillez sélectionner au moins un élement de type de formation.", MsgBoxStyle.Critical, "Attention !")
  14.             End If
  15.         Else
  16.             MsgBox("Veuillez sélectionner au moins un type de formation.", MsgBoxStyle.Critical, "Attention !")
  17.         End If
  18.         BDD.fermetureBDD()
  19.     End Sub
  20.  
  21.     'MODIFICATION
  22.     Private Sub modifierModeleFormation(ByVal index As Integer)
  23.         Dim modeleFormation As New ModeleFormation
  24.         modeleFormation.idModeleFormation = lbxModeleFormation.SelectedItem.idModeleFormation
  25.         modeleFormation.archive = chkArchiverModeleFormation.CheckState
  26.         If index = 1 Then
  27.             modeleFormation.nomModele = lbxModeleFormation.SelectedItem.nomModele
  28.         ElseIf index = 2 Then
  29.             modeleFormation.nomModele = txtNomModeleFormation.Text
  30.         End If
  31.         BDD.ouvertureBDD()
  32.         modeleFormationBdd.modifierModeleFormation(ModeleFormation)
  33.         BDD.fermetureBDD()
  34.     End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement