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
|
Imports System.Data.SqlClient
Imports System.Configuration
Partial Class f_affaire_victime
Inherits System.Web.UI.Page
Private SqlCon As SqlConnection
Protected Sub Page_InitComplete(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.InitComplete
SqlCon = New SqlConnection
SqlCon.ConnectionString = ConfigurationManager.ConnectionStrings("CyberPlainte").ToString
End Sub
Dim ReferenceVictime As String = nature_piece.Text & numero_piece.Text
If GloGlobal.NouvelleVictime Then
ExecuteLDD("insert into t_victime (personne,identifiant,naturepceidentite,numeropceidentite,nom,prenom,datenaissance,sexe,tel,mail,adresse,paysresidence,ville,paysnationalite,profession,employeur,situationmatrimoniale,nbenfant,dateenreg) values ('" & personne.Text & "','" & ReferenceVictime & "','" & nature_piece.Text & "','" & numero_piece.Text & "','" & GloGlobal.ValiderApostrophe(nom.Text) & "','" & GloGlobal.ValiderApostrophe(prenom.Text) & "','" & date_naissance.Text & "','" & sexe.Text & "','" & tel_fax.Text & "','" & GloGlobal.ValiderApostrophe(email.Text) & "','" & GloGlobal.ValiderApostrophe(adresse_postale.Text) & "','" & GloGlobal.ValiderApostrophe(pays_residence.Text) & "','" & GloGlobal.ValiderApostrophe(ville_residence.Text) & "','" & GloGlobal.ValiderApostrophe(pays_origine.Text) & "','" & GloGlobal.ValiderApostrophe(profession.Text) & "','" & GloGlobal.ValiderApostrophe(employeur.Text) & "','" & situation_matrimoniale.Text & "'," & GloGlobal.ValiderDecimal(nombre_enfant_en_charge.Text) & ",'" & Date.Today & "')")
GloGlobal.NouvelleAffaire = True
Else
ExecuteLDD("update t_victime set personne='" & personne.Text & "',identifiant='" & ReferenceVictime & "',naturepceidentite='" & nature_piece.Text & "',numeropceidentite='" & numero_piece.Text & "',nom='" & GloGlobal.ValiderApostrophe(nom.Text) & "',prenom='" & GloGlobal.ValiderApostrophe(prenom.Text) & "',datenaissance='" & date_naissance.Text & "',sexe='" & sexe.Text & "',tel='" & tel_fax.Text & "',mail='" & email.Text & "',adresse='" & GloGlobal.ValiderApostrophe(adresse_postale.Text) & "',paysresidence='" & GloGlobal.ValiderApostrophe(pays_residence.Text) & "',ville='" & GloGlobal.ValiderApostrophe(ville_residence.Text) & "',paysnationalite='" & GloGlobal.ValiderApostrophe(pays_origine.Text) & "',profession='" & GloGlobal.ValiderApostrophe(profession.Text) & "',employeur='" & GloGlobal.ValiderApostrophe(employeur.Text) & "',situationmatrimoniale='" & situation_matrimoniale.Text & "',nbenfant=" & GloGlobal.ValiderDecimal(nombre_enfant_en_charge.Text) & " where (identifiant='" & GloGlobal.IdVictime & "')")
End If
GloGlobal.NouvelleVictime = False
GloGlobal.IdVictime = ReferenceVictime
Response.Redirect("f_affaire.aspx", False)
End Sub
Private Sub ExecuteLDD(ByVal bSql As String)
Dim CMD As New SqlCommand
SqlCon.Open()
CMD.Connection = SqlCon
CMD.CommandText = bSql
CMD.ExecuteNonQuery()
SqlCon.Close()
End Sub
End Class |
Partager