Пример #1
0
        public async Task Handle(UpdateUnionDues command)
        {
            var union = await _salaryCalculationDbContext.UnionDues.SingleAsync(p => p.Id == command.Id && p.TenantId == command.TenantId);

            union.Update(command.PaycodeId, command.Name, command.UseAmount, command.DuesDeductionRate, command.DuesDeductionAmount, command.MaximumDueAmount, command.MinimumDueAmount, _bus);
            await _salaryCalculationDbContext.SaveChangesAsync();
        }
Пример #2
0
        public async Task Handle(CreateUnionDues command)
        {
            var company = await _salaryCalculationDbContext.Companies.Include(c => c.Paycodes).SingleAsync(c => c.TenantId == command.TenantId && c.Id == command.CompanyId);

            var unionDuesToCreate = command.UnionDuesToCreate;

            company.AddUnionDues(command.UnionDuesId, unionDuesToCreate.Name, unionDuesToCreate.UseAmount, unionDuesToCreate.DuesDeductionRate, unionDuesToCreate.DuesDeductionAmount, unionDuesToCreate.MaximumDueAmount, unionDuesToCreate.MinimumDueAmount, unionDuesToCreate.PaycodeId.Value);
            await _salaryCalculationDbContext.SaveChangesAsync();
        }