MIT-Curricular/DBMS/C-Sharp/Lab/Week2/Banker/Banker/Customer.cs
2025-02-10 13:18:49 +05:30

33 lines
959 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Banker
{
public class Customer
{
public string Username { get; set; }
public string Password { get; set; }
public decimal Balance { get; set; }
public DateTime LastAccess { get; set; }
public List<string> LastTransactions { get; set; }
public Customer(string username, string password, decimal balance)
{
Username = username;
Password = password;
Balance = balance;
LastAccess = DateTime.Now;
LastTransactions = new List<string>();
}
public void AddTransaction(string transaction)
{
LastTransactions.Insert(0, transaction);
if (LastTransactions.Count > 5)
LastTransactions.RemoveAt(5);
}
}
}