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 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
| Dim A, B, C, D, Ee, F, G, H, I, J, K, L, M, N, O, P, Q, R, w As String
Dim S, T, U, V As Integer
'recuperation des champs
Dim myNav As XPathNavigator = Me.MainDataSource.CreateNavigator()
Dim Aa As XPathNavigator = myNav.SelectSingleNode("/my:mesChamps/my:champ1", Me.NamespaceManager)
Dim Bb As XPathNavigator = myNav.SelectSingleNode("/my:mesChamps/my:champ3", Me.NamespaceManager)
Dim Cc As XPathNavigator = myNav.SelectSingleNode("/my:mesChamps/my:champ4", Me.NamespaceManager)
Dim Dd As XPathNavigator = myNav.SelectSingleNode("/my:mesChamps/my:champ5", Me.NamespaceManager)
Dim Eee As XPathNavigator = myNav.SelectSingleNode("/my:mesChamps/my:champ2", Me.NamespaceManager)
Dim Ff As XPathNavigator = myNav.SelectSingleNode("/my:mesChamps/my:champ6", Me.NamespaceManager)
Dim Gg As XPathNavigator = myNav.SelectSingleNode("/my:mesChamps/my:champ8", Me.NamespaceManager)
Dim Hh As XPathNavigator = myNav.SelectSingleNode("/my:mesChamps/my:champ9", Me.NamespaceManager)
Dim Ii As XPathNavigator = myNav.SelectSingleNode("/my:mesChamps/my:champ11", Me.NamespaceManager)
Dim Jj As XPathNavigator = myNav.SelectSingleNode("/my:mesChamps/my:champ12", Me.NamespaceManager)
Dim Kk As XPathNavigator = myNav.SelectSingleNode("/my:mesChamps/my:champ13", Me.NamespaceManager)
Dim Ll As XPathNavigator = myNav.SelectSingleNode("/my:mesChamps/my:champ14", Me.NamespaceManager)
Dim Mm As XPathNavigator = myNav.SelectSingleNode("/my:mesChamps/my:champ20", Me.NamespaceManager)
Dim Nn As XPathNavigator = myNav.SelectSingleNode("/my:mesChamps/my:champ21", Me.NamespaceManager)
Dim Oo As XPathNavigator = myNav.SelectSingleNode("/my:mesChamps/my:champ22", Me.NamespaceManager)
Dim Pp As XPathNavigator = myNav.SelectSingleNode("/my:mesChamps/my:champ23", Me.NamespaceManager)
Dim Qq As XPathNavigator = myNav.SelectSingleNode("/my:mesChamps/my:champ24", Me.NamespaceManager)
Dim Rr As XPathNavigator = myNav.SelectSingleNode("/my:mesChamps/my:champ25", Me.NamespaceManager)
Dim Ss As XPathNavigator = myNav.SelectSingleNode("/my:mesChamps/my:champ29", Me.NamespaceManager)
Dim Tt As XPathNavigator = myNav.SelectSingleNode("/my:mesChamps/my:champ30", Me.NamespaceManager)
Dim Uu As XPathNavigator = myNav.SelectSingleNode("/my:mesChamps/my:champ31", Me.NamespaceManager)
Dim Vv As XPathNavigator = myNav.SelectSingleNode("/my:mesChamps/my:champ32", Me.NamespaceManager)
A = Aa.Value
B = Bb.Value
C = Cc.Value
D = Dd.Value
Ee = Eee.Value
F = Ff.Value
G = Gg.Value
H = Hh.Value
I = Ii.Value
J = Jj.Value
K = Kk.Value
L = Ll.Value
M = Mm.Value
N = Nn.Value
O = Oo.Value
P = Pp.Value
Q = Qq.Value
R = Rr.Value
w = Vv.Value
'creation de la connexion a la base de donnees
Dim myConnection As New SqlConnection
Dim SQL,SQL1, nbrDMD, variable_texte, variable_numérique, numDID As String
Dim myCommand, myCommand1 As SqlCommand
Dim myReader As SqlDataReader
myConnection.ConnectionString = "Data Source=PEMCODEV\SQLEXPRESS;Initial Catalog=Gestetud;Integrated Security=True"
'ouverture de la connexion
myConnection.Open()
'Effectuer ici des opérations sur la base
'SQL = "EXECUTE dbo.ajoutDID '" + numDID + "','" + I + "','" + R + "','" + J + "','" + A + "','" + F + "','" + G + "','" + H + "'," + w
nbrDMD = "select count(Num_Demande) from DID"
myCommand1 = New SqlCommand(nbrDMD, myConnection)
myReader = myCommand1.ExecuteReader()
myReader.Read()
'traitement des resultats
variable_numérique = myReader.GetValue(0)
myReader.Close()
'formation des num_DID
Dim nbr As Integer = variable_numérique + 1
'test de la fonction code strusture
Dim testf As String
'testf = maFonction("ok")
'recuperation de l'annee
'Renvoie : 07.02.2012 09:09
Dim dat As Date
Dim an As String
dat = Date.Now
an = dat.ToString("yy")
'MessageBox.Show(dat.ToString("yy"))
numDID = an + "-" + testf + "-" + nbr.ToString
'les structures concernee sont dans J
'recuperation des structures concernee
Dim testR As String
testR = recupstructF("jj")
'Effectuer ici des opérations sur la base
SQL = "EXECUTE dbo.Ajout_DID '" + numDID + "','" + I + "','" + R + "','" + testR + "','" + A + "','" + F + "','" + G + "','" + H + "'," + w
SQL1 = "EXECUTE dbo.Ajout_DETAILS_PRIX '" + numDID + "','" + I + "','" + R + "','" + testR + "','" + A + "','" + F + "','" + G + "','" + H + "'," + w
myCommand = New SqlCommand(SQL, myConnection)
myReader = myCommand.ExecuteReader()
myReader.Read()
'traitement des resultats
myReader.Close()
myConnection.Close()
'Récupérer les valeurs du SELECT
'Les numéros de colonnes du SELECT commence à 0 et non à 1
'variable_texte = myReader.GetString(num_colonne)
'variable_numérique = myReader.GetValue(num_colonne)
'appel de fonction test
'k = myFunction(2)
'test de bip
'Console.Beep(4000, 800)
Dim message As String
'message = maFonction("/my:mesChamps/my:champ1")
Dim caption As String
caption = "Form Closing"
'MessageBox.Show(SQL, caption, MessageBoxButtons.YesNo, MessageBoxIcon.Question)
' Create XPathNavigator positioned at the root of the main data
' source.
' Dim myNav As XPathNavigator = Me.MainDataSource.CreateNavigator()
' selectionner les champ4 et mettre leur valeur au nom du user.
' myNav.SelectSingleNode("/my:mesChamps/my:champ4", Me.NamespaceManager). _
'SetValue(System.Environment.UserName)
'selectionner les champ4 et mettre leur valeur au resultat de la fonction test
'myNav.SelectSingleNode("/my:mesChamps/my:champ4", Me.NamespaceManager). _
'SetValue(myFunction(2))
End Sub |
Partager