Beispiel #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Wayang wayang = db.Wayang.Find(id);

            db.Wayang.Remove(wayang);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        public Wayang Find(int id)
        {
            Wayang result = (from b in wayangs
                             where b.WayangId == id
                             select b).FirstOrDefault <Wayang>();

            return(result);
        }
Beispiel #3
0
 public ActionResult Edit([Bind(Include = "WayangId,JenengWayang,GambarURL,KategoriId")] Wayang wayang)
 {
     if (ModelState.IsValid)
     {
         db.Entry(wayang).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.KategoriId = new SelectList(db.Kategori, "KategoriId", "Jenis", wayang.KategoriId);
     return(View(wayang));
 }
Beispiel #4
0
        // GET: /Wayang/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Wayang wayang = db.Wayang.Find(id);

            if (wayang == null)
            {
                return(HttpNotFound());
            }
            return(View(wayang));
        }
Beispiel #5
0
        // GET: /Wayang/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Wayang wayang = db.Wayang.Find(id);

            if (wayang == null)
            {
                return(HttpNotFound());
            }
            ViewBag.KategoriId = new SelectList(db.Kategori, "KategoriId", "Jenis", wayang.KategoriId);
            return(View(wayang));
        }