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