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