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
| Public Function integrerLigne(ByVal maligne As String, ByVal pointVente As String)
Dim continuLigne As Boolean = True
Dim codeErreur As Int16
Dim ElementBis() As String = maligne.Split(";")
Dim v As Char = ","
Dim p As Char = "."
Dim sBis As String
Dim d1 As DateTime = New DateTime()
Dim i As Int16
Try
If (ElementBis(3).Equals("V") = True) Then
If (ElementBis(6).Contains(p)) Then
sBis = ElementBis(6).Replace(p, v)
Else
sBis = ElementBis(6)
End If
i = CInt(ElementBis(0))
Dim d As String = ElementBis(1)
Dim h As String = ElementBis(2).Substring(4, 4).Insert(2, ":")
Dim dh As String = d + " " + h
d1 = DateTime.Parse(dh)
bd.preparePs("dbo.test")
bd.addParam("@IdMachine", ParameterDirection.Input, DbType.Int16)
bd.fixerValeur("@IdMachine", i)
bd.addParam("@codeUNI", ParameterDirection.Input, DbType.String)
bd.fixerValeur("@codeUNI", pointVente)
bd.addParam("@date", ParameterDirection.Input, DbType.DateTime)
bd.fixerValeur("@date", d1)
bd.addParam("@decision", ParameterDirection.Input, DbType.String)
bd.fixerValeur("@decision", ElementBis(3))
bd.addParam("@codeModePaiement",ParameterDirection.Input, DbType.String)
bd.fixerValeur("@codeModePaiement", ElementBis(4))
bd.addParam("@nbTransaction", ParameterDirection.Input, DbType.Int16)
bd.fixerValeur("@nbTransaction", Int16.Parse(ElementBis(5)))
bd.addParam("@somme", ParameterDirection.Input, DbType.Decimal)
bd.fixerValeur("@somme", Decimal.Parse(sBis))
codeErreur = bd.executer()
continuLigne = True
If (codeErreur = 2) Then
continuLigne = False
End If
End If
Return continuLigne
Catch ex As Exception
MsgBox("ligne non valide" + bd.getLib + " " + pointVente + " " + i.ToString + " " + d1.ToString + " " + sBis)
End Try
End Function |
Partager