public void MettreAJourEntrepriseRdf(EntrepriseRdf entrepriseRdf) { _connexion.Open(); _requete = new MySqlCommand("UPDATE EntrepriseRdf SET raisonSociale=@raisonSociale, adresse=@adresse, ville=@ville, codePostal=@codePostal WHERE id=@id ", _connexion); _requete.Parameters.Add(new MySqlParameter("@raisonSociale", entrepriseRdf.RaisonSociale)); _requete.Parameters.Add(new MySqlParameter("@adresse", entrepriseRdf.Adresse)); _requete.Parameters.Add(new MySqlParameter("@ville", entrepriseRdf.Ville)); _requete.Parameters.Add(new MySqlParameter("@codePostal", entrepriseRdf.CodePostal)); _requete.Parameters.Add(new MySqlParameter("@id", entrepriseRdf.Id)); _requete.ExecuteNonQuery(); _connexion.Close(); }
public Sinistre(int id, string type, string adresse, string ville, string codePostal, DateTime dateSurvenance, string causesEtCirconstances, string origine, string rdf, string origineSinistre, EntrepriseRdf entrepriseRdf) { this._id = id; this._type = type; this._adresse = adresse; this._ville = ville; this._codePostal = codePostal; this._dateSurvenance = dateSurvenance; this._causesEtCirconstances = causesEtCirconstances; this._origine = origine; this._rdf = rdf; this._origineSinistre = origine; this._entrepriseRdf = entrepriseRdf; }
public Sinistre() { this._id = 0; this._type = ""; this._adresse = ""; this._ville = ""; this._codePostal = ""; // this._causesEtCirconstances = ""; this._origine = ""; this._rdf = ""; this._origineSinistre = ""; this._entrepriseRdf = new EntrepriseRdf(); }
public EntrepriseRdf RechercherEntrepriseRdfParId(int id) { EntrepriseRdf entrepriseRdf; _connexion.Open(); _requete = new MySqlCommand("SELECT * FROM EntrepriseRdf WHERE id=@id", _connexion); _requete.Parameters.Add(new MySqlParameter("@id", id)); MySqlDataReader dr = _requete.ExecuteReader(); dr.Read(); entrepriseRdf = new EntrepriseRdf(Convert.ToInt32(dr["id"]), dr["raisonSociale"].ToString(), dr["adresse"].ToString(), dr["ville"].ToString(), dr["codePostal"].ToString()); _connexion.Close(); return(entrepriseRdf); }