public async Task <ActionResult> DeleteConfirmed(int id) { maquinas maquinas = await db.maquinas.FindAsync(id); db.maquinas.Remove(maquinas); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "ID,Tipo,Nombre,Funcion,Estado")] maquinas maquinas) { if (ModelState.IsValid) { db.Entry(maquinas).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(maquinas)); }
public async Task <ActionResult> Create([Bind(Include = "ID,Tipo,Nombre,Funcion,Estado")] maquinas maquinas) { if (ModelState.IsValid) { db.maquinas.Add(maquinas); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(maquinas)); }
// GET: maquinas/Delete/5 public async Task <ActionResult> Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } maquinas maquinas = await db.maquinas.FindAsync(id); if (maquinas == null) { return(HttpNotFound()); } return(View(maquinas)); }