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 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
| Public Class FormConsultation
Dim dc As New DataClasses1DataContext
Dim i As Integer
Private Sub FormConsultation_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO*: cette ligne de code charge les données dans la table 'PointeusesDataSet.VueBdj'. Vous pouvez la déplacer ou la supprimer selon vos besoins.
Me.VueBdjTableAdapter.Fill(Me.PointeusesDataSet.VueBdj)
DataGridView1.DataSource = VueBdjBindingSource
PictureBox1.Image = Image.FromFile("C:\Users\dell\Pictures\photos\" & MatriculeTextBox.Text & ".jpg")
Dim dep = (From d In dc.Departement _
Where d.NomDepartement = ComboBoxDepartement.Text).FirstOrDefault
ComboBoxDepartement.Items.AddRange()
End Sub
Private Sub CmdPremier_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CmdPremier.Click
VueBdjBindingSource.MoveFirst()
PictureBox1.Image = Image.FromFile("C:\Users\dell\Pictures\photos\" & MatriculeTextBox.Text & ".jpg")
End Sub
Private Sub CmdPrecedent_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CmdPrecedent.Click
VueBdjBindingSource.MovePrevious()
PictureBox1.Image = Image.FromFile("C:\Users\dell\Pictures\photos\" & MatriculeTextBox.Text & ".jpg")
End Sub
Private Sub CmdSuivant_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CmdSuivant.Click
VueBdjBindingSource.MoveNext()
PictureBox1.Image = Image.FromFile("C:\Users\dell\Pictures\photos\" & MatriculeTextBox.Text & ".jpg")
End Sub
Private Sub CmdDernier_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CmdDernier.Click
VueBdjBindingSource.MoveLast()
PictureBox1.Image = Image.FromFile("C:\Users\dell\Pictures\photos\" & MatriculeTextBox.Text & ".jpg")
End Sub
Private Sub CmdQuitter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CmdQuitter.Click
Me.Close()
End Sub
Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click
If Not (PictureBox1.Image Is Nothing) Then
PictureBox1.Image.Dispose()
PictureBox1.Image = Nothing
End If
End Sub
Private Sub ComboBoxDepartement_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBoxDepartement.Click
End Sub
Private Sub ComboBoxDepartement_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBoxDepartement.SelectedIndexChanged
Dim cl = (From c In dc.Departement _
Where c.NomDepartement = ComboBoxDepartement.Text).FirstOrDefault
'If Not cl Is Nothing Then
' MatriculeTextBox.Text = cl.Matricule
' NomTextBox.Text = cl.Personnel.Nom
' PrenomTextBox.Text = cl.Personnel.Prenom
' NPArTextBox.Text = cl.NPAr
' NomFonctionTextBox.Text = cl.NomFonction
' NomDepartementTextBox.Text = cl.NomDepartement
'End If
End Sub
Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
End Sub
Private Sub DataGridView1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGridView1.Click
Try
Dim consult = From c In dc.Bdj _
Where c.N_Bdj = DataGridView1.CurrentRow.Cells(0).Value.ToString _
Select c
MatriculeTextBox.Text = consult.First.Matricule
NomTextBox.Text = consult.First.ToString
PrenomTextBox.Text = consult.First.ToString
NPArTextBox.Text = consult.First.NPAr
NomFonctionTextBox.Text = consult.First.NomFonction
NomDepartementTextBox.Text = consult.First.NomDepartement
PictureBox1.Image = Image.FromFile("C:\Users\dell\Pictures\photos\" & MatriculeTextBox.Text & ".jpg")
Catch ex As Exception
MsgBox("Pas de Personnel")
End Try
i = DataGridView1.CurrentRow.Index
End Sub
Private Sub CmdAfficher_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CmdAfficher.Click
Dim consult = From c In dc.Bdj _
Where c.N_Bdj = DataGridView1.CurrentRow.Cells(0).Value.ToString _
Select c
End Sub
End Class |