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
| ' avec le DTO 1 seul paramètre
Public Sub EnregPerson(ByVal UnePersonne As PersonDTO, ByVal Ins As Boolean)
Const K_REQUETTE_INSERT As String = "insert into personnes ([PersonId], [City], [Email], [ImAddress], [ImType], [LanguageId], [NamePers], [NickName], [Password], [PhoneHome], [PhoneMobile], [State], [TimeZoneId], [UtcCreated], [UtcModified], [ZipCode], [SpeakFrench]) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) "
Dim req As String = "update personnes set City=?, [Email]=?, [ImAddress]=?, [ImType]=?, [LanguageId]=?, [NamePers]=?, [NickName]=?, [Password]=?, [PhoneHome]=?, [PhoneMobile]=?, [State]=?, [TimeZoneId]=?, [UtcCreated]=?, [UtcModified]=?, [ZipCode]=?,SpeakFrench=? where PersonId = ?"
Dim res As Integer
If Ins Then req = K_REQUETTE_INSERT
Try
DALApp.EffaceListParam()
If Ins Then DALApp.AjouteParam("PersonId", DbType.Int32, UnePersonne.PersonId)
DALApp.AjouteParam("City", DbType.String, UnePersonne.City)
DALApp.AjouteParam("Email", DbType.String, UnePersonne.Email)
DALApp.AjouteParam("ImAddress", DbType.String, UnePersonne.ImAddress)
DALApp.AjouteParam("ImType", DbType.Int32, UnePersonne.ImType)
DALApp.AjouteParam("LanguageId", DbType.Int32, UnePersonne.LanguageId)
DALApp.AjouteParam("NamePers", DbType.String, UnePersonne.NamePers)
DALApp.AjouteParam("NickName", DbType.String, UnePersonne.NickName)
DALApp.AjouteParam("Password", DbType.String, UnePersonne.Password)
DALApp.AjouteParam("PhoneHome", DbType.String, UnePersonne.PhoneHome)
DALApp.AjouteParam("PhoneMobile", DbType.String, UnePersonne.PhoneMobile)
DALApp.AjouteParam("State", DbType.String, UnePersonne.State)
DALApp.AjouteParam("TimeZoneId", DbType.Int32, UnePersonne.TimeZoneId)
DALApp.AjouteParam("UtcCreated", DbType.Date, "20/05/2013")
DALApp.AjouteParam("UtcModified", DbType.Date, "31/05/2013")
DALApp.AjouteParam("ZipCode", DbType.Int32, 6)
DALApp.AjouteParam("SpeakFrench", DbType.Boolean, True)
If Not Ins Then DALApp.AjouteParam("PersonId", DbType.Int32, UnePersonne.PersonId)
DALApp.ExecuterCommande(req, res)
Catch ex As Exception
End Try
End Sub |
Partager