當前位置: 首頁>>代碼示例>>C#>>正文


C# Products.LoanProduct類代碼示例

本文整理匯總了C#中OpenCBS.CoreDomain.Products.LoanProduct的典型用法代碼示例。如果您正苦於以下問題:C# LoanProduct類的具體用法?C# LoanProduct怎麽用?C# LoanProduct使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


LoanProduct類屬於OpenCBS.CoreDomain.Products命名空間,在下文中一共展示了LoanProduct類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: FrmAvalaibleLoanProducts

 public FrmAvalaibleLoanProducts()
 {
     InitializeComponent();
     InitializePackages();
     _package = new LoanProduct();
     _selectedPackage = new LoanProduct();
 }
開發者ID:aelhadi,項目名稱:opencbs,代碼行數:7,代碼來源:FrmAvalaibleLoanProducts.cs

示例2: DecliningRate_ExoticInstallments_GracePeriod

        public void DecliningRate_ExoticInstallments_GracePeriod()
        {
            LoanProduct package = new LoanProduct
            {
                InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
                LoanType = OLoanTypes.DecliningFixedInstallments,
                ChargeInterestWithinGracePeriod = true,
                                          ExoticProduct = new ExoticInstallmentsTable
                                                              {
                                                                  new ExoticInstallment(1, 0.1, null),
                                                                  new ExoticInstallment(2, 0.1, null),
                                                                  new ExoticInstallment(3, 0.1, null),
                                                                  new ExoticInstallment(4, 0.1, null),
                                                                  new ExoticInstallment(5, 0.1, null),
                                                                  new ExoticInstallment(6, 0.5, null)
                                                              },
                Currency = new Currency { Id = 1 }
                                      };
            Loan myContract = new Loan(package, 1000, 0.03m, 7, 1, new DateTime(2006, 1, 1), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));

            _AssertSpecifiedInstallment(myContract.GetInstallment(0), 1, new DateTime(2006, 2, 1), 30.00m,       0, 1000);
            _AssertSpecifiedInstallment(myContract.GetInstallment(1), 2, new DateTime(2006, 3, 1), 30.00m, 100.00m, 1000);
            _AssertSpecifiedInstallment(myContract.GetInstallment(2), 3, new DateTime(2006, 4, 3), 27.00m, 100.00m,  900);
            _AssertSpecifiedInstallment(myContract.GetInstallment(3), 4, new DateTime(2006, 5, 1), 24.00m, 100.00m,  800);
            _AssertSpecifiedInstallment(myContract.GetInstallment(4), 5, new DateTime(2006, 6, 1), 21.00m, 100.00m,  700);
            _AssertSpecifiedInstallment(myContract.GetInstallment(5), 6, new DateTime(2006, 7, 3), 18.00m, 100.00m,  600);
            _AssertSpecifiedInstallment(myContract.GetInstallment(6), 7, new DateTime(2006, 8, 1), 15.00m, 500.00m,  500);
        }
開發者ID:aelhadi,項目名稱:opencbs,代碼行數:28,代碼來源:TestCalculateInstallmentsDecliningRateWithCents.cs

示例3: CalculateExpectedOLB2

        public void CalculateExpectedOLB2()
        {
            LoanProduct package = new LoanProduct
            {
                InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
                LoanType = OLoanTypes.Flat,
                ChargeInterestWithinGracePeriod = true,
                Currency = new Currency { Id = 1 }
            };
            package.KeepExpectedInstallment = false;
            package.AnticipatedTotalRepaymentPenaltiesBase = OAnticipatedRepaymentPenaltiesBases.RemainingOLB;
            Loan myContract = new Loan(package, 20000, 0.02m, 10, 0, new DateTime(2009, 1, 17), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));
            myContract.BadLoan = false;

            myContract.Repay(1, new DateTime(2009, 1, 17), 1000, true, false);

            Assert.AreEqual(19000, myContract.CalculateExpectedOlb(1, false).Value);
            Assert.AreEqual(17100, myContract.CalculateExpectedOlb(2, false).Value);
            Assert.AreEqual(15200, myContract.CalculateExpectedOlb(3, false).Value);
            Assert.AreEqual(13300, myContract.CalculateExpectedOlb(4, false).Value);
            Assert.AreEqual(11400, myContract.CalculateExpectedOlb(5, false).Value);
            Assert.AreEqual(9500, myContract.CalculateExpectedOlb(6, false).Value);
            Assert.AreEqual(7600, myContract.CalculateExpectedOlb(7, false).Value);
            Assert.AreEqual(5700, myContract.CalculateExpectedOlb(8, false).Value);
            Assert.AreEqual(3800, myContract.CalculateExpectedOlb(9, false).Value);
            Assert.AreEqual(1900, myContract.CalculateExpectedOlb(10, false).Value);
        }
