public ActionResult DeleteConfirmed(int id) { MilTipi miltipi = db.MilTipis.Find(id); db.MilTipis.Remove(miltipi); db.SaveChanges(); return(RedirectToAction("Index")); }
// // GET: /MilTipi/Delete/5 public ActionResult Delete(int id = 0) { MilTipi miltipi = db.MilTipis.Find(id); if (miltipi == null) { return(HttpNotFound()); } return(View(miltipi)); }
public ActionResult Edit(MilTipi miltipi) { if (ModelState.IsValid) { db.Entry(miltipi).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(miltipi)); }
public ActionResult Create(MilTipi miltipi) { if (ModelState.IsValid) { db.MilTipis.Add(miltipi); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(miltipi)); }