Beispiel #1
0
        public void GetBenefitDeductionsPositive()
        {
            IEmployeeRepository EmployeeRepos = new EmployeeRepository();

            var AEmployee = EmployeeRepos.GetEmployeeById(1);

            Assert.IsNotNull(AEmployee);

            List <IFamilyMember> FamilyMembers = EmployeeRepos.GetFamilyMembers(AEmployee);

            Assert.IsNotNull(FamilyMembers);

            ISalaryRepository SalaryEmployeeRepos = new SalaryRepository(AEmployee);

            ISalary AEmployeeSalary = SalaryEmployeeRepos.GetSalary();

            Assert.IsNotNull(AEmployeeSalary);

            IBenefitDeductionRepository BenefitDeductionRepos =
                new BenefitDeductionRepository(AEmployee, FamilyMembers, AEmployeeSalary);

            IBenefitDeductionDetail ABenefitDeductionDetail =
                BenefitDeductionRepos.CalculateBenefitDeductionDetail();

            Assert.IsNotNull(ABenefitDeductionDetail);
        }
Beispiel #2
0
        public static BenefitDeductionDetailDto Convert(IBenefitDeductionDetail aBenefitDeductDetail)
        {
            if (aBenefitDeductDetail == null)
            {
                return(null);
            }

            var MapperConfig = new MapperConfiguration(cfg => {
                cfg.CreateMap <IBenefitDeductionDetail, BenefitDeductionDetailDto>();
                cfg.CreateMap <IBenefitDeductionItem, BenefitDeductionItemDto>();
            });

            IMapper iMapper = MapperConfig.CreateMapper();

            var Results = iMapper.Map <IBenefitDeductionDetail, BenefitDeductionDetailDto>(aBenefitDeductDetail);

            return(Results);
        }
Beispiel #3
0
        public ActionResult <BenefitDeductionDetailDto> Get(int employeeId)
        {
            IEmployeeRepository EmployeeRepos = new EmployeeRepository();

            var AEmployee = EmployeeRepos.GetEmployeeById(employeeId);

            List <IFamilyMember> FamilyMembers = EmployeeRepos.GetFamilyMembers(AEmployee);

            ISalaryRepository SalaryEmployeeRepos = new SalaryRepository(AEmployee);

            ISalary AEmployeeSalary = SalaryEmployeeRepos.GetSalary();

            IBenefitDeductionRepository BenefitDeductionRepos =
                new BenefitDeductionRepository(AEmployee, FamilyMembers, AEmployeeSalary);

            IBenefitDeductionDetail ABenefitDeductionDetail =
                BenefitDeductionRepos.CalculateBenefitDeductionDetail();


            var ABenefitDeductionDetailDto = Util.Converters.
                                             BenefitDeductionDetailConverter.Convert(ABenefitDeductionDetail);

            return(ABenefitDeductionDetailDto);
        }