本文整理汇总了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();
}
示例2: LoanDisbursementForm
public LoanDisbursementForm(Loan pLoan)
{
_loan = pLoan;
_exchangeRate = null;
InitializeComponent();
Initialization();
}
示例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);
}
示例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);
}
示例5: ReschedulingForm
public ReschedulingForm(Loan contract, IClient pClient)
{
InitializeComponent();
_client = pClient;
_contract = contract;
InitializeRescheduleComponents();
Setup();
}
示例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);
}
示例7: CreditContractRepayForm
public CreditContractRepayForm(Loan pLoan, IClient pClient)
{
InitializeComponent();
_client = pClient;
_loan = pLoan;
SetUp();
toolTip = new ToolTip();
}
示例8: LoanSharesForm
public LoanSharesForm(Loan pLoan, Group pGroup)
{
InitializeComponent();
_loan = pLoan;
_group = pGroup;
_total = _loan.LoanShares.Sum(x => x.Amount.Value);
InitializeControls();
}
示例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);
}
}
示例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);
}
示例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);
}
示例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();
}
示例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;
});
}
示例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);
}
示例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);
}