Exemplo n.º 1
0
        public MainForm()
        {
            InitializeComponent();
            User        simon      = new User("Simon");
            DebitAcount simonDebit = new DebitAcount(CUR_EUR, 100.0m, "Sparkasse");

            simon.Wallets.Add(simonDebit);
            simon.Wallets.Add(new OnlineAcount(CUR_EUR, 0.0m, "Simons PayPal", simonDebit));
            User leon = new User("Leon");

            leon.Wallets.Add(new DebitAcount(CUR_EUR, 150.0m, "Ing Diba"));
            users.Add(simon);
            users.Add(leon);
            foreach (User user in users)
            {
                listBox1.Items.Add(user);
            }
        }
Exemplo n.º 2
0
        static void Main()
        {
            Application.Run(new MainForm());

            //Application.EnableVisualStyles();
            //Application.SetCompatibleTextRenderingDefault(false);
            //Application.Run(new AcountView());

            Currency euro   = new Currency("euro", 1);
            Currency dollar = new Currency("dollar", 1.08m);

            DebitAcount  leons       = new DebitAcount(euro, 10.50m, "leons");
            OnlineAcount leonsPaypal = new OnlineAcount(euro, 10, "leons", leons);
            CashWallet   simon       = new CashWallet(dollar, 0);

            System.Diagnostics.Debug.WriteLine("Leons " + leons.Balance.Amount + leons.Balance.Currency.Name);
            System.Diagnostics.Debug.WriteLine("LeonsPaypal " + leonsPaypal.Balance.Amount + leonsPaypal.Balance.Currency.Name);
            System.Diagnostics.Debug.WriteLine("simon " + simon.Balance.Amount + simon.Balance.Currency.Name);
            System.Diagnostics.Debug.WriteLine("Leons " + "History count: " + leons.History.GetElementCount());
            System.Diagnostics.Debug.WriteLine("LeonsPaypal " + "History count: " + leonsPaypal.History.GetElementCount());

            leonsPaypal.TransferTo(15, simon);

            System.Diagnostics.Debug.WriteLine("Leons " + leons.Balance.Amount + leons.Balance.Currency.Name);
            System.Diagnostics.Debug.WriteLine("LeonsPaypal " + leonsPaypal.Balance.Amount + leonsPaypal.Balance.Currency.Name);
            System.Diagnostics.Debug.WriteLine("simon " + simon.Balance.Amount + simon.Balance.Currency.Name);
            System.Diagnostics.Debug.WriteLine("Leons " + "History count: " + leons.History.GetElementCount());
            System.Diagnostics.Debug.WriteLine("LeonsPaypal " + "History count: " + leonsPaypal.History.GetElementCount());

            simon.TransferTo(5, leons);

            System.Diagnostics.Debug.WriteLine("Leons " + leons.Balance.Amount + leons.Balance.Currency.Name);
            System.Diagnostics.Debug.WriteLine("LeonsPaypal " + leonsPaypal.Balance.Amount + leonsPaypal.Balance.Currency.Name);
            System.Diagnostics.Debug.WriteLine("simon " + simon.Balance.Amount + simon.Balance.Currency.Name);
            System.Diagnostics.Debug.WriteLine("Leons " + "History count: " + leons.History.GetElementCount());
            System.Diagnostics.Debug.WriteLine("LeonsPaypal " + "History count: " + leonsPaypal.History.GetElementCount());
        }