예제 #1
0
 public Praticien(int UnCode, string UneRaison_sociale, string UneAdresse, string UnTelephone, string UnContact, int UnCoef_notoriete, int UnCoef_confiance, Specialite specPra)
 {
     code           = UnCode;
     raison_sociale = UneRaison_sociale;
     adresse        = UneAdresse;
     telephone      = UnTelephone;
     contact        = UnContact;
     coef_notoriete = UnCoef_notoriete;
     coef_confiance = UnCoef_confiance;
     spec           = specPra;
 }
예제 #2
0
        private void actualiserPraticien()
        {
            listPraticiens = DAOPraticien.listePraticien();

            dgvPraticiens.Rows.Clear();

            for (int i = 0; i < listPraticiens.Count; i++)
            {
                Praticien  p = listPraticiens.ElementAt(i);
                Specialite s = p.Spec;
                dgvPraticiens.Rows.Add(p.Code, p.Contact, p.Raison_sociale, p.Adresse, p.Telephone, p.Coef_notoriete, p.Coef_confiance, s.NomSpecialite);
            }
        }
예제 #3
0
        private void btnPraRechercher_Click(object sender, EventArgs e)
        {
            listPraticiens = DAOPraticien.ListePraticiensRecherche(txbPraRechercher.Text);

            dgvPraticiens.Rows.Clear();

            for (int i = 0; i < listPraticiens.Count; i++)
            {
                Praticien  p = listPraticiens.ElementAt(i);
                Specialite s = p.Spec;
                dgvPraticiens.Rows.Add(p.Code, p.Contact, p.Raison_sociale, p.Adresse, p.Telephone, p.Coef_notoriete, p.Coef_confiance, s.NomSpecialite);
            }
        }
예제 #4
0
 public static int getIdSpecialitePraticien(Specialite nomSpecialite)
 {
     try
     {
         String        req = "Select idSpecialite from Praticien WHERE idSpecialite = ( Select idSpecialite from Specialite WHERE nomSpecialite=" + nomSpecialite + ";";
         SqlDataReader rs;
         DAOFactory    db = new DAOFactory();
         db.connexion();
         rs  = db.execSQLread(req);
         res = rs.GetInt32(0);
     }
     catch (Exception e)
     {
         MessageBox.Show("ERROR : " + e);
     }
     return(res);
 }
예제 #5
0
        public static List <Praticien> ListePraticiensRecherche(string text)
        {
            string           Req = "select Code, Raison_sociale, Adresse, Telephone, Contact, Coef_notoriete, coef_confiance, praticien.idSpecialite, nomSpecialite FROM praticien INNER JOIN specialite on praticien.idSpecialite = specialite.idSpecialite where raison_sociale Like '%" + text + "%' OR adresse Like '%" + text + "%'OR telephone Like '%" + text + "%' OR contact Like '%" + text + "%'OR coef_confiance Like '%" + text + "%' OR coef_notoriete Like '%" + text + "%' OR nomSpecialite Like '%" + text + "%' ;";
            List <Praticien> LesPraticiensRecherche = new List <Praticien>();

            try
            {
                SqlDataReader dr;
                DAOFactory    db = new DAOFactory();
                db.connexion();
                dr = db.execSQLread(Req);
                while (dr.Read())
                {
                    Specialite specialite = new Specialite(Int32.Parse(dr[7].ToString()), dr[8].ToString());
                    Praticien  pra        = new Praticien(Int32.Parse(dr[0].ToString()), dr[1].ToString(), dr[2].ToString(), dr[3].ToString(), dr[4].ToString(), Int32.Parse(dr[5].ToString()), Int32.Parse(dr[6].ToString()), specialite);
                    LesPraticiensRecherche.Add(pra);
                }
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
            }
            return(LesPraticiensRecherche);
        }