示例#1
0
 public EmployeeBenefitsController(IOptionsMonitor <ApiSettings> settings, IEmployeeRepository employeeRepository, IDependentRepository dependentRepository, IBenefitsRepository benefitsRepository)
 {
     _settings            = settings.CurrentValue;
     _employeeRepository  = employeeRepository;
     _dependentRepository = dependentRepository;
     _benefitsRepository  = benefitsRepository;
 }
示例#2
0
 public AdminController(EmployeeRepository employeeRepository,
                        DependentRepository dependentRepository,
                        BenefitSettingsRepository benefitSettingsRepository,
                        DiscountRepository discountRepository,
                        DiscountTypeRepository discountTypeRepository,
                        DiscountConditionTypeRepository discountConditionTypeRepository,
                        StateRepository stateRepository)
 {
     EmployeeRepository              = employeeRepository;
     DependentRepository             = dependentRepository;
     BenefitSettingsRepository       = benefitSettingsRepository;
     DiscountRepository              = discountRepository;
     DiscountTypeRepository          = discountTypeRepository;
     DiscountConditionTypeRepository = discountConditionTypeRepository;
     StateRepository = stateRepository;
 }
示例#3
0
        protected virtual void Dispose(bool disposing)
        {
            if (_disposed)
            {
                return;
            }

            if (disposing)
            {
                // free other managed objects that implement IDisposable only
                _repository.Dispose();
            }

            // release any unmanaged objects set the object references to null
            _repository = null;

            _disposed = true;
        }
 public async Task <Dependent> GetDependentAsync(IDependentRepository dependetRepository, Guid dependentId)
 {
     //todo: add logs and error checking
     return(await dependetRepository.GetDependentAsync(dependentId));
 }
 public async Task UpdateDependetAsync(IDependentRepository dependetRepository, UpdateDependentModel dependetToUpdate)
 {
     //todo: add logs and error checking
     await dependetRepository.UpdateDependentAsync(dependetToUpdate);
 }
示例#6
0
 public DependentDomain(IDependentRepository repository)
 {
     _repository = repository;
 }
示例#7
0
 public UpsertDependentHandler(IDependentRepository dependentRepository, IMapper mapper)
 {
     _dependentRepository = dependentRepository ?? throw new ArgumentNullException(nameof(dependentRepository));
     _mapper = mapper ?? throw new ArgumentNullException(nameof(mapper));
 }
 public DependentComponent(IDependentRepository dependentRepository, IMapper mapper)
 {
     _dependentRepository = dependentRepository;
     _mapper = mapper;
 }
        private async Task <List <InputEmployee> > GetInputEmployees(List <Employee> employees, IDependentRepository dependentRepository)
        {
            var inputEmployees = new List <InputEmployee>();

            foreach (var employee in employees)
            {
                var eTemp = new InputEmployee();
                eTemp.Id   = employee.Id;
                eTemp.Name = $"{employee.FirstName} {employee.LastName}";

                employee.Dependents = await dependentRepository.GetAllEmployeeDependentsAsync(employee.Id);

                foreach (var d in employee.Dependents)
                {
                    var dTemp = new InputDependent();
                    dTemp.Id   = d.Id;
                    dTemp.Name = $"{d.FirstName} {d.LastName}";
                    eTemp.InputDependents.Add(dTemp);
                }
                inputEmployees.Add(eTemp);
            }
            return(inputEmployees);
        }
        public async Task <List <EmpDependetsBenefitDetails> > GetEmployeeWithCurrentSalaryAsync(IEmployeeRepository employeeRepository, IDependentRepository dependentRepository, IBenefitsRepository benefitsRepository)
        {
            var employees = await employeeRepository.GetAllEmployeesAsync();

            var inputEmployees = await GetInputEmployees(employees, dependentRepository);

            var medBenefits = await benefitsRepository.GetEmployeeMedBenefitsAsync(inputEmployees);

            medBenefits = AppendCurrentSalary(employees, medBenefits);

            return(medBenefits);
        }
        public async Task <Employee> GetEmployeeWithDependentsAsync(IEmployeeRepository employeeRepository, IDependentRepository dependentRepository, Guid employeeId)
        {
            var employee = await employeeRepository.GetEmployeeWithDependentsAsync(employeeId);

            employee.Dependents = await dependentRepository.GetAllEmployeeDependentsAsync(employeeId);

            return(employee);
        }
示例#12
0
 public UnitOfWork(ApplicationDbContext context)
 {
     _context   = context;
     Employees  = new EmployeeRepository(context);
     Dependents = new DependentRepository(context);
 }
示例#13
0
 public DependentController(IDependentRepository repository)
 {
     this.repository = repository;
 }
 public EmployeeCommandHandler(IEmployeeRepository employeeRepository, IDependentRepository dependentRepository, IUnitOfWork unitOfWork)
 {
     _employeeRepository  = employeeRepository;
     _unitOfWork          = unitOfWork;
     _dependentRepository = dependentRepository;
 }
 public async Task AddDependetAsync(IDependentRepository dependetRepository, AddDependentModel addDependentModel)
 {
     //todo: add logs and error checking
     await dependetRepository.AddDependentAsync(addDependentModel);
 }
 public EmployeeDomain(IEmployeeRepository repository, IDependentRepository repositoryDependent)
 {
     _repository          = repository;
     _repositoryDependent = repositoryDependent;
 }
示例#17
0
 public EmployeeSeedBucketAction(IEmployeeRepository employeeRepository, IDependentRepository dependentRepository)
 {
     _employeeRepository  = employeeRepository ?? throw new ArgumentNullException(nameof(employeeRepository));
     _dependentRepository = dependentRepository ?? throw new ArgumentNullException(nameof(dependentRepository));
 }
示例#18
0
 public DependentController(IDependentRepository dependentRepository)
 {
     _dependentRepository = dependentRepository;
 }
示例#19
0
 public DependentService(IDependentRepository dependentRepository)
 {
     _dependentRepository = dependentRepository;
 }
 public DependentRepositoryFixture()
 {
     _repository = new DependentRepository(Context);
     _builder    = new DependentBuilder();
     _helper     = new DependentHelper(Context);
 }