public ActionResult DeleteConfirmed(int id) { Puhelintiedot puhelintiedot = db.Puhelintiedot.Find(id); db.Puhelintiedot.Remove(puhelintiedot); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "PuhelintietoID,Puhelin_1,Puhelin_2,Puhelin_3")] Puhelintiedot puhelintiedot) { if (ModelState.IsValid) { db.Entry(puhelintiedot).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(puhelintiedot)); }
public ActionResult Create([Bind(Include = "PuhelintietoID,Puhelin_1,Puhelin_2,Puhelin_3")] Puhelintiedot puhelintiedot) { if (ModelState.IsValid) { db.Puhelintiedot.Add(puhelintiedot); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(puhelintiedot)); }
// GET: Puhelimet/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Puhelintiedot puhelintiedot = db.Puhelintiedot.Find(id); if (puhelintiedot == null) { return(HttpNotFound()); } return(View(puhelintiedot)); }