コード例 #1
0
 public DataSourceResult ReadUserEducationalResumes(int userId, DataSourceRequest request)
 {
     return(EducationalResumeBiz.Read(r => r.UserId == userId)
            .OrderByDescending(resume => resume.EducationGrade)
            .MapTo <EducationalResumePM>()
            .ToDataSourceResult(request));
 }
コード例 #2
0
 public UserResumeService()
 {
     UnitOfWork           = new CoreUnitOfWork();
     OrganizationBiz      = new OrganizationBiz(UnitOfWork);
     UniversityFieldBiz   = new UniversityFieldBiz(UnitOfWork);
     EducationalResumeBiz = new EducationalResumeBiz(UnitOfWork);
     JobResumeBiz         = new JobResumeBiz(UnitOfWork);
     JobBiz = new JobBiz(UnitOfWork);
 }
コード例 #3
0
        public void DeleteEducationalResume(UserIdentity user, int id)
        {
            var resume = EducationalResumeBiz.Find(id);

            if (resume.UserId != user.UserId)
            {
                throw new BusinessException();
            }
            EducationalResumeBiz.Remove(resume);
            UnitOfWork.SaveChanges();
        }
コード例 #4
0
 public UserProfileService()
 {
     UnitOfWork           = new CoreUnitOfWork();
     UserBiz              = new UserBiz(UnitOfWork);
     MembershipBiz        = new MembershipBiz(UnitOfWork);
     ProfileBiz           = new ProfileBiz(UnitOfWork);
     ArticleBiz           = new ArticleBiz(UnitOfWork);
     BlogBiz              = new BlogBiz(UnitOfWork);
     EducationalResumeBiz = new EducationalResumeBiz(UnitOfWork);
     VisitBiz             = new VisitBiz(UnitOfWork);
     JobResumeBiz         = new JobResumeBiz(UnitOfWork);
     FollowBiz            = new FollowBiz(UnitOfWork);
 }
コード例 #5
0
        public void AddEducationalResume(UserIdentity userIdentity, EducationalResumePM educationalResumePM)
        {
            var resume = educationalResumePM.GetEducationalResume();

            if ((resume.StartYear.HasValue && resume.EndYear.HasValue && resume.StartYear > resume.EndYear) ||
                (!resume.StartYear.HasValue || resume.EndYear.HasValue))
            {
                resume.StartYear = resume.EndYear = null;
            }
            resume.UserId          = userIdentity.UserId;
            resume.Organization    = OrganizationBiz.AddOrganizationIfNotExist(educationalResumePM.OrganizationName, OrganizationType.University);
            resume.UniversityField = UniversityFieldBiz.AddIfNotExist(educationalResumePM.UniversityFieldName);
            EducationalResumeBiz.Add(resume);
            UnitOfWork.SaveChanges();
        }