コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Biografbillet biografbillet = db.Biografbillet.Find(id);

            db.Biografbillet.Remove(biografbillet);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "filmnavn,dato,tid,sæderække,stolenummer,kundeNr,id")] Biografbillet biografbillet)
 {
     if (ModelState.IsValid)
     {
         db.Entry(biografbillet).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.kundeNr = new SelectList(db.Kunde, "tlfNr", "navn", biografbillet.kundeNr);
     return(View(biografbillet));
 }
コード例 #3
0
        public ActionResult Create([Bind(Include = "filmnavn,dato,tid,sæderække,stolenummer,kundeNr,id")] Biografbillet biografbillet)
        {
            if (ModelState.IsValid)
            {
                db.Biografbillet.Add(biografbillet);
                db.SaveChanges();
                return(RedirectToAction("Index", new { phone = biografbillet.kundeNr }));
            }

            ViewBag.kundeNr = new SelectList(db.Kunde, "tlfNr", "navn", biografbillet.kundeNr);
            return(View(biografbillet));
        }
コード例 #4
0
        // GET: Biografbillets/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Biografbillet biografbillet = db.Biografbillet.Find(id);

            if (biografbillet == null)
            {
                return(HttpNotFound());
            }
            return(View(biografbillet));
        }
コード例 #5
0
        // GET: Biografbillets/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Biografbillet biografbillet = db.Biografbillet.Find(id);

            if (biografbillet == null)
            {
                return(HttpNotFound());
            }
            ViewBag.kundeNr = new SelectList(db.Kunde, "tlfNr", "navn", biografbillet.kundeNr);
            return(View(biografbillet));
        }