Example #1
0
 public void MettreAJourAssuranceDommageOuvrage(AssuranceDommageOuvrage assuranceDommageOuvrage)
 {
     _connexion.Open();
     _requete = new MySqlCommand("UPDATE AssuranceDommageOuvrage SET raisonSociale=@raisonSociale, adresse=@adresse, ville=@ville,  codePostal=@codePostal, numeroContrat=@numeroContrat, effetDu=@effetDu WHERE id=@id ", _connexion);
     _requete.Parameters.Add(new MySqlParameter("@raisonSociale", assuranceDommageOuvrage.RaisonSociale));
     _requete.Parameters.Add(new MySqlParameter("@adresse", assuranceDommageOuvrage.Adresse));
     _requete.Parameters.Add(new MySqlParameter("@ville", assuranceDommageOuvrage.Ville));
     _requete.Parameters.Add(new MySqlParameter("@codePostal", assuranceDommageOuvrage.CodePostal));
     _requete.Parameters.Add(new MySqlParameter("@numeroContrat", assuranceDommageOuvrage.NumeroContrat));
     _requete.Parameters.Add(new MySqlParameter("@effetDu", assuranceDommageOuvrage.EffetDu));
     _requete.Parameters.Add(new MySqlParameter("@id", assuranceDommageOuvrage.Id));
     _requete.ExecuteNonQuery();
     _connexion.Close();
 }
Example #2
0
        public Risque RechercherRisqueParId(int id)
        {
            Risque risque;
            AssuranceDommageOuvrage assuranceDommageOuvrage = RechercherAssuranceDommageOuvrageParId(id);

            _connexion.Open();
            _requete = new MySqlCommand("SELECT * FROM Risque WHERE id=@id", _connexion);
            _requete.Parameters.Add(new MySqlParameter("@id", id));

            MySqlDataReader dr = _requete.ExecuteReader();

            dr.Read();
            risque = new Risque(Convert.ToInt32(dr["id"]), dr["type"].ToString(), dr["dateConstruction"].ToString(), Convert.ToInt32(dr["anneeConstruction"]), dr["typeMur"].ToString(), Convert.ToInt32(dr["anneeConstructionMur"]), dr["typeCouverture"].ToString(), Convert.ToInt32(dr["anneeConstructionCouverture"]), dr["utilite"].ToString(), Convert.ToBoolean(dr["batimentClasse"]), dr["etat"].ToString(), dr["piecePrincipaleAuContrat"].ToString(), dr["piecePrincipaleConstatee"].ToString(), dr["dependanceAuContrat"].ToString(), dr["dependanceConstatee"].ToString(), dr["details"].ToString(), Convert.ToBoolean(dr["conformite"]), dr["motif"].ToString(), dr["amiante"].ToString(), Convert.ToBoolean(dr["assuranceDommageOuvrage"]), assuranceDommageOuvrage);
            _connexion.Close();
            return(risque);
        }
Example #3
0
        public AssuranceDommageOuvrage RechercherAssuranceDommageOuvrageParId(int id)
        {
            AssuranceDommageOuvrage assuranceDommageOuvrage;

            _connexion.Open();
            _requete = new MySqlCommand("SELECT * FROM AssuranceDommageOuvrage WHERE id=@id", _connexion);
            _requete.Parameters.Add(new MySqlParameter("@id", id));

            MySqlDataReader dr = _requete.ExecuteReader();

            dr.Read();
            assuranceDommageOuvrage = new AssuranceDommageOuvrage(Convert.ToInt32(dr["id"]), dr["raisonSociale"].ToString(), dr["adresse"].ToString(), dr["ville"].ToString(), dr["codePostal"].ToString(), dr["numeroContrat"].ToString(), Convert.ToDateTime(dr["effetDu"]));

            _connexion.Close();
            return(assuranceDommageOuvrage);
        }
 public Risque(int id, string type, string dateConstruction, int anneeConstruction, string typeMur, int anneeConstructionMur, string typeCouverture, int anneeConstructionCouverture, string utilite, bool batimentClasse, string etat, string piecePrincipaleAuContrat, string piecePrincipaleConstatee, string dependanceAuContrat, string dependanceConstatee, string details, bool conformite, string motif, string amiante, bool assuranceDommageOuvrageSouscrite, AssuranceDommageOuvrage assuranceDommageOuvrage)
 {
     this._id                               = id;
     this._type                             = type;
     this._dateConstruction                 = dateConstruction;
     this._anneeConstruction                = anneeConstruction;
     this._typeMur                          = typeMur;
     this._anneeConstructionMur             = anneeConstructionMur;
     this._typeCouverture                   = typeCouverture;
     this._anneeConstructionCouverture      = anneeConstructionCouverture;
     this._utilite                          = utilite;
     this._batimentClasse                   = batimentClasse;
     this._etat                             = etat;
     this._piecePrincipaleAuContrat         = piecePrincipaleAuContrat;
     this._piecePrincipaleConstatee         = piecePrincipaleConstatee;
     this._dependanceAuContrat              = dependanceAuContrat;
     this._dependanceConstatee              = dependanceConstatee;
     this._details                          = details;
     this._conformite                       = conformite;
     this._motif                            = motif;
     this._amiante                          = amiante;
     this._assuranceDommageOuvrageSouscrite = assuranceDommageOuvrageSouscrite;
     this._assuranceDommageOuvrage          = assuranceDommageOuvrage;
 }
 public Risque()
 {
     this._id                               = 0;
     this._type                             = "";
     this._dateConstruction                 = "";
     this._anneeConstruction                = 0;
     this._typeMur                          = "";
     this._anneeConstructionMur             = 0;
     this._typeCouverture                   = "";
     this._anneeConstructionCouverture      = 0;
     this._utilite                          = "";
     this._batimentClasse                   = true;
     this._etat                             = "";
     this._piecePrincipaleAuContrat         = "";
     this._piecePrincipaleConstatee         = "";
     this._dependanceAuContrat              = "";
     this._dependanceConstatee              = "";
     this._details                          = "";
     this._conformite                       = true;
     this._motif                            = "";
     this._amiante                          = "";
     this._assuranceDommageOuvrageSouscrite = true;
     this._assuranceDommageOuvrage          = new AssuranceDommageOuvrage();
 }