Ejemplo n.º 1
0
        public JsonResult AddLearningMap(LearningMap data)
        {
            data.TeamId    = (int)CurrentUser.TeamId;
            data.CreatedBy = CurrentUser.UserId;

            return(Json(new LearningMapBL().AddLearningMap(data, CurrentUser), JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
 public JsonResult UpdateLearningMap(LearningMap data)
 {
     return(Json(new LearningMapBL().UpdateLearningMap(data, CurrentUser), JsonRequestBehavior.AllowGet));
 }