開發者ID:TalasZh,項目名稱:opencbs,代碼行數:27,代碼來源:TestOLBCalculation.cs

示例4: FrmAvalaibleLoanProducts

 public FrmAvalaibleLoanProducts()
 {
     InitializeComponent();
     _package = new LoanProduct();
     InitializePackages();
     webBrowserPackage.ObjectForScripting = this;
 }
開發者ID:TalasZh,項目名稱:opencbs,代碼行數:7,代碼來源:FrmAvalaibleLoanProducts.cs

示例5: VillageAddLoanForm

 public VillageAddLoanForm(Village village, LoanProduct product, NonSolidaryGroupForm nsgForm)
 {
     _village = village;
     _product = product;
     _nsgForm = nsgForm;
     _product.EntryFees = ServicesProvider.GetInstance().GetProductServices().GetProductEntryFees(_product, village);
     _fLServices = new FundingLineServices(User.CurrentUser);
     _accumulatedAmount = 0;
     InitializeComponent();
     InitializeControls();
 }
開發者ID:himmelreich-it,項目名稱:opencbs,代碼行數:11,代碼來源:VillageAddLoanForm.cs

示例6: SetUp

        public void SetUp()
        {
            _rules = new AccountingRuleCollection();
            _accounts = DefaultAccounts.DefaultAccount(1);

            Account cashSavings = new Account("1020", "CASH_SAVINGS", 0, "CASH_SAVIGNS", true, OAccountCategories.BalanceSheetAsset, 1);
            _accounts.Add(cashSavings);

            _rules.Add(new ContractAccountingRule
            {
                DebitAccount = _accounts[0],
                CreditAccount = cashSavings,
                ProductType = OProductTypes.Saving,
                SavingProduct = null,
                ClientType = OClientTypes.All,
                EconomicActivity = null,
                BookingDirection = OBookingDirections.Both
            });

            _loanProductEde34 = new LoanProduct { Id = 1, Code = "EDE34", Name = "EDEN 34", Currency = new Currency { Id = 1} };

            Account cashEDE34 = new Account("1051", "CASH_EDE34", 0, "CASH_EDE34", true, OAccountCategories.BalanceSheetAsset, 1);
            _accounts.Add(cashEDE34);

            _rules.Add(new ContractAccountingRule
            {
                DebitAccount = _accounts[0],
                CreditAccount = cashEDE34,
                ProductType = OProductTypes.Loan,
                LoanProduct = _loanProductEde34,
                ClientType = OClientTypes.Person,
                EconomicActivity = new EconomicActivity(1, "Agriculture", null, false),
                BookingDirection = OBookingDirections.Both
            });

            _loanProductEde60 = new LoanProduct { Id = 2, Code = "EDE60", Name = "EDEN 60", Currency = new Currency { Id = 1 } };

            Account cashEDE60 = new Account("1052", "CASH_EDE60", 0, "CASH_EDE60", true, OAccountCategories.BalanceSheetAsset, 1);
            _accounts.Add(cashEDE60);

            _rules.Add(new ContractAccountingRule
            {
                DebitAccount = _accounts[0],
                CreditAccount = cashEDE60,
                ProductType = OProductTypes.Loan,
                LoanProduct = _loanProductEde60,
                ClientType = OClientTypes.Person,
                EconomicActivity = new EconomicActivity(1, "Agriculture", null, false),
                BookingDirection = OBookingDirections.Credit
            });
        }
