Ejemplo n.º 1
0
        public List <Resultats> ObtenirLesResultats(int idSondage)
        {
            List <Resto>     restaurants = ObtientTousLesRestaurants();
            List <Resultats> resultats   = new List <Resultats>();
            Sondage          sondage     = listeDessondages.First(s => s.Id == idSondage);

            foreach (IGrouping <int, Vote> grouping in sondage.Votes.GroupBy(v => v.Resto.Id))
            {
                int   idRestaurant  = grouping.Key;
                Resto resto         = restaurants.First(r => r.Id == idRestaurant);
                int   nombreDeVotes = grouping.Count();
                resultats.Add(new Resultats {
                    Nom = resto.Nom, Telephone = resto.Telephone, NombreDeVotes = nombreDeVotes
                });
            }
            return(resultats);
        }
Ejemplo n.º 2
0
 public void ModifierRestaurant(Resto id, Resto nom, Resto telephone)
 {
 }
Ejemplo n.º 3
0
        public bool RestaurantExiste(string nom)
        {
            Resto restoTest = bdd.Restos.FirstOrDefault(resto => resto.Nom == nom);

            return(restoTest != null ? true : false);
        }
Ejemplo n.º 4
0
 // GET: Accueil
 public ActionResult Index()
 {
     Resto r = new Resto() {Nom = "La bonne bouffe", Telephone = "06 95 53 72 86"};
     return View(r);
 }