Пример #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            MajorRequirement majorRequirement = db.MajorRequired.Find(id);

            db.MajorRequired.Remove(majorRequirement);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
 public ActionResult Edit([Bind(Include = "Id,department,coursenumber")] MajorRequirement majorRequirement)
 {
     if (ModelState.IsValid)
     {
         db.Entry(majorRequirement).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(majorRequirement));
 }
Пример #3
0
        public ActionResult Create([Bind(Include = "Id,department,coursenumber")] MajorRequirement majorRequirement)
        {
            if (ModelState.IsValid)
            {
                db.MajorRequired.Add(majorRequirement);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(majorRequirement));
        }
Пример #4
0
        // GET: MajorRequirements/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            MajorRequirement majorRequirement = db.MajorRequired.Find(id);

            if (majorRequirement == null)
            {
                return(HttpNotFound());
            }
            return(View(majorRequirement));
        }