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