예제 #1
0
        public async Task EditAsync(SalesTaxEditModel model)
        {
            var salesTax = await _repository.GetAsync(model.Id);

            SalesTaxFactory.Create(model, salesTax, _userId);
            _repository.Edit(salesTax);
            await _unitOfWork.SaveChangesAsync();
        }
예제 #2
0
        public async Task AddAsync(SalesTaxAddModel model)
        {
            var result = await _bankAccountRepository.getAccountTypeByCode();

            var bankAcc = SalesTaxFactory.AccountCreate(model, _userId, result.KeyInt);
            await _bankAccountRepository.AddAsync(bankAcc);

            await _unitOfWork.SaveChangesAsync();

            await _repository.AddAsync(SalesTaxFactory.Create(model, _userId, bankAcc.Id));

            await _unitOfWork.SaveChangesAsync();
        }