Example #1
0
        /// <summary>
        /// 转换为EducationExperience用于数据库存储
        /// </summary>
        public EducationExperience AsEducationExperience(long userId)
        {
            EducationExperience educationExperience;

            if (Id > 0)
            {
                UserProfileService userProfileService = new UserProfileService();
                educationExperience           = userProfileService.GetEducationExperience(Id, userId);
                educationExperience.Degree    = this.Degree;
                educationExperience.School    = this.School;
                educationExperience.StartYear = this.StartYear;

                if (!string.IsNullOrEmpty(Department))
                {
                    educationExperience.Department = this.Department;
                }
                else
                {
                    educationExperience.Department = string.Empty;
                }
            }
            else
            {
                educationExperience           = EducationExperience.New();
                educationExperience.Degree    = this.Degree;
                educationExperience.School    = this.School;
                educationExperience.StartYear = this.StartYear;

                if (!string.IsNullOrEmpty(Department))
                {
                    educationExperience.Department = this.Department;
                }
                else
                {
                    educationExperience.Department = string.Empty;
                }

                educationExperience.UserId = userId;
            }
            return(educationExperience);
        }