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