public ActionResult DeleteConfirmed(int id)
        {
            TicketInPriceList ticketInPriceList = db.TicketInPriceList.Find(id);

            db.TicketInPriceList.Remove(ticketInPriceList);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "Id,Name,IdTicketType,Price,Entries,Duration,StartDate,EndDate,IdAttraction")] TicketInPriceList ticketInPriceList)
 {
     if (ModelState.IsValid)
     {
         db.Entry(ticketInPriceList).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.IdAttraction = new SelectList(db.Attraction, "Id", "Name", ticketInPriceList.IdAttraction);
     ViewBag.IdTicketType = new SelectList(db.TicketType, "Id", "Type", ticketInPriceList.IdTicketType);
     return(View(ticketInPriceList));
 }
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TicketInPriceList ticketInPriceList = db.TicketInPriceList.Find(id);

            if (ticketInPriceList == null)
            {
                return(HttpNotFound());
            }
            return(View(ticketInPriceList));
        }
        public ActionResult Create([Bind(Include = "Id,Name,IdTicketType,Price,Entries,Duration,StartDate,EndDate,IdAttraction")] TicketInPriceList ticketInPriceList)
        {
            ticketInPriceList.StartDate = DateTime.Now;

            if (ModelState.IsValid)
            {
                db.TicketInPriceList.Add(ticketInPriceList);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.IdAttraction = new SelectList(db.Attraction, "Id", "Name", ticketInPriceList.IdAttraction);
            ViewBag.IdTicketType = new SelectList(db.TicketType, "Id", "Type", ticketInPriceList.IdTicketType);
            return(View(ticketInPriceList));
        }
        public ActionResult Update(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TicketInPriceList ticketInPriceList = db.TicketInPriceList.Find(id);

            if (ticketInPriceList == null)
            {
                return(HttpNotFound());
            }
            ViewBag.IdAttraction = new SelectList(db.Attraction, "Id", "Name", ticketInPriceList.IdAttraction);
            ViewBag.IdTicketType = new SelectList(db.TicketType, "Id", "Type", ticketInPriceList.IdTicketType);
            return(View(ticketInPriceList));
        }