1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| Dim j As Integer
Dim sql_ajouter As String
sql_ajouter = "INSERT INTO USERS (ALPS,NOM_USER,PRENOM_USER,ID_CC,Type_contrat_USER,ID_AGENCE) VALUES(Val_ALPS, Val_NOM_USER, Val_PRENOM_USER, Val_ID_CC, Val_Type_contrat_USER, Val_ID_AGENCE)"
commande_user = New OleDb.OleDbCommand(sql_ajouter, con_user)
commande_user.Parameters.AddWithValue("Val_ALPS", TXT_ALPS_USER.Text)
commande_user.Parameters.AddWithValue("Val_NOM_USER", TXT_NOM_USER.Text)
commande_user.Parameters.AddWithValue("Val_PRENOM_USER", TXT_PRENOM_USER.Text)
commande_user.Parameters.AddWithValue("Val_ID_CC", CB_CC.SelectedItem)
commande_user.Parameters.AddWithValue("Val_Type_contrat_USER", CB_TYPE_CONTRAT_USER.SelectedItem)
If CB_AGENCE_USERS.Text = "" Then
?????????????????????????????????????????????????????????????????????????
Else
For j = 0 To dts_agence.Tables("AGENCES").Rows.Count - 1
If CB_AGENCE_USERS.Text = dts_agence.Tables("AGENCES").Rows(j).Item("LIB_AGENCE") Then
commande_user.Parameters.AddWithValue("ID_AGENCE", dts_agence.Tables("AGENCES").Rows(j).Item("ID_AGENCE"))
End If
Next
End If
commande_user.Connection.Open()
commande_user.ExecuteReader()
commande_user.Connection.Close()
TXT_ALPS_USER.Text = ""
TXT_NOM_USER.Text = ""
TXT_PRENOM_USER.Text = ""
CB_CC.Text = ""
CB_TYPE_CONTRAT_USER.Text = ""
CB_TYPE_CONTRAT_USER.SelectedItem = ""
CB_AGENCE_USERS.Text = ""
CB_AGENCE_USERS.Text = ""
MsgBox("Le nouveau contact a bien été enregistré.")
dts_user.Clear()
demarrage_users() |
Partager