コード例 #1
0
ファイル: Main.cs プロジェクト: rolandpop/Mandatory
        public void addAcc(int index)
        {
            if (index != -1)
            {
                Customer c = Customers[index];
                Account a = new Account(0, 0, "account nr: " + c.Accounts.Count.ToString());

                c.Accounts.Add(a);

                lbAccounts.Items.Clear();

                for (int i = 0; i < c.Accounts.Count; i++)
                {
                    lbAccounts.Items.Add(c.Accounts[i].Name + " " + c.Accounts[i].Money + "$ " + c.Accounts[i].IRate + "%");
                }

            }
            else
            {
                MessageBox.Show("Must select a customer first");

            }
        }
コード例 #2
0
ファイル: Customer.cs プロジェクト: rolandpop/Mandatory
 public void DelAccount(Customer c, Account a)
 {
     c.Accounts.Remove(a);
 }
コード例 #3
0
ファイル: Customer.cs プロジェクト: rolandpop/Mandatory
 public void AddAccount(Customer c,Account a)
 {
     c.Accounts.Add(a);
 }