Example #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);
        }
Example #2
0
 public void ModifierRestaurant(Resto id, Resto nom, Resto telephone)
 {
 }
Example #3
0
        public bool RestaurantExiste(string nom)
        {
            Resto restoTest = bdd.Restos.FirstOrDefault(resto => resto.Nom == nom);

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