開發者ID:aelhadi,項目名稱:opencbs,代碼行數:51,代碼來源:TestAccountingRuleCollection.cs

示例7: FlatRate_BiWeeklyInstallmentType_GracePeriod

        public void FlatRate_BiWeeklyInstallmentType_GracePeriod()
        {
            LoanProduct package = new LoanProduct
            {
                InstallmentType = new InstallmentType(1, "Bi-Weekly", 14, 0),
                LoanType = OLoanTypes.Flat,
                ChargeInterestWithinGracePeriod = true,
                Currency = new Currency { Id = 1, UseCents = true}
            };
            Loan myContract = new Loan(package, 1000, 0.03m, 6, 2, new DateTime(2006, 1, 1), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));

            _AssertSpecifiedInstallment(myContract.GetInstallment(0), 1, new DateTime(2006, 1, 16), 32.14m, 0, 1000);
            _AssertSpecifiedInstallment(myContract.GetInstallment(1), 2, new DateTime(2006, 1, 30), 30.00m,   0, 1000);
            _AssertSpecifiedInstallment(myContract.GetInstallment(2), 3, new DateTime(2006, 2, 13), 30.00m, 250, 1000);
            _AssertSpecifiedInstallment(myContract.GetInstallment(3), 4, new DateTime(2006, 2, 27), 30.00m, 250,  750);
            _AssertSpecifiedInstallment(myContract.GetInstallment(4), 5, new DateTime(2006, 3, 13), 30.00m, 250,  500);
            _AssertSpecifiedInstallment(myContract.GetInstallment(5), 6, new DateTime(2006, 3, 27), 30.00m, 250,  250);
        }
開發者ID:aelhadi,項目名稱:opencbs,代碼行數:18,代碼來源:TestCalculateInstallmentsFlatRateWithCents.cs

示例8: CalculateRemainingInterest_AccrualAccounting

        public void CalculateRemainingInterest_AccrualAccounting()
        {
            ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.ACCOUNTINGPROCESS, OAccountingProcesses.Accrual);
            LoanProduct package = new LoanProduct
            {
                InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
                LoanType = OLoanTypes.Flat,
                ChargeInterestWithinGracePeriod = true,
                Currency = new Currency { Id = 1, UseCents = true}
            };
            Loan myContract = new Loan(package, 1000, 0.03m, 6, 0, new DateTime(2009, 12, 25), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));

            myContract.Repay(1, new DateTime(2010, 1, 25), 196.67m, false, true);

            Assert.AreEqual(17.42m, Math.Round(myContract.CalculateRemainingInterests(new DateTime(2010, 2, 12)).Value, 2));

            ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.ACCOUNTINGPROCESS, OAccountingProcesses.Cash);
        }
開發者ID:BillTheBest,項目名稱:opencbs,代碼行數:18,代碼來源:TestCreditContract.cs

示例9: DecliningBadLoanWith42dayslateWhenNonRepaymentFeesBaseOnInitialAmountAndKeepNotExpectedInstallment

        public void DecliningBadLoanWith42dayslateWhenNonRepaymentFeesBaseOnInitialAmountAndKeepNotExpectedInstallment()
        {
            LoanProduct package = new LoanProduct
            {
                InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
                LoanType = OLoanTypes.DecliningFixedInstallments,
                ChargeInterestWithinGracePeriod = true,
                Currency = new Currency { Id = 1, UseCents = true},
                RoundingType = ORoundingType.Approximate
            };
            package.KeepExpectedInstallment = false;
            package.AnticipatedTotalRepaymentPenaltiesBase = OAnticipatedRepaymentPenaltiesBases.RemainingOLB;
            Loan myContract = new Loan(package, 1000, 0.03m, 6, 1, new DateTime(2006, 1, 1), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));
            myContract.BadLoan = true;
            myContract.NonRepaymentPenalties.InitialAmount = 0.003;
            myContract.AnticipatedTotalRepaymentPenalties = 0.01;

            CreditContractOptions cCO = new CreditContractOptions(package.LoanType,package.KeepExpectedInstallment,false,0,0,false,0,package.AnticipatedTotalRepaymentPenaltiesBase);
            repayStrategy = new CalculateMaximumAmountToRegradingLoanStrategy(cCO, myContract, new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""));

            //30 + 218.35 + 1000 * 0.003 * 42
            Assert.AreEqual(374.35m, repayStrategy.CalculateMaximumAmountToRegradingLoan(new DateTime(2006, 3, 15)).Value);
        }
