ANNEXE
Les interfaces utilisateurs
Codes sources en VB2012
B U Z I Linda Page | 112
B U Z I Linda Page | 113
B U Z I Linda Page | 114
B U Z I Linda Page | 115
EXTRAIT DES CODES SOURCES DE L'INTERFACE
QUALIFICATION
TYPEImports System.Data.OracleClient Public
Class formqualification
Private Sub formqualification_Load(sender As Object, e As
EventArgs) Handles MyBase.Load
Try
con.Open()
chargementGrille()
Catch ex As Exception
MessageBox.Show("probleme de connexion:" + ex.Message)
End Try
End Sub
Private Sub btnenregistrer_Click(sender As Object, e As
EventArgs) Handles
btnenregistrer.Click
If txtcodequal1.Text = "" Then
MessageBox.Show("Le code qualification ne doit pas être
vide", "Erreur",
MessageBoxButtons.OK, MessageBoxIcon.Error)
txtcodequal1.Focus()
ElseIf txtdesignation1.Text = "" Then
MessageBox.Show("La désignation ne doit pas être
vide", "Erreur",
MessageBoxButtons.OK, MessageBoxIcon.Error)
txtdesignation1.Focus()
Else
Try
Dim codequal = txtcodequal1.Text.Trim.ToUpper Dim desig =
txtdesignation1.Text.Trim.ToUpper
requete = "insert into qualification_type values('" + codequal +
"','" +
desig + "')"
cmd.Connection = con
cmd.CommandText = requete
cmd.ExecuteNonQuery()
MessageBox.Show("Enregistrement reussie")
Call initialise()
Catch ex As Exception
MessageBox.Show("echec d'enregistrement:" + ex.Message)
End Try
End If
End Sub
Private Sub btnannuler1_Click(sender As Object, e As
EventArgs) Handles btnannuler1.Click
Call initialise()
End Sub
Private Sub btnquitter1_Click(sender As Object, e As
EventArgs) Handles btnquitter1.Click
B U Z I Linda Page | 116
Me.Hide() End Sub
Private Sub btnmodifier_Click(sender As Object, e As EventArgs)
Handles
btnmodifier.Click
'test des champs fides
If txtcodequal1.Text = "" Then
MessageBox.Show("Le code qualification ne doit pas être
vide", "Erreur",
MessageBoxButtons.OK, MessageBoxIcon.Error)
txtcodequal1.Focus()
ElseIf txtdesignation1.Text = "" Then
MessageBox.Show("La désignation ne doit pas être
vide", "Erreur",
MessageBoxButtons.OK, MessageBoxIcon.Error)
txtdesignation1.Focus()
Else
Try
Dim codequal = txtcodequal1.Text.Trim.ToUpper Dim desig =
txtdesignation1.Text.Trim.ToUpper
requete = "update qualification_type set design_qual='" + desig +
"' where code_qual='" + codequal + "'"
cmd.Connection = con
cmd.CommandText = requete
cmd.ExecuteNonQuery()
MessageBox.Show("Modification reussie")
Call initialise()
Catch ex As Exception
MessageBox.Show("Echec de modification: " + ex.Message)
End Try
End If
End Sub
Private Sub btnsupprimer_Click(sender As Object, e As EventArgs)
Handles btnsupprimer.Click
Dim reponse As DialogResult = MessageBox.Show("Voulez-vous
supprimer?", "Suppression", MessageBoxButtons.YesNo,
MessageBoxIcon.Question)
If reponse = DialogResult.Yes Then Try
Dim codequal = txtcodequal1.Text.Trim.ToUpper
requete = "delete from qualification_type where code_qual='" +
codequal +
"'"
cmd.Connection = con
cmd.CommandText = requete
cmd.ExecuteNonQuery()
MessageBox.Show("suppression reussie")
Call initialise() Catch ex As Exception
B U Z I Linda Page | 117
MessageBox.Show("Echec de suppression:" + ex.Message) End Try
End If
End Sub
Private Sub TextBox1_TextChanged(sender As Object, e As
EventArgs) Handles txtrecherche.TextChanged
'recupération du texte saisie
Dim codequal = txtrecherche.Text.Trim.ToUpper()
Try
'requeterequete = "select * from qualification_type where
code_qual='" + codequal + "'"
Dim darech As OracleDataAdapter = New OracleDataAdapter(requete,
con) dsrech.Clear()
darech.Fill(dsrech, "qualification_type")
grille2.DataSource = dsrech.Tables(0) Catch ex As Exception
End Try
End Sub End Class
|
|