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
| Private Sub searchDATA()
Dim toto As String
Me.objDATA = New CLdata()
Me.rqSql = "SELECT Index_Agent, Nom, Nom_de_Naissance, Prenom, Date_Naissance, Date_Entree_DGAC, Adresse, Code_Postal, Ville, Telephone_Perso, GSM_Perso, Telephone_Pro, GSM_Pro " & _
"FROM Tbl_Agents " & _
"WHERE Tbl_Agents.Nom LIKE " & Index_Cherche & ";"
Me.DS = Me.objDATA.getRows(Me.rqSql, "TBL_FONCTIONS")
toto = DS.Tables(0).Rows.Count - 1
Dim str As String = DS.Tables(0).Rows(0).Item(0)
Dim Enregistrement As Integer = DS.Tables(0).Rows.Count
If DS.Tables(0).Rows(0).Item(0) IsNot DBNull.Value Then
txt_IndexAgent.Text = DS.Tables(0).Rows(0).Item(0)
End If
If DS.Tables(0).Rows(0).Item(1) IsNot DBNull.Value Then
txt_NomAgent.Text = DS.Tables(0).Rows(0).Item(1)
End If
If DS.Tables(0).Rows(0).Item(2) IsNot DBNull.Value Then
txt_NomNaissance.Text = DS.Tables(0).Rows(0).Item(2)
End If
If DS.Tables(0).Rows(0).Item(3) IsNot DBNull.Value Then
txt_PrenomAgent.Text = DS.Tables(0).Rows(0).Item(3)
End If
If DS.Tables(0).Rows(0).Item(4) IsNot DBNull.Value Then
txt_DateNaissance.Text = DS.Tables(0).Rows(0).Item(4)
End If
If DS.Tables(0).Rows(0).Item(5) IsNot DBNull.Value Then
txt_DateEntreDGAC.Text = DS.Tables(0).Rows(0).Item(5)
End If
If DS.Tables(0).Rows(0).Item(6) IsNot DBNull.Value Then
txt_Adresse.Text = DS.Tables(0).Rows(0).Item(6)
End If
If DS.Tables(0).Rows(0).Item(7) IsNot DBNull.Value Then
txt_CPAgent.Text = DS.Tables(0).Rows(0).Item(7)
End If
If DS.Tables(0).Rows(0).Item(8) IsNot DBNull.Value Then
txt_VilleAgent.Text = DS.Tables(0).Rows(0).Item(8)
End If
If DS.Tables(0).Rows(0).Item(9) IsNot DBNull.Value Then
txt_TelPerso.Text = DS.Tables(0).Rows(0).Item(9)
End If
If DS.Tables(0).Rows(0).Item(10) IsNot DBNull.Value Then
txt_GSMPerso.Text = DS.Tables(0).Rows(0).Item(10)
End If
If DS.Tables(0).Rows(0).Item(11) IsNot DBNull.Value Then
txt_TelPro.Text = DS.Tables(0).Rows(0).Item(11)
End If
If DS.Tables(0).Rows(0).Item(12) IsNot DBNull.Value Then
txt_GSMPro.Text = DS.Tables(0).Rows(0).Item(12)
End If
Dim titi As String
Me.objDATA = New CLdata
Me.rqSql = "SELECT Tbl_Historique_Fonctions.Date_Fonction, Tbl_Fonctions.Detachement_Oui_Non, Tbl_Subdivisions.Subdivision, Tbl_Qualifications.Qualification " & _
"FROM Tbl_Agents RIGHT OUTER JOIN " & _
"Tbl_Historique_Fonctions ON Tbl_Agents.Index_Agent = Tbl_Historique_Fonctions.Index_Agent RIGHT OUTER JOIN " & _
"Tbl_Historiques_Qualifs ON Tbl_Agents.Index_Agent = Tbl_Historiques_Qualifs.Index_Agent RIGHT OUTER JOIN " & _
"Tbl_Qualifications ON Tbl_Historiques_Qualifs.Type_Qualif = Tbl_Qualifications.Type_Qualif RIGHT OUTER JOIN " & _
"Tbl_Fonctions ON Tbl_Historique_Fonctions.Index_Fonction = Tbl_Fonctions.Index_Fonction RIGHT OUTER JOIN " & _
"Tbl_Subdivisions ON Tbl_Historique_Fonctions.Index_Subdivision = Tbl_Subdivisions.Index_Subdivision " & _
"WHERE Tbl_Agents.Nom LIKE ('" & Index_Cherche & "') AND(Tbl_Historique_Fonctions.Date_Fonction <= '" & Format(DateValue(Me.Calendrier.Value), "yyyy-MM-dd") & "') ORDER BY Tbl_Historique_Fonctions.Date_Fonction ASC;"
Me.DS = Me.objDATA.getRows(Me.rqSql, "TBL_FONCTIONS")
Dim haha As Integer = DS.Tables(0).Rows.Count
titi = DS.Tables(0).Rows.Count - 1
If DS.Tables(0).Rows(toto).Item(0) IsNot DBNull.Value Then
txt_DateFonction.Text = DS.Tables(0).Rows(titi).Item(0)
End If
If (DS.Tables(0).Rows(titi).Item(columnName:="Detachement_Oui_Non") = True) Then
detache.CheckState = 1
Else
detache.CheckState = 0
End If
If DS.Tables(0).Rows(toto).Item(2) IsNot DBNull.Value Then
txt_Sub.Text = DS.Tables(0).Rows(titi).Item(2)
End If
If DS.Tables(0).Rows(toto).Item(3) IsNot DBNull.Value Then
txt_Qualif.Text = DS.Tables(0).Rows(titi).Item(3)
End If
End Sub |
Partager