開發者ID:TalasZh,項目名稱:opencbs,代碼行數:23,代碼來源:TestCalculateMaximumAmountToRegradingLoanWithCents.cs

示例10: CalculateRemainingInterest_CashAccounting_AfterFirstInstallment

        public void CalculateRemainingInterest_CashAccounting_AfterFirstInstallment()
        {
            LoanProduct package = new LoanProduct
                                      {
                                          InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
                                          LoanType = OLoanTypes.Flat,
                                          ChargeInterestWithinGracePeriod = true,
                                          Currency = new Currency { Id = 1 }
                                      };
            Loan myContract = new Loan(package, 1000, 0.03m, 6, 1, new DateTime(2006, 1, 1), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));

            Assert.AreEqual(30, Math.Round(myContract.CalculateRemainingInterests(new DateTime(2006, 2, 14)).Value, 2));
        }
開發者ID:BillTheBest,項目名稱:opencbs,代碼行數:13,代碼來源:TestCreditContract.cs

示例11: TestDisburseWhenDisableFeesTrue

        public void TestDisburseWhenDisableFeesTrue()
        {
            ApplicationSettings pDataParam = ApplicationSettings.GetInstance("");
            pDataParam.DeleteAllParameters();
            pDataParam.AddParameter("ALIGN_INSTALLMENTS_ON_REAL_DISBURSEMENT_DATE", false);
            pDataParam.AddParameter("PAY_FIRST_INSTALLMENT_REAL_VALUE", true);
            pDataParam.AddParameter(OGeneralSettings.DONOTSKIPWEEKENDSININSTALLMENTSDATE, false);
            pDataParam.AddParameter(OGeneralSettings.INCREMENTALDURINGDAYOFF, true);

            LoanProduct package = new LoanProduct
                                      {
                                          InstallmentType = new InstallmentType(1, "Bi-Weelky", 14, 0),
                                          LoanType = OLoanTypes.Flat,
                                          ChargeInterestWithinGracePeriod = true,
                                          Currency = new Currency { Id = 1 }
                                      };
            Loan myContract = new Loan(package,1000,0.02m,6,1,new DateTime(2006,1,2), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));
            EntryFee productFee = new EntryFee();
            productFee.Value = 5;
            productFee.IsRate = true;

            LoanEntryFee entryFee = new LoanEntryFee();
            entryFee.FeeValue = 5;
            entryFee.ProductEntryFee = productFee;
            myContract.LoanEntryFeesList = new List<LoanEntryFee>();
            myContract.LoanEntryFeesList.Add(entryFee);

            LoanDisbursmentEvent lDE = myContract.Disburse(new DateTime(2006,1,6),false,true);
            Assert.AreEqual(new DateTime(2006,1,2),myContract.StartDate);
            Assert.AreEqual(14.29m,myContract.GetInstallment(0).InterestsRepayment.Value);
            Assert.AreEqual(1000m,lDE.Amount.Value);
            Assert.AreEqual(null, lDE.Commissions);
        }
開發者ID:BillTheBest,項目名稱:opencbs,代碼行數:33,代碼來源:TestCreditContract.cs

