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); }
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)); }
// 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)); }
// 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)); }