public ActionResult DeleteConfirmed(int id) { Wayang wayang = db.Wayangs.Find(id); db.Wayangs.Remove(wayang); db.SaveChanges(); return(RedirectToAction("Index")); }
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.Kategoris, "KategoriId", "Jenis", wayang.KategoriId); return(View(wayang)); }
public ActionResult Create([Bind(Include = "WayangId,JenengWayang,GambarURL,KategoriId")] Wayang wayang) { if (ModelState.IsValid) { db.Wayangs.Add(wayang); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.KategoriId = new SelectList(db.Kategoris, "KategoriId", "Jenis", wayang.KategoriId); return(View(wayang)); }
// GET: /Wayang/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Wayang wayang = db.Wayangs.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.Wayangs.Find(id); if (wayang == null) { return(HttpNotFound()); } ViewBag.KategoriId = new SelectList(db.Kategoris, "KategoriId", "Jenis", wayang.KategoriId); return(View(wayang)); }