public DataSourceResult ReadUserEducationalResumes(int userId, DataSourceRequest request) { return(EducationalResumeBiz.Read(r => r.UserId == userId) .OrderByDescending(resume => resume.EducationGrade) .MapTo <EducationalResumePM>() .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 DeleteEducationalResume(UserIdentity user, int id) { var resume = EducationalResumeBiz.Find(id); if (resume.UserId != user.UserId) { throw new BusinessException(); } EducationalResumeBiz.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 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(); }