public ActionResult DeleteConfirmed(int id) { Matakuliah matakuliah = db.Matakuliahs.Find(id); db.Matakuliahs.Remove(matakuliah); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "MatakuliahID,Nama_matakuliah,Sks")] Matakuliah matakuliah) { if (ModelState.IsValid) { db.Entry(matakuliah).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(matakuliah)); }
public ActionResult Create([Bind(Include = "MatakuliahID,Nama_matakuliah,Sks")] Matakuliah matakuliah) { if (ModelState.IsValid) { db.Matakuliahs.Add(matakuliah); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(matakuliah)); }
// GET: Matakuliahs/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Matakuliah matakuliah = db.Matakuliahs.Find(id); if (matakuliah == null) { return(HttpNotFound()); } return(View(matakuliah)); }