示例#1
0
 public Intervenant(int id, Dossier dossier, string nom, string prenom, string adresse, string ville, string codePostal, string telephone, string mail, bool statut, bool presence, string qualite, string typeLieu, string utilite, string etat, string etage, string remarque, string numeroContrat, string numeroSinistre, Representant representant, Compagnie compagnie, Assureur assureur, Expert expert, int idDossier)
 {
     this._id             = id;
     this._nom            = nom;
     this._prenom         = prenom;
     this._adresse        = adresse;
     this._ville          = ville;
     this._codePostal     = codePostal;
     this._telephone      = telephone;
     this._mail           = mail;
     this._statut         = statut;
     this._presence       = presence;
     this._qualite        = qualite;
     this._typeLieu       = typeLieu;
     this._utilite        = utilite;
     this._etat           = etat;
     this._etage          = etage;
     this._remarque       = remarque;
     this._numeroContrat  = numeroContrat;
     this._numeroSinistre = numeroSinistre;
     this._representant   = representant;
     this._compagnie      = compagnie;
     this._assureur       = assureur;
     this._expert         = expert;
     this._idDossier      = idDossier;
 }
示例#2
0
        public Assureur RechercherAssureurParId(int id)
        {
            // Récupération de idRepresentant
            int idRepresentant;

            _connexion.Open();
            _requete = new MySqlCommand("SELECT idRepresentant FROM Assureur WHERE id=@id", _connexion);
            _requete.Parameters.Add(new MySqlParameter("@id", id));
            idRepresentant = Convert.ToInt32(_requete.ExecuteScalar());
            _connexion.Close();

            // Création du représentant
            Representant representant = RechercherRepresentantParId(idRepresentant);

            // Création de l'assureur (passage du représentant en paramètre)
            Assureur assureur;

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

            MySqlDataReader dr = _requete.ExecuteReader();

            dr.Read();
            assureur = new Assureur(Convert.ToInt32(dr["id"]), dr["raisonSociale"].ToString(), dr["adresse"].ToString(), dr["ville"].ToString(), dr["codePostal"].ToString(), dr["telephone"].ToString(), dr["mail"].ToString(), representant);

            _connexion.Close();
            return(assureur);
        }
示例#3
0
 public Intervenant()
 {
     this._id             = 0;
     this._nom            = "";
     this._prenom         = "";
     this._adresse        = "";
     this._ville          = "";
     this._codePostal     = "";
     this._telephone      = "";
     this._mail           = "";
     this._statut         = true;
     this._presence       = true;
     this._qualite        = "";
     this._typeLieu       = "";
     this._utilite        = "";
     this._etat           = "";
     this._etage          = "";
     this._remarque       = "";
     this._numeroContrat  = "";
     this._numeroSinistre = "";
     this._representant   = new Representant();
     this._compagnie      = new Compagnie();
     this._assureur       = new Assureur();
     this._expert         = new Expert();
     // this._idDossier = 0;
 }
示例#4
0
 public Assureur(int id, string raisonSociale, string adresse, string ville, string codePostal, string telephone, string mail, Representant representant)
 {
     this._id            = id;
     this._raisonSociale = raisonSociale;
     this._adresse       = adresse;
     this._ville         = ville;
     this._codePostal    = codePostal;
     this._telephone     = telephone;
     this._mail          = mail;
     this._representant  = representant;
 }
示例#5
0
 public Assureur()
 {
     this._id            = 0;
     this._raisonSociale = "";
     this._adresse       = "";
     this._ville         = "";
     this._codePostal    = "";
     this._telephone     = "";
     this._mail          = "";
     this._representant  = new Representant();
 }
示例#6
0
 public void MettreAJourRepresentant(Representant representant)
 {
     _connexion.Open();
     _requete = new MySqlCommand("UPDATE Representant SET nom=@nom, prenom=@prenom, telephone=@telephone, mail=@mail, qualite=@qualite WHERE id=@id ", _connexion);
     _requete.Parameters.Add(new MySqlParameter("@nom", representant.Nom));
     _requete.Parameters.Add(new MySqlParameter("@prenom", representant.Prenom));
     _requete.Parameters.Add(new MySqlParameter("@telephone", representant.Telephone));
     _requete.Parameters.Add(new MySqlParameter("@mail", representant.Mail));
     _requete.Parameters.Add(new MySqlParameter("@qualite", representant.Qualite));
     _requete.Parameters.Add(new MySqlParameter("@id", representant.Id));
     _requete.ExecuteNonQuery();
     _connexion.Close();
 }
