public async Task <IActionResult> DisableEnableOrganizationAsync([FromBody] DisableEnableOrganizationRequestDto request) { var organizationBiz = new OrganizationBiz(); var entity = await organizationBiz.GetAsync(request.OrgGuid); if (entity == null) { return(Failed(ErrorCode.UserData, "找不到数据")); } var oall = await organizationBiz.GetListAsync(); var entitys = GetOrganizationSubset(oall, request.OrgGuid); entitys.Add(entity); foreach (var item in entitys) { item.LastUpdatedBy = UserID; item.LastUpdatedDate = DateTime.Now; item.Enable = request.Enable; } var result = await organizationBiz.UpdateAsync(entitys); if (!result) { return(Failed(ErrorCode.UserData, "修改失败")); } return(Success()); }
public BasicInfoService() { UnitOfWork = new CoreUnitOfWork(); OrganizationBiz = new OrganizationBiz(UnitOfWork); UniversityFieldBiz = new UniversityFieldBiz(UnitOfWork); JobBiz = new JobBiz(UnitOfWork); }
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 async Task <IActionResult> GetOrganizationTreeAsync([FromBody] GetOrganizationTreeRequestDto request) { var organizationBiz = new OrganizationBiz(); var modelList = await organizationBiz.GetAllAsync(request); var response = GetOrganizationTree(null, modelList); return(Success(response)); }
public async Task <IActionResult> DeleteOrganizationAsync([FromBody] DeleteOrganizationRequestDto request) { var organizationBiz = new OrganizationBiz(); var result = await organizationBiz.DeleteAsync(request.OrgGuid); if (!result) { return(Failed(ErrorCode.UserData, "删除失败")); } return(Success()); }
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(); }
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(); }
public async Task <IActionResult> AddOrganizationAsync([FromBody] AddOrganizationRequestDto request) { var organizationBiz = new OrganizationBiz(); var result = await organizationBiz.InsertAsync(new OrganizationModel { CreatedBy = UserID, LastUpdatedBy = UserID, Enable = request.Enable, OrgGuid = Guid.NewGuid().ToString("N"), OrgName = request.OrgName, ParentGuid = string.IsNullOrWhiteSpace(request.ParentGuid) ? null : request.ParentGuid, Sort = request.Sort, }); if (!result) { return(Failed(ErrorCode.UserData, "修改失败")); } return(Success()); }
public async Task <IActionResult> UpdateOrganizationAsync([FromBody] UpdateOrganizationRequestDto request) { var organizationBiz = new OrganizationBiz(); var entity = await organizationBiz.GetAsync(request.OrgGuid); if (entity == null) { return(Failed(ErrorCode.UserData, "找不到数据")); } entity.LastUpdatedBy = UserID; entity.Enable = request.Enable; entity.LastUpdatedDate = DateTime.Now; entity.OrgName = request.OrgName; entity.ParentGuid = string.IsNullOrWhiteSpace(request.ParentGuid) ? null : request.ParentGuid; entity.Sort = request.Sort; var result = await organizationBiz.UpdateAsync(entity); if (!result) { return(Failed(ErrorCode.UserData, "修改失败")); } return(Success()); }
public IEnumerable <OrganizationPM> SuggestOrganization(string phrase, OrganizationType orgType) { return(OrganizationBiz.SuggestOrganization(phrase, orgType) .MapTo <OrganizationPM>() .ToList()); }