コード例 #1
0
 public ActionResult Edit([Bind(Include = "ProgramId,ProgramAcronym,Description")] Program program)
 {
     if (ModelState.IsValid)
     {
         db.Entry(program).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(program));
 }
 public ActionResult Edit([Bind(Include = "GPAStateId,LowerLimit,UpperLimit,TuitionRateFactor")] RegularState regularState)
 {
     if (ModelState.IsValid)
     {
         db.Entry(regularState).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(regularState));
 }
 public ActionResult Edit([Bind(Include = "NextStudentNumberId,NextAvailableNumber")] NextStudentNumber nextStudentNumber)
 {
     if (ModelState.IsValid)
     {
         db.Entry(nextStudentNumber).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(nextStudentNumber));
 }
コード例 #4
0
 public ActionResult Edit([Bind(Include = "CourseId,ProgramId,CourseNumber,Title,CreditHours,TuitionAmount,Notes")] Course course)
 {
     if (ModelState.IsValid)
     {
         db.Entry(course).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ProgramId = new SelectList(db.Programs, "ProgramId", "ProgramAcronym", course.ProgramId);
     return(View(course));
 }
コード例 #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));
 }
コード例 #6
0
 public ActionResult Edit([Bind(Include = "CourseId,ProgramId,CourseNumber,Title,CreditHours,TuitionAmount,Notes,AssignmentWeight,MidtermWeight,FinalWeight")] GradedCourse gradedCourse)
 {
     if (ModelState.IsValid)
     {
         db.Entry(gradedCourse).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ProgramId = new SelectList(db.Programs, "ProgramId", "Description", gradedCourse.ProgramId);
     return(View(gradedCourse));
 }
 public ActionResult Edit([Bind(Include = "StudentCardId,CardNumber,StudentId")] StudentCard studentCard)
 {
     if (ModelState.IsValid)
     {
         db.Entry(studentCard).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.StudentId = new SelectList(db.Students, "StudentId", "FullName", studentCard.StudentId);
     return(View(studentCard));
 }
コード例 #8
0
 public ActionResult Edit([Bind(Include = "RegistrationId,RegistrationNumber,StudentId,CourseId,RegistrationDate,Grade,Notes")] Registration registration)
 {
     if (ModelState.IsValid)
     {
         db.Entry(registration).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CourseId  = new SelectList(db.Courses, "CourseId", "Title", registration.CourseId);
     ViewBag.StudentId = new SelectList(db.Students, "StudentId", "FullName", registration.StudentId);
     return(View(registration));
 }
コード例 #9
0
 public ActionResult Edit([Bind(Include = "StudentId,GPAStateId,ProgramId,StudentNumber,FirstName,LastName,Address,City,Province,PostalCode,DateCreated,GradePointAverage,OutstandingFees,Notes")] Student student)
 {
     if (ModelState.IsValid)
     {
         db.Entry(student).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.GPAStateId = new SelectList(db.GPAStates, "GPAStateId", "GPAStateId", student.GPAStateId);
     ViewBag.ProgramId  = new SelectList(db.Programs, "ProgramId", "ProgramAcronym", student.ProgramId);
     return(View(student));
 }