Exemplo n.º 1
0
 public ActionResult DeleteConfirmed(int id)
 {
     RunningModel.Discipline discipline = db.Disciplines.Find(id);
     db.Disciplines.Remove(discipline);
     db.SaveChanges();
     return(RedirectToAction("Index"));
 }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "id,Code,Name,Active")] RunningModel.Discipline discipline)
 {
     if (ModelState.IsValid)
     {
         db.Entry(discipline).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(discipline));
 }
Exemplo n.º 3
0
        public ActionResult Create([Bind(Include = "id,Code,Name,Active")] RunningModel.Discipline discipline)
        {
            if (ModelState.IsValid)
            {
                db.Disciplines.Add(discipline);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(discipline));
        }
Exemplo n.º 4
0
 // GET: Disciplines/Delete/5
 public ActionResult Delete(int?id)
 {
     if (id == null)
     {
         return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
     }
     RunningModel.Discipline discipline = db.Disciplines.Find(id);
     if (discipline == null)
     {
         return(HttpNotFound());
     }
     return(View(discipline));
 }