Ejemplo n.º 1
0
        public void RunEngineAfterModuleCompleted(int _meID)
        {
            int _educationID = _myEducationRepository.GetAll(hp => hp.MEID == _meID).FirstOrDefault().EducationID;

            if (_myEducationModuleRepository.GetAll(hp => (hp.Completed == false) && (hp.MEID == _meID)).Count() == 0)
            {
                if ((_educationExamQuestionRepository.GetDbSet().Where(hp => (hp.EducationID == _educationID) && (hp.IsActive == true)).Count() == 0) && (_educationEvaluationRepository.GetDbSet().Where(hp => (hp.EducationID == _educationID) && (hp.IsActive == true)).Count() == 0))
                {
                    UpdateMyEducation(_meID, true);
                }
            }
        }
Ejemplo 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);
            }
        }