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