Beispiel #1
0
        //*********************************************************
        //******  RECHERCHE d'interaction par ID_materiel *********
        //*********************************************************
        /// <summary>
        /// RECHERCHE d'interaction par ID_materiel
        /// </summary>
        /// <param name="adresse">ID_materiel</param>
        /// <returns>liste interactions</returns>
        public Interactions Recherche_parMATERIEL(string materiel)
        {
            // Recupération des infos selon l'ID du materiel
            Interactions liste = new Interactions();

            liste.Clear();

            //****    Recherche Collection   ***
            foreach (Interaction i in this)
            {
                if (i.IDMateriel == materiel)
                {
                    liste.Add(i);
                    break;
                }
            }
            return(liste);
        }
Beispiel #2
0
        //*********************************************************
        //*******  RECHERCHE d'interaction par Id_Binome **********
        //*********************************************************
        /// <summary>
        /// RECHERCHE d'interaction par Id_Binome
        /// </summary>
        /// <param name="code">Id_Binome</param>
        /// <returns></returns>
        public Interactions Recherche_parIdBinome(string Binome)
        {
            // Recupération des infos selon un ID
            Interactions liste = new Interactions();

            liste.Clear();

            //****    Recherche Collection   ***
            foreach (Interaction i in this)
            {
                if (i.IdBinome == Binome)
                {
                    liste.Add(i);
                    break;
                }
            }
            return(liste);
        }
Beispiel #3
0
        //*********************************************************
        //*********  RECHERCHE d'interaction par Id_pro ***********
        //*********************************************************
        /// <summary>
        /// RECHERCHE d'interaction par Id_pro
        /// </summary>
        /// <param name="libelle">Id_pro</param>
        /// <returns>liste interactions</returns>
        public Interactions Recherche_parIdPro(string professionnel)
        {
            // Recupération des infos selon le LIBELLE
            Interactions liste = new Interactions();

            liste.Clear();

            //****    Recherche Collection   ***
            foreach (Interaction i in this)
            {
                if (i.IdPro == professionnel)
                {
                    liste.Add(i);
                    break;
                }
            }
            return(liste);
        }
        ////*******************************************************
        ////**********      Les Fonctions             *************
        ////*******************************************************

        //*********************************************************
        //***** Initialisation de la liste des Interactions *******
        //*********************************************************
        /// <summary>
        /// Initialisation de la liste des Interactions
        /// </summary>
        /// <param name="emp">Liste des Interactions</param>
        public static void Init_Interactions(Interactions inte)
        {
            //Connexion avec base de données
            try
            {
                inte.Clear();
                String[] result = new String[7];

                // Requête Sql
                String strSql = "Select * from INTERACTION";

                //// Execution de la requete
                IDataReader sqlRdr = DAO.Execute_Query(strSql);
                while (sqlRdr.Read())
                {
                    if (!sqlRdr.IsDBNull(0))
                    {
                        result[0] = sqlRdr.GetString(0);
                    }
                    else
                    {
                        result[0] = "<nc>";
                    }

                    if (!sqlRdr.IsDBNull(1))
                    {
                        result[1] = sqlRdr.GetString(1);
                    }
                    else
                    {
                        result[1] = "<nc>";
                    }

                    if (!sqlRdr.IsDBNull(2))
                    {
                        result[2] = sqlRdr.GetString(2);
                    }
                    else
                    {
                        result[2] = "<nc>";
                    }

                    if (!sqlRdr.IsDBNull(3))
                    {
                        result[3] = sqlRdr.GetString(3);
                    }
                    else
                    {
                        result[3] = "<nc>";
                    }


                    // Décomposition des ID
                    string[] temp = result[3].Split('-');
                    string   s0   = temp[0].Trim();
                    string   s1   = temp[1].Trim();
                    string   s2   = temp[2].Trim();
                    // Conversion des ID en entier
                    int etage = Convert.ToInt32(s0.Substring(s0.Length - 1, 1));
                    int allee = Convert.ToInt32(s1.Substring(s1.Length - 1, 1));
                    int rayon = Convert.ToInt32(s2.Substring(s2.Length - 1, 1));


                    // Ajout d'une interaction dans la liste
                    //us.Add(new Interaction(result[0], result[1], result[2], etage, allee, rayon)); /////////////////////////////////////////
                    //nb_materiel += 1;
                }

                //Fermeture de la requête
                sqlRdr.Close();
                sqlRdr = null;
            }
            catch (Exception ex)
            {
                // ==> Si erreur, la LISTE est vide
            }
        }