-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBankApp.cs
74 lines (56 loc) · 2.16 KB
/
BankApp.cs
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AdvanceCsharpPrograms
{
internal class BankApp
{
public class Customers
{
public int CustAccNo { get; set; }
public string CustName { get; set; }
public string LoanType { get; set; }
}
public class AccountType
{
public string AccoType { get; set; }
public List<Customers> customer = new List<Customers>();
}
static void Main(string[] args)
{
List<AccountType> accounttypeList = new List<AccountType>()
{
new AccountType
{
AccoType="Saving",
customer={
new Customers{CustAccNo=1012,CustName="User1",LoanType="Home Loan"},
new Customers{CustAccNo=2518,CustName="User2",LoanType="Goald Loan"},
new Customers{CustAccNo=8524,CustName="User10", LoanType = "Home Loan"}
}
},
new AccountType
{
AccoType="Current",
customer={
new Customers{CustAccNo=3155,CustName="User3",LoanType="Personal Loan"},
new Customers{CustAccNo=4455,CustName="User4",LoanType="Home Loan"},
new Customers{CustAccNo=5964,CustName="User5",LoanType = "Home Loan"},
}
},
};
foreach (AccountType at in accounttypeList)
{
Console.WriteLine(at.AccoType);
Console.WriteLine("-------------------------------------------");
foreach (Customers c in at.customer)
{
Console.WriteLine(" "+"Account No: "+ c.CustAccNo+" "+"Customer Name: " + c.CustName);
Console.WriteLine(" " + "Loan Type: " + c.LoanType);
}
}
}
}
}