Example #1
0
        public List <EducationModel> GetAllEducationList(EducationModel model)
        {
            List <EducationModel> EducationList  = new List <EducationModel>();
            EducationModel        EducationModel = new EducationModel();

            try
            {
                List <Master_StaffEducationalDegree> rollList = _educationRepository.GetAllUserEducationList();
                if (rollList != null)
                {
                    rollList.ForEach(a =>
                    {
                        EducationModel      = Mapper.Map <Master_StaffEducationalDegree, EducationModel>(a);
                        EducationModel.Name = Utility.GetPropertyValue(EducationModel, "Name", model.CurrentCulture) == null ? null :
                                              Utility.GetPropertyValue(EducationModel, "Name", model.CurrentCulture).ToString();
                        EducationModel.Description = Utility.GetPropertyValue(EducationModel, "Description", model.CurrentCulture) == null ? null :
                                                     Utility.GetPropertyValue(EducationModel, "Description", model.CurrentCulture).ToString();
                        EducationModel.CurrentUserID  = model.CurrentUserID;
                        EducationModel.CurrentCulture = model.CurrentCulture;
                        EducationList.Add(EducationModel);
                    });
                }
            }
            catch (Exception ex)
            {
                IErrorLogService errorLog = new ErrorLogService();
                string           message  = ex.InnerException != null ? ex.InnerException.InnerException.Message : ex.Message;
                errorLog.SetErrorLog(model.CurrentUserID, "Education", message);
                throw new Exception(ex.Message);
            }

            return(EducationList);
        }