Exemplo n.º 1
0
        public FakeFestivalRepository()
        {
            festivals = new List<Festival>();

            for (int i = 0; i < 100; i++)
            {
                var festival = new Festival();
                festival.Name = "Festival " + i;
                festival.Description = "Rad Festival " + i;
                festival.StartDate = DateTime.Now.AddDays(i);
                festival.FinishDate = DateTime.Now.AddDays(i + 3);
                festival.Country = "My Country" + i;
                festival.Website = "www." + i + ".com";

                festivals.Add(festival);

            }
        }
Exemplo n.º 2
0
        public ActionResult Create(Festival festival)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    // TODO: Add insert logic here
                    _repository.Add(festival);

                    return RedirectToAction("CreateComplete");
                }
                catch
                {
                    return View(festival);
                }

            }
            else
            {
                return View(festival);
            }
        }
Exemplo n.º 3
0
 public void Update(Festival festival)
 {
     var ListFestival = GetFestival(festival.FestivalId);
     Delete(ListFestival);
     Add(festival);
 }
Exemplo n.º 4
0
 public void Delete(Festival festival)
 {
     var ListFestival = GetFestival(festival.FestivalId);
     festivals.Remove(ListFestival);
 }
Exemplo n.º 5
0
 public void Add(Festival festival)
 {
     festivals.Add(festival);
 }