added helsinki
This commit is contained in:
@@ -1,58 +1,58 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ConsoleApp1
|
||||
{
|
||||
class Transaction
|
||||
{
|
||||
public string leiras;
|
||||
public int osszeg;
|
||||
public DateTime datum;
|
||||
public bool ok = false;
|
||||
|
||||
public Transaction(Account kuldo, Account fogado, int ertek, string megjegyzes) {
|
||||
this.osszeg = ertek;
|
||||
kuldo.egyenleg -= osszeg;
|
||||
fogado.egyenleg += osszeg;
|
||||
datum = DateTime.Now;
|
||||
leiras = megjegyzes;
|
||||
ok = true;
|
||||
|
||||
if (ok)
|
||||
{
|
||||
kuldo.transactions.Add(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class Account{
|
||||
public string Name { get; set; }
|
||||
public Account(string nev) {
|
||||
Name = nev;
|
||||
}
|
||||
|
||||
public int egyenleg;
|
||||
public List<Transaction> transactions = new List<Transaction>();
|
||||
|
||||
}
|
||||
internal class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Account valaki = new Account("Kis Józsi");
|
||||
Account valaki2 = new Account("Nagy Józsi");
|
||||
|
||||
Transaction pez = new Transaction(valaki, valaki2, 100, "asd");
|
||||
Transaction pez1 = new Transaction(valaki, valaki2, 100, "asd2");
|
||||
Transaction pez2 = new Transaction(valaki, valaki2, 100, "asd4");
|
||||
|
||||
foreach (Transaction t in valaki.transactions)
|
||||
{
|
||||
Console.WriteLine(t.leiras);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ConsoleApp1
|
||||
{
|
||||
class Transaction
|
||||
{
|
||||
public string leiras;
|
||||
public int osszeg;
|
||||
public DateTime datum;
|
||||
public bool ok = false;
|
||||
|
||||
public Transaction(Account kuldo, Account fogado, int ertek, string megjegyzes) {
|
||||
this.osszeg = ertek;
|
||||
kuldo.egyenleg -= osszeg;
|
||||
fogado.egyenleg += osszeg;
|
||||
datum = DateTime.Now;
|
||||
leiras = megjegyzes;
|
||||
ok = true;
|
||||
|
||||
if (ok)
|
||||
{
|
||||
kuldo.transactions.Add(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class Account{
|
||||
public string Name { get; set; }
|
||||
public Account(string nev) {
|
||||
Name = nev;
|
||||
}
|
||||
|
||||
public int egyenleg;
|
||||
public List<Transaction> transactions = new List<Transaction>();
|
||||
|
||||
}
|
||||
internal class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Account valaki = new Account("Kis Józsi");
|
||||
Account valaki2 = new Account("Nagy Józsi");
|
||||
|
||||
Transaction pez = new Transaction(valaki, valaki2, 100, "asd");
|
||||
Transaction pez1 = new Transaction(valaki, valaki2, 100, "asd2");
|
||||
Transaction pez2 = new Transaction(valaki, valaki2, 100, "asd4");
|
||||
|
||||
foreach (Transaction t in valaki.transactions)
|
||||
{
|
||||
Console.WriteLine(t.leiras);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user