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

            LoanProduct loanProduct = loanProductManager.Select(_productWithValues.Id);

            loanProduct.GracePeriod = 8;
            loanProduct.AnticipatedTotalRepaymentPenaltiesBase = OAnticipatedRepaymentPenaltiesBases.RemainingInterest;
            loanProduct.AnticipatedTotalRepaymentPenalties     = 33;
            loanProduct.ChargeInterestWithinGracePeriod        = true;
            loanProduct.NbOfInstallments = 5;
            loanProduct.NonRepaymentPenalties.InitialAmount    = 111;
            loanProduct.NonRepaymentPenalties.OLB              = 222;
            loanProduct.NonRepaymentPenalties.OverDueInterest  = 333;
            loanProduct.NonRepaymentPenalties.OverDuePrincipal = 444;
            loanProduct.EntryFees = new List <EntryFee>();
            EntryFee fee = new EntryFee();

            fee.Value   = 2;
            fee.IsAdded = true;
            loanProduct.EntryFees.Add(fee);
            loanProductManager.UpdatePackage(loanProduct, false);
            loanProductManager.InsertEntryFees(loanProduct.EntryFees, loanProduct.Id);
            LoanProduct updatedLoanProduct = loanProductManager.Select(loanProduct.Id);

            updatedLoanProduct.EntryFees = loanProductManager.SelectEntryFeesWithoutCycles(updatedLoanProduct.Id, false);

            AssertLoanProduct(loanProduct, updatedLoanProduct, false);
        }
Esempio n. 2
0
 public void UpdatePackage(LoanProduct pPackage, bool updateContracts)
 {
     using (var connection = _productManager.GetConnection())
         using (var transaction = connection.BeginTransaction())
         {
             try
             {
                 _productManager.UpdatePackage(pPackage, updateContracts, transaction);
                 _productManager.DeleteEntryFees(pPackage, transaction);
                 _productManager.InsertEntryFees(pPackage.EntryFees, pPackage.Id, transaction);
                 LoanProductInterceptorUpdate(new Dictionary <string, object>
                 {
                     { "LoanProduct", pPackage },
                     { "SqlTransaction", transaction }
                 });
                 transaction.Commit();
             }
             catch (Exception)
             {
                 transaction.Rollback();
                 throw;
             }
         }
 }
Esempio n. 3
0
 public void UpdatePackage(LoanProduct pPackage, bool updateContracts)
 {
     _productManager.UpdatePackage(pPackage, updateContracts);
     _productManager.DeleteEntryFees(pPackage);
     _productManager.InsertEntryFees(pPackage.EntryFees, pPackage.Id);
 }