Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            basDisciplina basdisciplina = db.Disciplinas.Find(id);

            db.Disciplinas.Remove(basdisciplina);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
        //
        // GET: /Disciplina/Delete/5

        public ActionResult Delete(int id = 0)
        {
            basDisciplina basdisciplina = db.Disciplinas.Find(id);

            if (basdisciplina == null)
            {
                return(HttpNotFound());
            }
            return(View(basdisciplina));
        }
Exemplo n.º 3
0
 public ActionResult Edit(basDisciplina basdisciplina)
 {
     if (ModelState.IsValid)
     {
         db.Entry(basdisciplina).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(basdisciplina));
 }
Exemplo n.º 4
0
        public ActionResult Create(basDisciplina basdisciplina)
        {
            if (ModelState.IsValid)
            {
                db.Disciplinas.Add(basdisciplina);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(basdisciplina));
        }