当前位置: 首页>>代码示例>>C#>>正文


C# Loans.Loan类代码示例

本文整理汇总了C#中OpenCBS.CoreDomain.Contracts.Loans.Loan的典型用法代码示例。如果您正苦于以下问题:C# Loan类的具体用法?C# Loan怎么用?C# Loan使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Loan类属于OpenCBS.CoreDomain.Contracts.Loans命名空间,在下文中一共展示了Loan类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ManualScheduleForm

 public ManualScheduleForm(Loan loan)
 {
     InitializeComponent();
     olvSchedule.RowFormatter = FormatRow;
     Loan = loan;
     InitializeSchedule();
 }
开发者ID:himmelreich-it,项目名称:opencbs,代码行数:7,代码来源:ManualScheduleForm.cs

示例2: LoanDisbursementForm

 public LoanDisbursementForm(Loan pLoan)
 {
     _loan = pLoan;
     _exchangeRate = null;
     InitializeComponent();
     Initialization();
 }
开发者ID:himmelreich-it,项目名称:opencbs,代码行数:7,代码来源:LoanDisbursementForm.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: 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

示例5: ReschedulingForm

 public ReschedulingForm(Loan contract, IClient pClient)
 {
     InitializeComponent();
     _client = pClient;
     _contract = contract;
     InitializeRescheduleComponents();
     Setup();
 }
开发者ID:himmelreich-it,项目名称:opencbs,代码行数:8,代码来源:ReschedulingForm.cs

示例6: testFixtureSetUp

        public void testFixtureSetUp()
        {
            Loan credit = new Loan(new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""),
                ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));
            credit.Id = 4;

            _installmentsOptions = new CalculateInstallmentsOptions(credit.StartDate, OLoanTypes.Flat, true, credit, false);
        }
开发者ID:himmelreich-it,项目名称:opencbs,代码行数:8,代码来源:TestCalculateInstallmentsOptions.cs

示例7: CreditContractRepayForm

 public CreditContractRepayForm(Loan pLoan, IClient pClient)
 {
     InitializeComponent();
     _client = pClient;
     _loan = pLoan;
     SetUp();
     toolTip = new ToolTip();
 }
开发者ID:TalasZh,项目名称:opencbs,代码行数:8,代码来源:CreditContractRepayForm.cs

示例8: LoanSharesForm

 public LoanSharesForm(Loan pLoan, Group pGroup)
 {
     InitializeComponent();
     _loan = pLoan;
     _group = pGroup;
     _total = _loan.LoanShares.Sum(x => x.Amount.Value);
     
     InitializeControls();
 }
开发者ID:aelhadi,项目名称:opencbs,代码行数:9,代码来源:LoanSharesForm.cs

示例9: MembersOfGroup

        public MembersOfGroup(List<Member> pMembers, Loan pLoan, DateTime pDate)
        {
            InitializeComponent();
            _loan = pLoan;
            _paymentDate = pDate;
            OCurrency olb = _loan.CalculateActualOlb();
            Member leader = null;
            int roundTo = _loan.UseCents ? 2 : 0;
            OCurrency loanAmount =
                _loan.Events.GetLoanRepaymentEvents().Where(
                    rpe => rpe.RepaymentType == OPaymentType.PersonTotalPayment && !rpe.Deleted).Aggregate(
                        _loan.Amount, (current, rpe) => current - rpe.Principal);

            foreach (Member person in pMembers)
            {
                OCurrency olbByPerson = 0;
                OCurrency actualOlb = _loan.CalculateActualOlb();

                foreach (LoanShare loanShare in _loan.LoanShares)
                {
                    if (loanShare.PersonId == person.Tiers.Id && person.CurrentlyIn)
                    {
                        olbByPerson = actualOlb*loanShare.Amount/loanAmount;
                    }
                }
                olb -= Math.Round(olbByPerson.Value, roundTo);
                // Define the list items
                if (!person.IsLeader)
                {
                    Color color = person.CurrentlyIn ? Color.Black : Color.Silver;
                    ListViewItem lvi = new ListViewItem {Tag = person, Text = ((Person) person.Tiers).Name};
                    lvi.UseItemStyleForSubItems = false;
                    lvi.ForeColor = color;
                    lvi.SubItems.Add(olbByPerson.GetFormatedValue(_loan.UseCents));
                    listViewMembers.Items.Add(lvi);
                }
                else
                {
                    leader = person;
                    leader.LoanShareAmount = olbByPerson;
                }
            }

            if (leader != null)
            {
                leader.LoanShareAmount += olb;
                Color color = leader.CurrentlyIn ? Color.Red : Color.Silver;
                ListViewItem lvi = new ListViewItem { Tag = leader, Text = ((Person)leader.Tiers).Name };
                lvi.UseItemStyleForSubItems = false;
                lvi.ForeColor = color;
                lvi.SubItems.Add(leader.LoanShareAmount.GetFormatedValue(_loan.UseCents));
                listViewMembers.Items.Add(lvi);
            }
        }
