public JsonResult Add(List <string> list, string IDGV)
 {
     foreach (var i in list)
     {
         var sb = StudentTeacherService.getByStudentId(Convert.ToInt32(i));
         if (sb == null)
         {
             var model = new StudentTeacherRelationship
             {
                 StudentID = Convert.ToInt32(i),
                 TeacherID = Convert.ToInt32(IDGV),
                 CreateBy  = Convert.ToInt32(Session["UserId"])
             };
             StudentTeacherService.Create(model);
         }
         else
         {
             var model = new StudentTeacherRelationship
             {
                 StudentID = Convert.ToInt32(i),
                 TeacherID = Convert.ToInt32(IDGV),
                 ModifyBy  = Convert.ToInt32(Session["UserId"])
             };
             StudentTeacherService.Update(model);
         }
     }
     return(Json(true, JsonRequestBehavior.AllowGet));
 }
 public ActionResult Update(StudentTeacherEditViewModel StudentTeacher)
 {
     if (!ModelState.IsValid)
     {
         return(View());
     }
     StudentTeacher.StudentID = (int)Session["StudentID"];
     StudentTeacherService.Update(StudentTeacher);
     return(RedirectToAction("Details", "Student", new { id = StudentTeacher.StudentID }));
 }