Ejemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            EntertainmentType entertainmentType = db.EntertainmentTypes.Find(id);

            db.EntertainmentTypes.Remove(entertainmentType);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
 public Entertainment(string title, string description, string genre, EntertainmentType type, double duration) : this()
 {
     Title             = title;
     Description       = description;
     Genre             = genre;
     EntertainmentType = type;
     Duration          = duration;
 }
Ejemplo n.º 3
0
 public ActionResult Edit([Bind(Include = "EntertainmentTypeId,EntertainmentsType")] EntertainmentType entertainmentType)
 {
     if (ModelState.IsValid)
     {
         db.Entry(entertainmentType).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(entertainmentType));
 }
Ejemplo n.º 4
0
        public ActionResult Create([Bind(Include = "EntertainmentTypeId,EntertainmentsType")] EntertainmentType entertainmentType)
        {
            if (ModelState.IsValid)
            {
                db.EntertainmentTypes.Add(entertainmentType);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(entertainmentType));
        }
Ejemplo n.º 5
0
        // GET: EntertainmentTypes/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            EntertainmentType entertainmentType = db.EntertainmentTypes.Find(id);

            if (entertainmentType == null)
            {
                return(HttpNotFound());
            }
            return(View(entertainmentType));
        }
Ejemplo n.º 6
0
 public IEnumerable <Entertainment> GetAllEntertainmentByType(EntertainmentType type)
 {
     return(_entertainmentRepository.getAllPerType(type).ToList());
 }
Ejemplo n.º 7
0
 public IEnumerable <Entertainment> getAllPerType(EntertainmentType type)
 {
     return(_entertainment.Where(e => e.EntertainmentType == type).ToList());
 }
Ejemplo n.º 8
0
 public ActionResult Edit(EntertainmentType ET)
 {
     _db.Entry(ET).State = EntityState.Modified;
     _db.SaveChanges();
     return(RedirectToAction("Index"));
 }
Ejemplo n.º 9
0
        public ActionResult Details(int id)
        {
            EntertainmentType et = _db.EntertainmentTypes.Include(e => e.Attractions).FirstOrDefault(e => e.EntertainmentTypeId == id);

            return(View(et));
        }
Ejemplo n.º 10
0
 public ActionResult Create(EntertainmentType ET)
 {
     _db.EntertainmentTypes.Add(ET);
     _db.SaveChanges();
     return(RedirectToAction("Index"));
 }