开发者ID:aelhadi,项目名称:opencbs,代码行数:54,代码来源:MembersOfGroup.cs

示例10: TestGetWriteOffContracts

 public void TestGetWriteOffContracts()
 {
     ClosureContractStock closureContractStock = new ClosureContractStock();
     Loan contract1 = new Loan(new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()))
                            {Id = 1};
     Loan contract2 = new Loan(new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));
     contract2.Events.Add(new WriteOffEvent());
     contract2.Id = 2;
     contract2.WrittenOff = true;
     closureContractStock.AddContract(contract1);
     closureContractStock.AddContract(contract2);
     Assert.AreEqual(1,closureContractStock.WriteOffContracts.Count);
 }
开发者ID:aelhadi,项目名称:opencbs,代码行数:13,代码来源:TestClosureContractStock.cs

示例11: TestDeleteContract

 public void TestDeleteContract()
 {
     ClosureContractStock closureContractStock = new ClosureContractStock();
     Loan contract1 = new Loan(new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()))
                            {Id = 1};
     Loan contract2 = new Loan(new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()))
                            {Id = 2};
     closureContractStock.AddContract(contract1);
     closureContractStock.AddContract(contract2);
     Assert.AreEqual(2,closureContractStock.Contracts.Count);
     closureContractStock.DeleteContract(contract1.Id);
     Assert.AreEqual(1,closureContractStock.Contracts.Count);
 }
开发者ID:aelhadi,项目名称:opencbs,代码行数:13,代码来源:TestClosureContractStock.cs

示例12: AddTrancheForm

 public AddTrancheForm(Loan contract, IClient pClient)
 {
     InitializeComponent();
     Setup();
     _client = pClient;
     _contract = contract;
     interestRateNumericUpDown.Value = contract.InterestRate * 100;
     if (contract.Product.InterestRate.HasValue) { /* checkBoxIRChanged.Enabled = false; */ }
     else
     {
         interestRateNumericUpDown.Minimum = Convert.ToDecimal(contract.Product.InterestRateMin * 100);
         interestRateNumericUpDown.Maximum = Convert.ToDecimal(contract.Product.InterestRateMax * 100);
     }
     InitializeTrancheComponents();
 }
开发者ID:BillTheBest,项目名称:opencbs,代码行数:15,代码来源:AddTrancheForm.cs

示例13: ManualScheduleForm

        public ManualScheduleForm(Loan loan)
        {
            InitializeComponent();
            olvSchedule.RowFormatter = FormatRow;
            Loan = loan;
            InitializeSchedule();

            ObjectListView.EditorRegistry.Register(typeof(DateTime), delegate
            {
                var picker = new DateTimePicker();
                picker.Format = DateTimePickerFormat.Custom;
                picker.CustomFormat = ApplicationSettings.GetInstance("").SHORT_DATE_FORMAT;
                return picker;
            });
        }
开发者ID:won21kr,项目名称:opencbs,代码行数:15,代码来源:ManualScheduleForm.cs

示例14: 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

示例15: 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


注:本文中的OpenCBS.CoreDomain.Contracts.Loans.Loan类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。