Exercice Visual Basic : Examen Fin de Formation TSDI Juin 2008 Variante 6

Une agence de voyage souhaite développer une application pour la gestion des voyages des particuliers. Pour cela, on vous propose le modèle relationnel suivant :

 CLIENTS (noclient, nom, téléphone, adresse, codepostal)

 CIRCUITS (nocircuit, destination, duree, caracteristiques )

 VOYAGES (novoyage, date, nocircuit, prix, nbPlacemaxi)

INSCRIPTIONS (noclient, novoyage, date)

Travail à faire :

  1. Créer la base de données sous SQL SERVER (2 Pts)
  2. Faire quelques enregistrements pour le test
  3. Créer une interface de mise à jour des Client (4 Pts)
    1. Ajout (le contrôle de saisie est obligatoire et confirmation d’ajout)
    2. Modification
    3. Suppression
    4. Boutons de navigation
  4. Créer une interface de mise à jour des Circuits (2Pts)
  5. Créer une interface de mise à jour des Voyages et Inscriptions (4Pts)
  6. Créer une feuille de recherche :
    1. Les voyages planifiées entre deux dates (2Pts)
    2. Liste des clients inscris pour un voyage donné (2Pts)
  7. Sachant qu’une remise de 5% sur les frais du voyage est accordée à tous les clients en mois d’Octobre, Février et Mars. Faire les modifications nécessaires pour prendre en compte cette remise (2Pts)
  8. Créer un état pour afficher les voyages entre deux dates données (2Pts)
  9. Créer un état permettant de lister les inscrits pour un voyage donné (2Pts)
  10. Créer un état permettant d’afficher le nombre d’inscrits par voyage entre deux dates (2Pts)
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737Imports System.DataImports System.Data.SqlClientPublic Class circuit Dim pos As Integer Private Sub circuit_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load TextBox1.Focus() dap = New SqlDataAdapter("select * from circuits", con) dap.Fill(ds, "circuits") table2 = ds.Tables("circuits") table2.PrimaryKey = New DataColumn() {table2.Columns(0)} 'TextBox1.DataBindings.Add("text", ds, "circuits.nocircuit") 'TextBox2.DataBindings.Add("text", ds, "circuits.destination") 'TextBox3.DataBindings.Add("text", ds, "circuits.duree") 'TextBox4.DataBindings.Add("text", ds, "circuits.caracteristiques") 'cm = CType(BindingContext(ds, "circuits"), CurrencyManager) pos = 0 affiche(pos) End Sub Sub affiche(ByVal pos As Object) If IsDBNull(TextBox1.Text) Then TextBox1.Text = "" Else TextBox1.Text = table2.Rows(pos)(0) End If If IsDBNull(TextBox2.Text) Then TextBox2.Text = "" Else TextBox2.Text = table2.Rows(pos)(1) End If If IsDBNull(TextBox3.Text) Then TextBox3.Text = "" Else TextBox3.Text = table2.Rows(pos)(2) End If If IsDBNull(TextBox4.Text) Then TextBox4.Text = "" Else TextBox4.Text = table2.Rows(pos)(3) End If End Sub Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click End End Sub Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click If pos > 0 Then pos = 0 affiche(pos) Else MsgBox("c le 1er") End If End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" TextBox4.Text = "" TextBox1.Focus() End Sub Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click If pos > 0 Then pos -= 1 affiche(pos) Else MsgBox("c'est le premier") End If End Sub Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click If pos Then pos += 1 Else MsgBox("c'est le dernier") End If End Sub Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click If pos Then pos = table2.Rows.Count - 1 Else MsgBox("c'est le dernier") End If End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Try r = table2.NewRow affecte() table2.Rows.Add(r) misee() MsgBox("bien ajouter") Catch ex As Exception MsgBox(ex.Message) End Try End Sub Sub misee() Dim build As New SqlCommandBuilder(dap) dap.Update(table2) End Sub Sub affecte() With r .Item(0) = TextBox1.Text .Item(1) = TextBox2.Text .Item(2) = TextBox3.Text .Item(3) = TextBox4.Text End With End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Try r = table2.Rows.Find(TextBox1.Text) affecte() misee() MsgBox("bien modifier") Catch ex As Exception MsgBox(ex.Message) End Try End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Try r = table2.Rows.Find(TextBox1.Text) r.Delete() misee() MsgBox("bien supprimer") Catch ex As Exception MsgBox(ex.Message) End Try End Sub Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click Me.Hide() mn.Show() End SubEnd Class----------------------------------------------------------------------------Imports System.DataImports System.Data.SqlClientPublic Class etat1 Dim cmd As SqlCommand Dim cry1 As New CrystalReport1 Private Sub etat1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load con.Open() remplircombo() End Sub Sub remplircombo() dap = New SqlDataAdapter("select * from voyages ", con) dap.Fill(ds, "voyages") Me.ComboBox1.Items.Clear() For Each ligne In ds.Tables("voyages").Rows Me.ComboBox1.Items.Add(ligne("date")) Me.ComboBox2.Items.Add(ligne("date")) Next End Sub Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged table4.Clear() cmd = New SqlCommand("select * from voyages where Date between @d1 and @d2 ") cmd.CommandType = CommandType.StoredProcedure cmd.Connection = con cmd.Parameters.AddWithValue("@d1", ComboBox1.Text) cmd.Parameters.AddWithValue("@d2", ComboBox2.Text) dap = New SqlDataAdapter(cmd) dap.Fill(ds, "listedate") table4 = ds.Tables("voyages") cry1 = New CrystalReport1 cry1.SetDataSource(ds.Tables("listedate")) CrystalReportViewer1.ReportSource = cry1 CrystalReportViewer1.Refresh() ds.Dispose() End SubEnd Class-----------------------------------------------------------------------------Imports System.DataImports System.Data.SqlClientPublic Class etat2 Dim cmd As SqlCommand Dim cry2 As New CrystalReport2 Private Sub etat2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load con.Open() remplircombo() End Sub Sub remplircombo() dap = New SqlDataAdapter("select * from voyages ", con) dap.Fill(ds, "voyages") Me.ComboBox1.Items.Clear() For Each ligne In ds.Tables(("voyages")).Rows Me.ComboBox1.Items.Add(ligne("novoyage")) Next End Sub Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged table4.Clear() cmd = New SqlCommand("select * from inscriptions where novoyage=@num") cmd.Connection = con cmd.Parameters.AddWithValue("@num", ComboBox1.Text) dap = New SqlDataAdapter(cmd) dap.Fill(ds, "inscriptions") table4 = ds.Tables("inscriptions") cry2 = New CrystalReport2 cry2.SetDataSource(ds.Tables("inscriptions")) CrystalReportViewer1.ReportSource = cry2 CrystalReportViewer1.Refresh() ds.Dispose() End Sub Private Sub CrystalReportViewer1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CrystalReportViewer1.Load End SubEnd Class-----------------------------------------------------------------------------Imports System.DataImports System.Data.SqlClientPublic Class Form1 Dim pos As Integer Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" TextBox4.Text = "" TextBox5.Text = "" TextBox1.Focus() End Sub Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click If pos > 0 Then pos = 0 afficher(pos) Else MsgBox("c'est le premier") End If End Sub Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click If pos > 0 Then pos -= 1 afficher(pos) Else MsgBox("c'est le premier") End If End Sub Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click If pos Then pos += 1 afficher(pos) Else MsgBox("c'est le dernier") End If End Sub Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click If pos Then pos = table1.Rows.Count - 1 afficher(pos) Else MsgBox("c'est le dernier") End If End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Try r = table1.NewRow affecter() table1.Rows.Add(r) mise() MsgBox("bien enregistrer") Catch ex As Exception MsgBox(ex.Message) End Try End Sub Sub affecter() With r .Item(0) = TextBox1.Text .Item(1) = TextBox2.Text .Item(2) = TextBox3.Text .Item(3) = TextBox4.Text .Item(4) = TextBox5.Text End With End Sub Sub mise() Dim build As New SqlCommandBuilder(dap) dap.Update(table1) End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Try r = table1.Rows.Find(TextBox1.Text) affecter() mise() MsgBox("bien modifier") Catch ex As Exception MsgBox(ex.Message) End Try End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load dap = New SqlDataAdapter("select * from clients", con) dap.Fill(ds, "clients") table1 = ds.Tables("clients") table1.PrimaryKey = New DataColumn() {table1.Columns(0)} pos = 0 afficher(pos) 'cm = CType(BindingContext(ds, "clients"), CurrencyManager) 'TextBox1.DataBindings.Add("text", ds, "clients.noclient") 'TextBox2.DataBindings.Add("text", ds, "clients.nom") 'TextBox3.DataBindings.Add("text", ds, "clients.téléphone") 'TextBox4.DataBindings.Add("text", ds, "clients.adresse") 'TextBox5.DataBindings.Add("text", ds, "clients.codepostal") End Sub Sub afficher(ByVal pos As Object) TextBox1.Text = table1.Rows(pos)(0) If IsDBNull(TextBox2.Text) Then TextBox2.Text = "" Else TextBox2.Text = table1.Rows(pos)(1) End If If IsDBNull(TextBox3.Text) Then TextBox3.Text = "" Else TextBox3.Text = table1.Rows(pos)(2) End If If IsDBNull(TextBox4.Text) Then TextBox4.Text = "" Else TextBox4.Text = table1.Rows(pos)(3) End If If IsDBNull(TextBox5.Text) Then TextBox5.Text = "" Else TextBox5.Text = table1.Rows(pos)(4) End If End Sub Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click Dim rep As DialogResult rep = MessageBox.Show("voulez vous vraiment quitter?", "sortir!", MessageBoxButtons.YesNo, MessageBoxIcon.Question) If rep = MsgBoxResult.Yes Then End End If End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Try r = table1.Rows.Find(TextBox1.Text) r.Delete() mise() MsgBox("bien supprimer") Catch ex As Exception MsgBox(ex.Message) End Try End SubEnd Class-----------------------------------------------------------------------------Imports System.DataImports System.Data.SqlClientPublic Class inscription Dim pos As Integer Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click Me.Hide() mn.Show() End Sub Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click End End Sub Sub remplircombo() dap = New SqlDataAdapter("select * from clients", con) dap.Fill(ds, "clients") Me.ComboBox1.Items.Clear() For Each ligne In ds.Tables("clients").Rows Me.ComboBox1.Items.Add(ligne("noclient")) Next End Sub Sub remplircombo1() dap = New SqlDataAdapter("select * from voyages", con) dap.Fill(ds, "voyages") Me.ComboBox2.Items.Clear() For Each ligne In ds.Tables("voyages").Rows Me.ComboBox2.Items.Add(ligne("novoyage")) Next End Sub Sub afficher(ByVal pos As Object) ComboBox1.Text = table3.Rows(pos)(0) ComboBox2.Text = table3.Rows(pos)(1) TextBox3.Text = table3.Rows(pos)(2) End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click ComboBox1.Text = "" ComboBox2.Text = "" TextBox3.Text = "" End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Try r = table3.NewRow affect() table3.Rows.Add(r) mis() MsgBox("bien ajouter") Catch ex As Exception MsgBox(ex.Message) End Try End Sub Sub mis() Dim build As New SqlCommandBuilder(dap) dap.Update(table3) End Sub Sub affect() With r .Item(0) = ComboBox1.Text .Item(1) = ComboBox2.Text .Item(2) = TextBox3.Text End With End Sub Private Sub inscription_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load remplircombo() remplircombo1() dap = New SqlDataAdapter("select * from inscriptions", con) dap.Fill(ds, "inscriptions") table3 = ds.Tables("inscriptions") 'table3.PrimaryKey = New DataColumn() {table3.Columns(0)} 'table3.PrimaryKey = New DataColumn() {table3.Columns(1)} ComboBox1.DataBindings.Add("text", ds, "inscriptions.noclient") ComboBox2.DataBindings.Add("text", ds, "inscriptions.novoyage") TextBox3.DataBindings.Add("text", ds, "inscriptions.date") 'pos = 0 'afficherr(pos) End Sub Sub afficherr(ByVal pos As Object) ComboBox1.Text = table3.Rows(pos)(0) ComboBox2.Text = table3.Rows(pos)(1) TextBox3.Text = table3.Rows(pos)(2) End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Try r = table3.Rows.Find(ComboBox1.Text) r.Delete() mis() MsgBox("bien supprimer") Catch ex As Exception MsgBox(ex.Message) End Try End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Try r = table3.Rows.Find(ComboBox1.Text) affect() mis() MsgBox("bien modifier") Catch ex As Exception MsgBox(ex.Message) End Try End Sub Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged End Sub Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click If pos > 0 Then pos = 0 afficher(pos) Else MsgBox("c'est le premier") End If End Sub Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click If pos > 0 Then pos -= 1 afficher(pos) Else MsgBox("c'est le premier") End If End Sub Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click If pos Then pos += 1 afficher(pos) Else MsgBox("c'est le dernier") End If End Sub Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click If pos Then pos = table3.Rows.Count - 1 afficher(pos) Else MsgBox("c'est le dernier") End If End SubEnd Class-----------------------------------------------------------------------------Imports System.DataImports System.Data.SqlClientModule Module1 Public con As New SqlConnection("server=(local);integrated security=SSPI; initial catalog=gestion des voyages") Public ds As New DataSet Public table1, table2, table3, table4 As New DataTable Public dap As New SqlDataAdapter Public cm As CurrencyManager Public cl As New Form1 Public cr As New circuit Public ins As New inscription Public voy As New voyage Public mn As New menu Public r As DataRowEnd Module----------------------------------------------------------------------------Imports System.DataImports System.Data.SqlClientPublic Class rechvoyage Dim cmd As SqlCommand Private Sub rechvoyage_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load con.Open() RemplirCombo() End Sub Sub RemplirCombo() dap = New SqlDataAdapter("select * from voyages", con) dap.Fill(ds, "voyages") Me.ComboBox1.Items.Clear() For Each ligne In ds.Tables("voyages").Rows Me.ComboBox1.Items.Add(ligne("Date")) Me.ComboBox2.Items.Add(ligne("Date")) Next End Sub Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged table4.Clear() cmd = New SqlCommand("select * from voyages where Date between @dat1 and @dat2 ") cmd.Connection = con cmd.Parameters.AddWithValue("@dat1", ComboBox1.Text) cmd.Parameters.AddWithValue("@dat2", ComboBox2.Text) dap = New SqlDataAdapter(cmd) dap.Fill(ds, "voyages") table4 = ds.Tables("voyages") Me.DataGridView1.DataSource = table4 End SubEnd Class-----------------------------------------------------------------------------Imports System.DataImports System.Data.SqlClientPublic Class rechvoyage2 Dim cmd As SqlCommand Private Sub rechvoyage2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load con.Open() remplircombo() End Sub Sub remplircombo() dap = New SqlDataAdapter("select * from voyages ", con) dap.Fill(ds, "voyages") Me.ComboBox1.Items.Clear() For Each ligne In ds.Tables("voyages").Rows Me.ComboBox1.Items.Add(ligne("novoyage")) Next End Sub Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged table4.Clear() cmd = New SqlCommand("select * from voyages where novoyage=@num", con) cmd.Parameters.AddWithValue("@num", ComboBox1.Text) dap = New SqlDataAdapter(cmd) dap.Fill(ds, "voyages") dap.Dispose() table4 = ds.Tables("voyages") Me.DataGridView1.DataSource = table4 End SubEnd Class-----------------------------------------------------------------------------Imports System.DataImports System.Data.SqlClientPublic Class voyage Dim pos As Integer Private Sub voyage_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load remplircombo() dap = New SqlDataAdapter("select * from voyages", con) dap.Fill(ds, "voyages") table4 = ds.Tables("voyages") table4.PrimaryKey = New DataColumn() {table4.Columns(0)} pos = 0 afficher(pos) End Sub Sub remplircombo() dap = New SqlDataAdapter("select * from circuits", con) dap.Fill(ds, "circuits") Me.ComboBox1.Items.Clear() For Each ligne In ds.Tables("circuits").Rows Me.ComboBox1.Items.Add(ligne("nocircuit")) Next End Sub Sub afficher(ByVal pos As Object) TextBox1.Text = table4.Rows(pos)(0) TextBox2.Text = table4.Rows(pos)(1) ComboBox1.Text = table4.Rows(pos)(2) TextBox4.Text = table4.Rows(pos)(3) TextBox5.Text = table4.Rows(pos)(4) End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click TextBox1.Text = "" TextBox2.Text = "" ComboBox1.Text = "" TextBox4.Text = "" TextBox5.Text = "" End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click r = table4.NewRow Try r = table4.NewRow affectt() table4.Rows.Add(r) miss() MsgBox("bien ajouter") Catch ex As Exception MsgBox(ex.Message) End Try End Sub Sub miss() Dim build As New SqlCommandBuilder(dap) dap.Update(table4) End Sub Sub affectt() With r .Item(0) = TextBox1.Text .Item(1) = TextBox2.Text .Item(2) = ComboBox1.Text .Item(3) = TextBox4.Text .Item(4) = TextBox5.Text End With End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Try r = table4.Rows.Find(TextBox1.Text) r.Delete() miss() MsgBox("bien supprimer") Catch ex As Exception MsgBox(ex.Message) End Try End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Try r = table4.Rows.Find(TextBox1.Text) affectt() miss() MsgBox("bien modifier") Catch ex As Exception MsgBox(ex.Message) End Try End Sub Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click End End Sub Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click Me.Hide() mn.Show() End Sub Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click If pos > 0 Then pos = 0 afficher(pos) Else MsgBox("c'est le premier") End If End Sub Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click If pos > 0 Then pos -= 1 afficher(pos) Else MsgBox("c'est le premier") End If End Sub Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click If pos Then pos += 1 afficher(pos) Else MsgBox("c'est le dernier") End If End Sub Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click If pos Then pos = table4.Rows.Count - 1 afficher(pos) Else MsgBox("c'est le dernier") End If End Sub Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click Dim rechd As New rechvoyage rechd.Show() Me.Hide() End Sub Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click Dim rech2 As New rechvoyage2 rech2.Show() Me.Hide() End Sub Private Sub Button13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button13.Click Dim et1 As New etat1 Me.Hide() et1.Show() End Sub Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button14.Click Dim et2 As New etat2 etat2.Show() Me.Hide() End SubEnd Class
Article publié le 08 Janvier 2012 Mise à jour le Samedi, 17 Décembre 2022 15:27 par GC Team