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();
            }
        }
예제 #2
0
 public void Update(DomainDeposit domainDeposit)
 {
     var deposit = Mapper.Map<Deposit>(domainDeposit);
     Uow.DepositRepository.Update(deposit);
     Uow.SaveChanges();
 }