示例#1
0
 public ActionResult Edit(Student student, int CourseId)
 {
     if (CourseId != 0)
     {
         _db.CourseStudent.Add(new CourseStudent()
         {
             CourseId = CourseId, StudentId = student.StudentId
         });
     }
     _db.Entry(student).State = EntityState.Modified;
     _db.SaveChanges();
     return(RedirectToAction("Index"));
 }
示例#2
0
        public ActionResult Edit(Course course)

        {
            _db.Entry(course).State = EntityState.Modified;
            _db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#3
0
 public ActionResult Edit(Course course, int StudentId)
 {
   if (StudentId == 0)
   {
     _db.CourseStudent.Add(new CourseStudent() {StudentId = StudentId, CourseId = course.CourseId});
   }
   _db.Entry(course).State = EntityState.Modified;
   _db.SaveChanges();
   return RedirectToAction("Index");
 }
示例#4
0
 public ActionResult Edit(Department department)
 {
     _db.Entry(department).State = EntityState.Modified;
     _db.SaveChanges();
     return(RedirectToAction("Index"));
 }
 public ActionResult Edit(Professor professor, int DepartmentId)
 {
     _db.Entry(professor).State = EntityState.Modified;
     _db.SaveChanges();
     return(RedirectToAction("Index"));
 }