-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDeposit.cs
More file actions
33 lines (29 loc) · 1.07 KB
/
Deposit.cs
File metadata and controls
33 lines (29 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System;
namespace BankCurse
{
public class Deposit
{
public int DepositId { set; get; }
public Account Account { set; get; }
public double InterestRate { set; get; }
public double InitialAmount { set; get; }
public string OpenDate { set; get; } = DateTime.Today.ToString("yyyy-MM-dd");
public string CloseDate { set; get; }
public bool IsChanged { set; get; }
public double FinalAmount => InitialAmount + InitialAmount * Convert.ToDateTime(CloseDate).Subtract((Convert.ToDateTime(OpenDate))).Days * (InterestRate / 36000);
public Deposit(int depositId, Account account, double interestRate, double initialAmount, string openDate, string closeDate)
{
DepositId = depositId;
Account = account;
InterestRate = interestRate;
InitialAmount = initialAmount;
OpenDate = openDate;
CloseDate = closeDate;
IsChanged = true;
}
public Deposit()
{
IsChanged = false;
}
}
}