public DataSourceResult ReadUserJobResumes(int userId, DataSourceRequest request) { return(JobResumeBiz.Read(r => r.UserId == userId) .OrderByDescending(resume => resume.StartYear) .MapTo <JobResumePM>() .ToDataSourceResult(request)); }
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); }
public void DeleteJobResume(UserIdentity user, int id) { var resume = JobResumeBiz.Find(id); if (resume.UserId != user.UserId) { throw new BusinessException(); } JobResumeBiz.Remove(resume); UnitOfWork.SaveChanges(); }
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); }
public void AddJobResume(UserIdentity userIdentity, JobResumePM jobResumePM) { var resume = jobResumePM.GetJobResume(); 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(jobResumePM.OrganizationName, OrganizationType.Company); resume.Job = JobBiz.AddJobIfNotExist(jobResumePM.JobName); JobResumeBiz.Add(resume); UnitOfWork.SaveChanges(); }