Beispiel #1
0
        public BeerIndexVM()
        {
            Beer beer = new Beer(1234567, "Heiniken", "Amber", false);
            Beer beer1 = new Beer(7654321, "Abel", "Victory", true);

            Beers = new List<Beer>();

            Beers.Add(beer);
            Beers.Add(beer1);
        }
Beispiel #2
0
        public BeerIndexVM()
        {
            //Hard coded this for testing
            //You will never be able to delete these two beer because they will get added again everytime

            Beer beer = new Beer(1234567, "Heiniken", "Amber", false);
            Beer beer1 = new Beer(7654321, "Abel", "Victory", true);

            Beers = new List<Beer>();

            Beers.Add(beer);
            Beers.Add(beer1);
        }
        public ActionResult Edit(BeerEditVM model)
        {
            //This thread we sleep for a small fraction of time to see the Ladda to take effect
            Thread.Sleep(2000);

            var model1 = new BeerIndexVM();

            var beer = new Beer()
            {
                //The ID I hard coded for testing purposes
                Id = 9568369+1,
                Name = model.Name,
                Colour = model.Colour,
                HasTried = model.HasTried

            };

            model1.Beers.Add(beer);

            return Json(beer, JsonRequestBehavior.AllowGet);
        }