public JsonResult AddLearningMap(LearningMap data) { data.TeamId = (int)CurrentUser.TeamId; data.CreatedBy = CurrentUser.UserId; return(Json(new LearningMapBL().AddLearningMap(data, CurrentUser), JsonRequestBehavior.AllowGet)); }
public bool UpdateLearningMap(LearningMap data, User currentUser) { int duration = 0; if (data.Courses == null || (duration = data.Courses.Sum(x => x.Duration)) != data.Duration) { // duration will be 0 if data.Courses is null else sum of duration of all courses data.Duration = duration; } return(LearningMapDataAccessor.UpdateLearningMap(data)); }
public int AddLearningMap(LearningMap data, User currentUser) { int duration = 0; if (data.Courses == null || (duration = data.Courses.Sum(x => x.Duration)) != data.Duration) { // duration will be 0 if data.Courses is null else sum of duration of all courses data.Duration = duration; } int learningMapId = (LearningMapDataAccessor.AddLearningMap(data)); if (learningMapId > 0) { new NotificationBl().AddNewCourseNotification(data.Trainees.ToList(), currentUser.UserId); } return(learningMapId); }
public JsonResult UpdateLearningMap(LearningMap data) { return(Json(new LearningMapBL().UpdateLearningMap(data, CurrentUser), JsonRequestBehavior.AllowGet)); }