Exemplo n.º 1
0
        public int UpdateMyEducationModule(DLModel.MyEducationModule myEducationModule)
        {
            var id = _myEducationModuleRepository.Update((DLModel.MyEducationModule) new DLModel.MyEducationModule().InjectFrom(myEducationModule));

            //check if pretest, exam and eval are not required for course then complete course...hp
            Engine.CourseCompleteProcessEngine _engine = new Engine.CourseCompleteProcessEngine();
            _engine.RunEngineAfterModuleCompleted(myEducationModule.MEID);
            return(id);
        }
Exemplo n.º 2
0
        public void UpdateMyEducationCourseCompletedByMEMID(int MEMID, int MEID)
        {
            DLModel.MyEducationModule myeducationmodule = new DLModel.MyEducationModule {
                MEMID         = MEMID,
                Completed     = true,
                CompletedDate = System.DateTime.Now
            };
            _myEducationModuleRepository.Update(myeducationmodule, rk => rk.Completed, rk => rk.CompletedDate);

            // check if all the module is completed then need to set completed the my education coruse.
            //int meID = _myEducationModuleRepository.GetById(MEMID).MEID;
            if (_myEducationModuleRepository.GetAll(rk => rk.MEID == MEID && rk.Completed == false).Count() == 0)
            {
                // all module completd and need to set course completed
                DLModel.MyEducation myeducation = new DLModel.MyEducation
                {
                    MEID          = MEID,
                    Completed     = true,
                    CompletedDate = System.DateTime.Now
                };
                _myEducationRepository.Update(myeducation, rk => rk.Completed, rk => rk.CompletedDate);
            }
        }