public ActionResult DeleteConfirmed(int id) { tariffs tariffs = db.tariffs.Find(id); db.tariffs.Remove(tariffs); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id,name,minute_number,sms_number,price")] tariffs tariffs) { if (ModelState.IsValid) { db.Entry(tariffs).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tariffs)); }
public ActionResult Create([Bind(Include = "id,name,minute_number,sms_number,price")] tariffs tariffs) { if (ModelState.IsValid) { db.tariffs.Add(tariffs); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tariffs)); }
// GET: Tariffs/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tariffs tariffs = db.tariffs.Find(id); if (tariffs == null) { return(HttpNotFound()); } return(View(tariffs)); }