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

            _exoticInstallmentsTable.Name = "Test";
            int id = loanProductManager.AddExoticInstallmentsTable(_exoticInstallmentsTable);

            Assert.AreNotEqual(0, id);
        }
Esempio n. 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);
        }