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