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
| Private Sub calcul()
HS = 28
HSARTT = 4
CENTRALE = 28
CENTRALEARTT = 4
HB = 22.5
HBARTT = 7.5
HBO = 23.5
HBOARTT = 7.5
HA = 25
HAARTT = 14
Me.objDATA = New CLdata
Me.rqSql = "SELECT dbo.Tbl_Agents.Index_Agent, Tbl_Horaires.Index_Horaire " & _
"FROM dbo.Tbl_Horaires INNER JOIN " & _
"dbo.Tbl_Historique_Fonctions ON dbo.Tbl_Horaires.Index_Horaire = dbo.Tbl_Historique_Fonctions.Index_Horaire RIGHT OUTER JOIN " & _
"dbo.Tbl_Agents ON dbo.Tbl_Historique_Fonctions.Index_Agent = dbo.Tbl_Agents.Index_Agent GROUP BY Tbl_Agents.Index_Agent, Tbl_Horaires.Index_Horaire"
Me.DS = Me.objDATA.getRows(Me.rqSql, "TBL_Subdivision")
Dim I = 0
Dim NbEnreg As Integer = DS.Tables(0).Rows.Count - 1
If DS.Tables(0).Rows(0).Item(1) IsNot DBNull.Value Then
horaire = DS.Tables(0).Rows(0).Item(1)
End If
If DS.Tables(0).Rows(0).Item(0) IsNot DBNull.Value Then
Index_Agent = DS.Tables(0).Rows(0).Item(0)
End If
For I = 0 To NbEnreg
If horaire = 1 Then
Dim id As Integer
Me.rqSql = "INSERT INTO [GRH].[dbo].[Tbl_Historique_Conges]" & _
"(Droit_Normaux, Droit_ARTT, Consomation_Nom, Solde_Norm, Delta_N, Conso_ARTT, Solde_ARTT, Index_Agent)" & _
"VALUES(" & _
"'" & HB & "'" & _
",'" & HBARTT & "'" & _
",'" & 0 & "'" & _
",'" & HB & "'" & _
",'" & 0 & "'" & _
",'" & 0 & "'" & _
",'" & HBARTT & "'" & _
",'" & Index_Agent & " ');" & _
"; SELECT SCOPE_IDENTITY();"
id = Me.objDATA.actionRows(Me.rqSql)
End If
Next
End Sub |
Partager