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 41 42
| PrivateSub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim Save AsString
Dim msg AsString
Dim affichageDate AsString
Dim jour AsString
Dim mois AsString
Dim annee AsString
annee = DateTimePicker1.Value.Year
mois = DateTimePicker1.Value.Month
jour = DateTimePicker1.Value.Day
affichageDate = annee &"-"& mois &"-"& jour
If TextBox1.Text = ""Or TextBox2.Text = ""ThenExit Sub
If bdd Then
msg = MsgBox("Voulez-vous vraiment enregistrer l'information concernant patient?", vbYesNo vbInformation)
If msg = vbYesNo Then
Exit Sub
EndIf
Save = "INSERT INTO t_patient(NumFiche,Nom,Adresse,Telephone,Sexe,Age,Visite,Date) VALUES ('"& TextBox1.Text &"','"& TextBox2.Text &"','"& TextBox3.Text &"','"& TextBox4.Text &"','"& RadioButton1.Text Or RadioButton2.Text &"','"& NumericUpDown1.Text &"','"& ComboBox1.Text &"','"& affichageDate &"') "
Else
msg = MsgBox("voulez-vous ins¨¦rer l'information concernant le patient?", vbYesNo vbInformation)
If msg = vbYesNo Then
Exit Sub
EndIf
Save = "UPDATE t_patient SET" _
"Nom = "& TextBox2.Text &", " _
"Adresse = '"& TextBox3.Text &"', " _
"Telephone = '"& TextBox4.Text &"', " _
"Sexe = '"& RadioButton1.Text Or RadioButton2.Text &"', " _
"Age = '"& NumericUpDown1.Text &"', " _
"Visite = '"& ComboBox1.Text &"', " _
"Date = '"& affichageDate &"' WHERE NumFiche = '"& TextBox1.Text &"' "
EndIf
sql(Save)
DataGridView1.Refresh()
table()
EndSub |
Partager