Exemplo n.º 1
0
 public DM_DulieuDanhmucService(IUnitOfWork unitOfWork, IDM_DulieuDanhmucRepository dM_DulieuDanhmucRepository, IDM_NhomDanhmucRepository nhomDanhmucRepository, ILog loger) : base(unitOfWork, dM_DulieuDanhmucRepository)
 {
     _unitOfWork = unitOfWork;
     _dM_DulieuDanhmucRepository = dM_DulieuDanhmucRepository;
     _nhomDanhmucRepository      = nhomDanhmucRepository;
     _loger = loger;
     _loger.Info("Khởi tạo DM_DulieuDanhmuc service");
 }
Exemplo n.º 2
0
 public DM_NhomDanhmucService(IUnitOfWork unitOfWork,
                              IDM_NhomDanhmucRepository dmNhomDanhmucRepository,
                              IDM_DulieuDanhmucRepository categoryDataRepository,
                              IMapper mapper,
                              ILog loger) : base(unitOfWork, dmNhomDanhmucRepository)
 {
     _unitOfWork = unitOfWork;
     _dM_NhomDanhmucRepository   = dmNhomDanhmucRepository;
     this.categoryDataRepository = categoryDataRepository;
     this.mapper = mapper;
     _loger      = loger;
     _loger.Info("Khởi tạo DM_NhomDanhmuc service");
 }
 public RecruitmentSkillDetailService(IUnitOfWork unitOfWork,
                                      IRecruitmentSkillDetailRepository recruitmentSkillDetailRepository,
                                      IDM_DulieuDanhmucRepository categoryDataRepository,
                                      IDM_NhomDanhmucRepository categoryRepository,
                                      ILog logger) :
     base(unitOfWork, recruitmentSkillDetailRepository)
 {
     this.recruitmentSkillDetailRepository = recruitmentSkillDetailRepository;
     this.categoryDataRepository           = categoryDataRepository;
     this.logger             = logger;
     this.categoryRepository = categoryRepository;
     this.logger.Info("Khởi tạo RecruitmentSkillDetailService");
 }
Exemplo n.º 4
0
 public ConfigRecruitmentRequestService(
     IUnitOfWork unitOfWork,
     IConfigRecruitmentRequestRepository configRecruitmentRequestRepository,
     IRecruitmentSkillRepository recruitmentSkillRepository,
     IRecruitmentSkillDetailRepository recruitmentSkillDetailRepository,
     IDM_DulieuDanhmucRepository dataCategoryRepository,
     ILog logger)
     : base(unitOfWork, configRecruitmentRequestRepository)
 {
     this.configRecruitmentRequestRepository = configRecruitmentRequestRepository;
     this.recruitmentSkillRepository         = recruitmentSkillRepository;
     this.recruitmentSkillDetailRepository   = recruitmentSkillDetailRepository;
     this.dataCategoryRepository             = dataCategoryRepository;
     this.logger = logger;
     this.logger.Info("Khởi tạo ConfigRecruitmentRequestService");
 }
Exemplo n.º 5
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;
 }
Exemplo n.º 6
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;
 }
Exemplo n.º 7
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);
        }