Пример #1
0
 public TD_DotTuyenDungService(IUnitOfWork unitOfWork, ITD_DotTuyenDungRepository DotTuyenDungRepository,
                               ITD_YeuCauVaDotTuyenDungRepository YeuCauVaDotTuyenDungRepository,
                               IRecruitmentRequestRepository RecruitmentRequestRepository,
                               ILog logger, IMapper mapper) :
     base(unitOfWork, DotTuyenDungRepository)
 {
     _unitOfWork = unitOfWork;
     _YeuCauVaDotTuyenDungRepository = YeuCauVaDotTuyenDungRepository;
     _RecruitmentRequestRepository   = RecruitmentRequestRepository;
     _DotTuyenDungRepository         = DotTuyenDungRepository;
     _iLog    = logger;
     _imapper = mapper;
 }
Пример #2
0
 public RecruitmentRequestService(IUnitOfWork unitOfWork,
                                  IRecruitmentRequestRepository recruitmentRequestRepository,
                                  IDM_DulieuDanhmucRepository categoryDataRepository,
                                  IDepartmentRepository departmentRepository,
                                  IRecruitmentSkillRepository recruitmentSkillRepository,
                                  IMapper mapper,
                                  ILog logger
                                  ) : base(unitOfWork, recruitmentRequestRepository)
 {
     this.recruitmentRequestRepository = recruitmentRequestRepository;
     this.departmentRepository         = departmentRepository;
     this.categoryDataRepository       = categoryDataRepository;
     this.recruitmentSkillRepository   = recruitmentSkillRepository;
     this.logger = logger;
     _mapper     = mapper;
 }
Пример #3
0
 public RecruitmentSkillService(IUnitOfWork unitOfWork,
                                IRecruitmentSkillRepository recruitmentSkillRepository,
                                IRecruitmentRequestRepository recruitmentRequestRepository,
                                IRecruitmentSkillDetailRepository recruitmentSkillDetailRepository,
                                IDM_DulieuDanhmucRepository dataCategoryRepository,
                                IConfigRecruitmentRequestRepository configRecruitmentRequestRepository,
                                IMapper mapper,
                                ILog logger) :
     base(unitOfWork, recruitmentSkillRepository)
 {
     this.recruitmentRequestRepository       = recruitmentRequestRepository;
     this.recruitmentSkillRepository         = recruitmentSkillRepository;
     this.recruitmentSkillDetailRepository   = recruitmentSkillDetailRepository;
     this.dataCategoryRepository             = dataCategoryRepository;
     this.configRecruitmentRequestRepository = configRecruitmentRequestRepository;
     this.logger = logger;
     this.mapper = mapper;
 }
Пример #4
0
        public void Can_Get_Info_RecruitmentRequest()
        {
            //arrange
            int id = 2;

            context = new QLNSContext();
            recruitmentRequestRepository     = new RecruitmentRequestRepository(context);
            recruitmentSkillDetailRepository = new RecruitmentSkillDetailRepository(context);
            recruitmentSkillRepository       = new RecruitmentSkillRepository(context);
            dataCategoryRepository           = new DM_DulieuDanhmucRepository(context);
            //act
            List <RecruitmentSkillDTO> result = new List <RecruitmentSkillDTO>();

            var request = recruitmentRequestRepository.GetById(id);

            if (request != null && !string.IsNullOrEmpty(request.SkillGroups))
            {
                IEnumerable <long> groupSkillIds = request.SkillGroups.ToListNumber <long>(',');
                foreach (var item in groupSkillIds)
                {
                    //nhóm kỹ năng
                    var groupSkill = recruitmentSkillRepository.GetById(item);

                    var groupSkillDTO = new RecruitmentSkillDTO()
                    {
                        Id     = groupSkill.Id,
                        Title  = groupSkill.Title,
                        Skills = groupSkill.Skills
                    };

                    if (groupSkill != null)
                    {
                        groupSkillDTO.GroupSkillDetails = new List <RecruitmentSkillDetailDTO>();
                        if (!string.IsNullOrEmpty(groupSkill.Skills))
                        {
                            //các kỹ năng thuộc nhóm kỹ năng
                            var skillDetailIds = groupSkill.Skills.ToListNumber <long>(',');
                            foreach (var skillDetailId in skillDetailIds)
                            {
                                var dbSkillDetail = recruitmentSkillDetailRepository.GetById(skillDetailId);
                                if (dbSkillDetail != null)
                                {
                                    var dtoSkillDetail = new RecruitmentSkillDetailDTO()
                                    {
                                        Id             = dbSkillDetail.Id,
                                        Name           = dbSkillDetail.Name,
                                        DataType       = dbSkillDetail.DataType,
                                        CategoryId     = dbSkillDetail.CategoryId,
                                        AbsoluteNumber = dbSkillDetail.AbsoluteNumber,
                                    };
                                    //lấy danh sách danh mục có trong database
                                    if (dtoSkillDetail.DataType == DataTypeConstant.CATEGORY)
                                    {
                                        dtoSkillDetail.GroupCategoryData = dataCategoryRepository.FindBy(x => x.GroupId == dtoSkillDetail.CategoryId).ToList();
                                    }
                                    groupSkillDTO.GroupSkillDetails.Add(dtoSkillDetail);
                                }
                            }
                        }
                        result.Add(groupSkillDTO);
                    }
                }
            }

            //assert
            Assert.IsNotNull(result);
        }
 public RecruitmentRequestService(IRecruitmentRequestRepository repository)
 {
     this.repository = repository;
 }