示例12: TestCountFeesWithSmallPrepayment

        public void TestCountFeesWithSmallPrepayment()
        {
            ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.CALCULATIONLATEFEESDURINGPUBLICHOLIDAYS, true);
            ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.ACCOUNTINGPROCESS, OAccountingProcesses.Accrual);
            ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.STOP_WRITEOFF_PENALTY, true);

            LoanProduct package = new LoanProduct
            {
                InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
                LoanType = OLoanTypes.DecliningFixedInstallments,
                ChargeInterestWithinGracePeriod = true,
                Currency = new Currency { Id = 1, UseCents = true }
            };

            Loan myContract = new Loan(package, 1000, 0.03m, 6, 1, new DateTime(2010, 1, 1), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));
            myContract.NonRepaymentPenalties.OverDuePrincipal = 0.01;

            Assert.AreEqual(new DateTime(2010, 2, 1), myContract.GetInstallment(0).ExpectedDate);
            Assert.AreEqual(new DateTime(2010, 3, 1), myContract.GetInstallment(1).ExpectedDate);

            myContract.Repay(1, new DateTime(2010, 2, 1), 30, true, false);
            myContract.Repay(2, new DateTime(2010, 2, 26), 30, true, false);

            RepaymentEvent rPE = myContract.Repay(2, new DateTime(2010, 3, 4), 196.58m, false, false);
            Assert.AreEqual(5.63m, rPE.Fees.Value);
            Assert.AreEqual(3.2m, rPE.Interests.Value);
            Assert.AreEqual(187.75m, rPE.Principal.Value);

            Assert.AreEqual(myContract.GetInstallment(1).IsRepaid, true);
        }
開發者ID:BillTheBest,項目名稱:opencbs,代碼行數:30,代碼來源:TestCreditContract.cs

示例13: TestCalculateTotalInterests

 public void TestCalculateTotalInterests()
 {
     LoanProduct package = new LoanProduct
                               {
                                   InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
                                   LoanType = OLoanTypes.Flat,
                                   ChargeInterestWithinGracePeriod = true,
                                   Currency = new Currency { Id = 1 }
                               };
     Loan myContract = new Loan(package,1000,0.03m,6,1,new DateTime(2006,6,30), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));
     Assert.AreEqual(181m, myContract.CalculateTotalInterests().Value);
 }
開發者ID:BillTheBest,項目名稱:opencbs,代碼行數:12,代碼來源:TestCreditContract.cs

示例14: TestCalculateRemainingInterestsWithDateTimeParameter

 public void TestCalculateRemainingInterestsWithDateTimeParameter()
 {
     LoanProduct package = new LoanProduct
                               {
                                   InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
                                   LoanType = OLoanTypes.DecliningFixedInstallments,
                                   ChargeInterestWithinGracePeriod = true,
                                   Currency = new Currency { Id = 1, UseCents = true}
                               };
     Loan myContract = new Loan(package,750,0.03m,9,1,new DateTime(2006,6,22), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));
     Assert.AreEqual(46.5m, Math.Round(myContract.CalculateRemainingInterests(new DateTime(2006, 8, 22)).Value, 2));
 }
開發者ID:BillTheBest,項目名稱:opencbs,代碼行數:12,代碼來源:TestCreditContract.cs

示例15: TestCalculatePastDueSinceLastRepaymentWhenSameYearAndLimitBypassed

        public void TestCalculatePastDueSinceLastRepaymentWhenSameYearAndLimitBypassed()
        {
            LoanProduct package = new LoanProduct
                                      {
                                          InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
                                          LoanType = OLoanTypes.Flat,
                                          ChargeInterestWithinGracePeriod = true,
                                          Currency = new Currency { Id = 1 },
                                          KeepExpectedInstallment = false
                                      };
            Loan myContract = new Loan(package, 1000, 0.03m, 6, 2, new DateTime(2006, 1, 1), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));

            myContract.Repay(1, new DateTime(2006, 2, 1), 30, true, false);
            DateTime limit = new DateTime(2006, 5, 1);

            Assert.AreEqual(61, myContract.CalculatePastDueSinceLastRepayment(limit));
        }
開發者ID:BillTheBest,項目名稱:opencbs,代碼行數:17,代碼來源:TestCreditContract.cs


注:本文中的OpenCBS.CoreDomain.Products.LoanProduct類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。