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
| Imports System.Data.SqlClient
Imports Microsoft.VisualBasic
Imports System
Imports System.Text
Imports System.CodeDom.Compiler
Imports System.Reflection
Imports System.Data
Imports Oracle.DataAccess.Client
Imports Oracle.DataAccess.Types
Module CodeFile1
Function TaTombee(ByVal Historiques_Courriers As String, ByVal EVENEMNT As String) As DataTable
Dim connectionSQL As New SqlConnection
Dim Mycommand As SqlCommand
Dim maRequeteSql As String
Dim conn As New OracleConnection
Dim maRequeteOracle As String
Dim TOMBEE As New SqlDataAdapter()
connectionSQL.Open()
Mycommand = New SqlCommand("delete from TOMBEE,insert into TOMBEE(CODCLI,NUMCRE,NUMTIR) SELECT CODCLI,NUMCRED,NUMTIR from HISTORIQUES_COURRIERS")
maRequeteSql = "SELECT ECHGLOB * 1 ,AMORTISS * 1 ,INTERETS * 1 as ECHOGLOB ,AMORTISST ,INTERET from HISTOIQUES_COURRIERS where TOMBEE.CODCLI=HISTORIQUES_COURRIERS.CODCLI"
Mycommand = New SqlCommand(maRequeteSql)
connectionSQL.Close()
Dim cmd As New OracleCommand
conn.Open()
cmd.Connection = conn
cmd.CommandType = CommandType.Text
cmd.CommandText = "insert into TOMBEE(CODCLI,NUMCRE) select EVENT_CLIENT,EVENT_CREDIT from EVENEMNT"
maRequeteOracle = "select EVENMT_MONTANT * -1 as EVENMT_MONTANT from EVENEMNT where EVENEMNT.EVENMT_CLIENT= TOMBEE.EVENMT_CLIENT"
Mycommand = New SqlCommand(maRequeteOracle)
conn.Close()
Dim SOMME As New DataColumn()
SOMME.ColumnName = "SOMM"
SOMME.DataType = GetType(Double)
SOMME.Expression = "select sum (ECHGLOB + EVENMT_MONTANT) as SOMM from TOMBEE where TOMBEE.CODCLI=TOMBEE.EVENMT_CLIENT "
Dim sum As Double
sum = "select SOMM from TOMBEE"
If sum <> 0 Then
Console.WriteLine("il ya un ecart")
Else
Console.WriteLine("il n'ya pas d'ecart")
End If
End Function
End Module |
Partager