Beispiel #1
0
        public IList <Materiel> SearchMateriel()
        {
            IList <SearchMateriel_Result> maListeBDD;

            using (bdd_Daltons_ppe3Entities bdd = new bdd_Daltons_ppe3Entities())
            {
                maListeBDD = bdd.SearchMateriel().ToList();
            }

            // Translation vers une liste de matériel

            IList <Materiel> ListeMateriel = new List <Materiel>();

            foreach (SearchMateriel_Result one in maListeBDD)
            {
                Materiel temp = new Materiel();
                temp.id_materiel = one.id_materiel;
                temp.modele      = one.modele;
                temp.num_serie   = one.num_serie;

                ListeMateriel.Add(temp);
            }

            return(ListeMateriel);
        }
Beispiel #2
0
 public void DeleteMateriel(Materiel materiel)
 {
     using (bdd_Daltons_ppe3Entities bdd = new bdd_Daltons_ppe3Entities())
     {
         bdd.Configuration.ProxyCreationEnabled = false;
         bdd.DeleteMateriel(materiel.id_materiel);
     }
 }