コード例 #1
0
ファイル: LoanUI.cs プロジェクト: RobertGilb/CSharpINF3121
        private void AdditionalInit()
        {
            // this.mortgage
            mortgage = new Mortgage();

            //this.mortgagePayment
            mortgagePayment = new AnnualSeriesRepayment(mortgage);

            // this.comboBoxLoanTypes
            this.comboBoxLoanTypes.Items.Add(mortgage);
            this.comboBoxLoanTypes.SelectedIndex = 0;
        }
コード例 #2
0
ファイル: LoanUI.cs プロジェクト: RobertGilb/CSharpINF3121
        private System.Windows.Forms.ListViewItem [] getListViewItemPayments(BankServices.Loans.AnnualSeries.AnnualSeriesRepayment loanPayment)
        {
            System.Windows.Forms.ListViewItem [] payments = new System.Windows.Forms.ListViewItem[loanPayment.loan.Period + 1];

            decimal mrate;
            decimal minterest;
            decimal mtotal;
            decimal mleft;
            decimal totalInterest = 0;
            int     i;


            for (i = 1; i <= loanPayment.loan.Period; i++)
            {
                mrate           = loanPayment.getPeriodRefund((uint)i);
                minterest       = loanPayment.getPeriodInterest((uint)i);
                mtotal          = loanPayment.getPeriodPayment((uint)i);
                mleft           = loanPayment.getLeftAmount((uint)i);
                totalInterest  += minterest;
                payments[i - 1] = new System.Windows.Forms.ListViewItem(i.ToString("D"));
                payments[i - 1].SubItems.Add(mleft.ToString("C"));
                payments[i - 1].SubItems.Add(mrate.ToString("C"));
                payments[i - 1].SubItems.Add(minterest.ToString("C"));
                payments[i - 1].SubItems.Add(mtotal.ToString("C"));
            }

            decimal total = loanPayment.loan.Amount + totalInterest;

            payments[i - 1] = new System.Windows.Forms.ListViewItem("TOTAL");
            payments[i - 1].SubItems.Add("-");
            payments[i - 1].SubItems.Add(loanPayment.loan.Amount.ToString("C"));
            payments[i - 1].SubItems.Add(totalInterest.ToString("C"));
            payments[i - 1].SubItems.Add(total.ToString("C"));

            return(payments);
        }