示例#7
0
        // ############################################################################################################## \\
        //                                       FONCTIONS (Resultat requete) -> Objet                                    \\
        // ############################################################################################################## \\
        //
        // Sinistre mission contrat dossier intervenant dossier
        //  - RechercherRepresentantParId(int) -> Representant
        //  -

        public Representant RechercherRepresentantParId(int id)
        {
            Representant representant;

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

            MySqlDataReader dr = _requete.ExecuteReader();

            dr.Read();
            representant = new Representant(Convert.ToInt32(dr["id"]), dr["nom"].ToString(), dr["prenom"].ToString(), dr["telephone"].ToString(), dr["mail"].ToString(), dr["qualite"].ToString());

            _connexion.Close();
            return(representant);
        }
 public Client(int id, int idClientExistant, string nom, string prenom, string adresse, string ville, string codePostal, string telephone, string mail, string raisonSociale, string adresseSiegeSocial, string villeSiegeSocial, string codePostalSiegeSocial, string telephoneClientPro, Representant representant)
 {
     this._id = id;
     this._idClientExistant = idClientExistant;
     this._nom                    = nom;
     this._prenom                 = prenom;
     this._adresse                = adresse;
     this._ville                  = ville;
     this._codePostal             = codePostal;
     this._telephone              = telephone;
     this._mail                   = mail;
     this._raisonSociale          = raisonSociale;
     this._adresseSiegeSocial     = adresseSiegeSocial;
     this._villeSiegeSocial       = villeSiegeSocial;
     this._codePostalSiegeSocial  = codePostalSiegeSocial;
     this._telephoneProfessionnel = telephoneClientPro;
     this._representant           = representant;
 }
 public Client()
 {
     this._id = 0;
     this._idClientExistant = 0;
     this._nom                    = "";
     this._prenom                 = "";
     this._adresse                = "";
     this._ville                  = "";
     this._codePostal             = "";
     this._telephone              = "";
     this._mail                   = "";
     this._raisonSociale          = "";
     this._adresseSiegeSocial     = "";
     this._villeSiegeSocial       = "";
     this._codePostalSiegeSocial  = "";
     this._telephoneProfessionnel = "";
     this._representant           = new Representant();
 }
示例#10
0
        public Client RechercherClientParId(int id)
        {
            // Récupération de idClientExistant
            Client client;
            int    idClientExistant;
            int    idRepresentant;
            int    idClient;

            _connexion.Open();
            _requete = new MySqlCommand("SELECT idClientExistant FROM Client WHERE id=@id", _connexion);
            _requete.Parameters.Add(new MySqlParameter("@id", id));
            idClientExistant = Convert.ToInt32(_requete.ExecuteScalar());
            _connexion.Close();

            _connexion.Open();
            _requete = new MySqlCommand("SELECT idRepresentant FROM Client WHERE id=@id", _connexion);
            if (idClientExistant != 0)
            {
                // _requete.Parameters.Add(new MySqlParameter("@id", idClientExistant));
                idClient = idClientExistant;
            }
            else
            {
                // _requete.Parameters.Add(new MySqlParameter("@id", id));
                idClient = id;
            }
            _requete.Parameters.Add(new MySqlParameter("@id", idClient));
            idRepresentant = Convert.ToInt32(_requete.ExecuteScalar());
            _connexion.Close();

            Representant representant = RechercherRepresentantParId(idRepresentant);

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

            MySqlDataReader dr = _requete.ExecuteReader();

            dr.Read();
            client = new Client(Convert.ToInt32(dr["id"]), Convert.ToInt32(dr["idClientExistant"]), dr["nom"].ToString(), dr["prenom"].ToString(), dr["adresse"].ToString(), dr["ville"].ToString(), dr["codePostal"].ToString(), dr["telephone"].ToString(), dr["mail"].ToString(), dr["raisonSociale"].ToString(), dr["adresseSiegeSocial"].ToString(), dr["villeSiegeSocial"].ToString(), dr["codePostalSiegeSocial"].ToString(), dr["telephoneProfessionnel"].ToString(), representant);
            _connexion.Close();

            return(client);
        }