virtual public void Transfer(Account transaction, int amount) { if (amount < Balance) { Balance -= amount; Console.WriteLine("Balance now is {0}}:", Balance); transections[totalNumberOfTransections++] = new Transections(this, transaction, amount, "Transfer"); } else { Console.WriteLine("Not Enough Balance"); } }
virtual public void Withdraw(int amount) { if (amount < Balance) { Balance -= amount; Console.WriteLine("Balance now is {0}}:", Balance); transections[totalNumberOfTransections++] = new Transections(this, this, amount, "self Widhdraw"); } else { Console.WriteLine("Not Enough Balance"); } }
virtual public void Transfer(Account a, int amount) { if (amount < Balance) { Balance -= amount; Console.WriteLine("Balance now is {0}}:", Balance); transections[totalNumberOfTransections++] = new Transections(this, a, amount, "Transfer"); } else { Console.WriteLine("No sufficient ammount"); } }
static void Main(string[] args) { Account s1 = new Account("Adnan", "11111", 2123131); Account s2 = new Account("nasif", "22222", 10000); Account r1 = new Account("Aisheryo", "33333", 5000); Account r2 = new Account("surjo", "4444", 20000); Transections t1 = new Transections(s1, r1, 219, "send money"); Transections t2 = new Transections(s1, r2, 200, "send money"); s1.addTransaction(t1, t2); s1.showAllTransection(); s1.ShowInfo(); s1.Transfer(r2, 200); }
static void Main(string[] args) { Account s1 = new Account("Shahariar", "13123", 21236); Account s2 = new Account("alir", "14243", 100006); Account r1 = new Account("Tabassym", "11123", 5000); Account r2 = new Account("Shahariar", "4443", 200); Transections t1 = new Transections(s1, r1, 100, "send money"); Transections t2 = new Transections(s2, r2, 550, "send money"); Transections t3 = new Transections(s1, r2, 550, "Cash out"); s1.ShowInfo(); s1.addTransaction(t1, t2, t3); s1.showAllTransection(); }
public void Deposit(int amount) { Balance += amount; transections[totalNumberOfTransections++] = new Transections(this, this, amount, "self deposit"); }