Exemple #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            MasteryCourse masterycourse = (MasteryCourse)db.Courses.Find(id);

            db.Courses.Remove(masterycourse);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #2
0
        //
        // GET: /MasteryCourse/Details/5

        public ActionResult Details(int id = 0)
        {
            MasteryCourse masterycourse = db.MasteryCourses.Find(id);

            if (masterycourse == null)
            {
                return(HttpNotFound());
            }
            return(View(masterycourse));
        }
Exemple #3
0
 public ActionResult Edit(MasteryCourse masterycourse)
 {
     if (ModelState.IsValid)
     {
         db.Entry(masterycourse).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ProgramId = new SelectList(db.Programs, "ProgramID", "ProgramAcronym", masterycourse.ProgramId);
     return(View(masterycourse));
 }
Exemple #4
0
        //
        // GET: /MasteryCourse/Edit/5

        public ActionResult Edit(int id = 0)
        {
            MasteryCourse masterycourse = db.MasteryCourses.Find(id);

            if (masterycourse == null)
            {
                return(HttpNotFound());
            }
            ViewBag.ProgramId = new SelectList(db.Programs, "ProgramID", "ProgramAcronym", masterycourse.ProgramId);
            return(View(masterycourse));
        }
Exemple #5
0
 public ActionResult Edit([Bind(Include = "CourseId,ProgramId,CourseNumber,Title,CreditHours,TuitionAmount,Notes,MaximumAttempts")] MasteryCourse masteryCourse)
 {
     if (ModelState.IsValid)
     {
         db.Entry(masteryCourse).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ProgramId = new SelectList(db.Programs, "ProgramId", "Description", masteryCourse.ProgramId);
     return(View(masteryCourse));
 }
Exemple #6
0
        public ActionResult DeleteConfirmed(int id)
        {
            MasteryCourse masteryCourse = db.MasteryCourses.Find(id);

            if (masteryCourse.registration != null)
            {
                masteryCourse.registration.Clear();
            }
            db.MasteryCourses.Remove(masteryCourse);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #7
0
        public ActionResult Create(MasteryCourse masterycourse)
        {
            masterycourse.setNextCourseNumber();
            if (ModelState.IsValid)
            {
                db.Courses.Add(masterycourse);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.ProgramId = new SelectList(db.Programs, "ProgramID", "ProgramAcronym", masterycourse.ProgramId);
            return(View(masterycourse));
        }
Exemple #8
0
        public ActionResult Create([Bind(Include = "CourseId,ProgramId,CourseNumber,Title,CreditHours,TuitionAmount,Notes,MaximumAttempts")] MasteryCourse masteryCourse)
        {
            masteryCourse.setNextCourseNumber();
            if (ModelState.IsValid)
            {
                db.MasteryCourses.Add(masteryCourse);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.ProgramId = new SelectList(db.Programs, "ProgramId", "Description", masteryCourse.ProgramId);
            return(View(masteryCourse));
        }
Exemple #9
0
        // GET: MasteryCourses/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            MasteryCourse masteryCourse = (MasteryCourse)db.Courses.Find(id);

            if (masteryCourse == null)
            {
                return(HttpNotFound());
            }
            return(View(masteryCourse));
        }
Exemple #10
0
        // GET: MasteryCourses/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            MasteryCourse masteryCourse = (MasteryCourse)db.Courses.Find(id);

            if (masteryCourse == null)
            {
                return(HttpNotFound());
            }
            ViewBag.ProgramId = new SelectList(db.Programs, "ProgramId", "Description", masteryCourse.ProgramId);
            return(View(masteryCourse));
        }
        // GET: MasteryCourses/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            MasteryCourse masteryCourse = db.MasteryCourses.Find(id);

            if (masteryCourse == null)
            {
                return(HttpNotFound());
            }
            ViewBag.AcademicProgramId = new SelectList(db.AcademicPrograms, "AcademicProgramId", "ProgramAcronym", masteryCourse.AcademicProgramId);
            return(View(masteryCourse));
        }