コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            StudentPlan studentPlan = db.StudentPlans.Find(id);

            db.StudentPlans.Remove(studentPlan);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "StudentPlanId,EnrollmentId,StudentId,CourseId,SemesterId,ProgramId")] StudentPlan studentPlan)
 {
     if (ModelState.IsValid)
     {
         db.Entry(studentPlan).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CourseId   = new SelectList(db.Course, "CourseId", "Number", studentPlan.CourseId);
     ViewBag.ProgramId  = new SelectList(db.Program, "ProgramId", "Name", studentPlan.ProgramId);
     ViewBag.SemesterId = new SelectList(db.Semester, "SemesterId", "Season", studentPlan.SemesterId);
     ViewBag.StudentId  = new SelectList(db.Student, "StudentId", "UserId", studentPlan.StudentId);
     return(View(studentPlan));
 }
コード例 #3
0
        // GET: AdminStudentPlans/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            StudentPlan studentPlan = db.StudentPlans.Find(id);

            if (studentPlan == null)
            {
                return(HttpNotFound());
            }
            return(View(studentPlan));
        }
コード例 #4
0
        // GET: AdminStudentPlans/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            StudentPlan studentPlan = db.StudentPlans.Find(id);

            if (studentPlan == null)
            {
                return(HttpNotFound());
            }
            ViewBag.CourseId   = new SelectList(db.Course, "CourseId", "Number", studentPlan.CourseId);
            ViewBag.ProgramId  = new SelectList(db.Program, "ProgramId", "Name", studentPlan.ProgramId);
            ViewBag.SemesterId = new SelectList(db.Semester, "SemesterId", "Season", studentPlan.SemesterId);
            ViewBag.StudentId  = new SelectList(db.Student, "StudentId", "UserId", studentPlan.StudentId);
            return(View(studentPlan));
        }