Exemplo n.º 1
0
        public void Update(DomainDeposit domainDeposit)
        {
            var deposit = Mapper.Map <Deposit>(domainDeposit);

            Uow.DepositRepository.Update(deposit);
            Uow.SaveChanges();
        }
Exemplo n.º 2
0
        private void Validate(DomainCustomerDeposit customerDeposit, DomainDeposit deposit, int monthCount)
        {
            if (customerDeposit.InitialSum < deposit.MinSum)
            {
                throw BankClientException.ThrowSumLessThanMin();
            }

            if (customerDeposit.InitialSum > deposit.MaxSum)
            {
                throw BankClientException.ThrowSumMoreThanMax();
            }

            if (monthCount < deposit.MinMonthPeriod)
            {
                throw BankClientException.ThrowMonthLessThanMin();
            }

            if (monthCount > deposit.MaxMonthPeriod)
            {
                throw BankClientException.ThrowMonthMoreThanMax();
            }
        }