Ejemplo n.º 1
0
 public JsonResult AddNewCSPItem(CSP model, List <int> teachersIds)
 {
     if (model.StudentId > 0 && model.SubjectId > 0 && model.SchoolYearId > 0 && string.IsNullOrEmpty(model.Materials) == false && teachersIds.Count > 0)
     {
         if (model.Id == -1)
         {
             CSP.AddNew(model.StudentId, model.SubjectId, model.SchoolYearId, model.Materials, teachersIds, ApplicationHelper.LoggedUserId);
         }
         else
         {
             CSP.Update(model.Id, model.SubjectId, model.SchoolYearId, model.Materials, teachersIds, ApplicationHelper.LoggedUserId);
         }
         return(Json(true, JsonRequestBehavior.AllowGet));
     }
     return(Json(false, JsonRequestBehavior.AllowGet));
 }