Esempio n. 1
0
 public ActionResult Edit(RegularState regularstate)
 {
     if (ModelState.IsValid)
     {
         db.Entry(regularstate).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(regularstate));
 }
Esempio n. 2
0
 public ActionResult Edit(NextAuditCourse nextauditcourse)
 {
     if (ModelState.IsValid)
     {
         db.Entry(nextauditcourse).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(nextauditcourse));
 }
Esempio n. 3
0
 public ActionResult Edit(NextRegistrationNumber nextregistrationnumber)
 {
     if (ModelState.IsValid)
     {
         db.Entry(nextregistrationnumber).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(nextregistrationnumber));
 }
Esempio n. 4
0
 public ActionResult Edit(HonoursState honoursstate)
 {
     if (ModelState.IsValid)
     {
         db.Entry(honoursstate).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(honoursstate));
 }
 public ActionResult Edit(SuspendedState suspendedstate)
 {
     if (ModelState.IsValid)
     {
         db.Entry(suspendedstate).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(suspendedstate));
 }
 public ActionResult Edit(ProbationState probationstate)
 {
     if (ModelState.IsValid)
     {
         db.Entry(probationstate).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(probationstate));
 }
Esempio n. 7
0
 public ActionResult Edit(AuditCourse auditcourse)
 {
     if (ModelState.IsValid)
     {
         db.Entry(auditcourse).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ProgramId = new SelectList(db.Programs, "ProgramID", "ProgramAcronym", auditcourse.ProgramId);
     return(View(auditcourse));
 }
 public ActionResult Edit(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));
 }
 public ActionResult Edit(Registration registration)
 {
     registration.setNextRegistrationNumber();
     if (ModelState.IsValid)
     {
         db.Entry(registration).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.StudentId = new SelectList(db.Students, "StudentID", "FirstName", registration.StudentId);
     ViewBag.CourseId  = new SelectList(db.Courses, "CourseId", "CourseNumber", registration.CourseId);
     return(View(registration));
 }
 public ActionResult Edit(Student student)
 {
     student.setNextStudentNumber();
     if (ModelState.IsValid)
     {
         db.Entry(student).State = EntityState.Modified;
         student.changeState();
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.GPAStateId = new SelectList(db.GPAStates, "GPAStateId", "GPAStateId", student.GPAStateId);
     ViewBag.ProgramId  = new SelectList(db.Programs, "ProgramId", "Description");
     return(View(student));
 }
        // PUT api/Course/5
        public HttpResponseMessage PutCourse(int id, Course course)
        {
            if (ModelState.IsValid && id == course.CourseId)
            {
                db.Entry(course).State = EntityState.Modified;

                try
                {
                    db.SaveChanges();
                }
                catch (DbUpdateConcurrencyException)
                {
                    return(Request.CreateResponse(HttpStatusCode.NotFound));
                }

                return(Request.CreateResponse(HttpStatusCode.OK));
            }
            else
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest));
            }
        }