Beispiel #1
0
        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"));
        }
Beispiel #2
0
 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));
 }
Beispiel #3
0
        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));
        }
Beispiel #4
0
        // 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));
        }