public void AddExoticInstallment()
        {
            LoanProductManager loanProductManager = (LoanProductManager)container["LoanProductManager"];

            loanProductManager.AddExoticInstallment(new ExoticInstallment {
                Number = 2, InterestCoeff = null, PrincipalCoeff = 2
            }, _exoticInstallmentsTable);
        }
Example #2
0
        public int AddExoticProduct(ExoticInstallmentsTable pExoticProduct, OLoanTypes loanType)
        {
            if (_productManager.IsThisExoticProductNameAlreadyExist(pExoticProduct.Name))
            {
                throw new OpenCbsPackageSaveException(OpenCbsPackageSaveExceptionEnum.ExoticProductNameAlreadyExist);
            }
            if (!pExoticProduct.CheckIfSumIsOk(loanType))
            {
                throw new OpenCbsPackageSaveException(OpenCbsPackageSaveExceptionEnum.ExoticProductSumInIncorrect);
            }

            pExoticProduct.Id = _productManager.AddExoticInstallmentsTable(pExoticProduct);

            foreach (ExoticInstallment installment in pExoticProduct)
            {
                _productManager.AddExoticInstallment(installment, pExoticProduct);
            }

            return(pExoticProduct.Id);
        }