示例#1
0
        static void Main(string[] args)
        {
            Console.ReadLine();
            Account        c    = new Current();
            Account        c1   = new Savings_Corporate();
            AccountManager a    = new AccountManager();
            Account        acc  = a.CreateAccount(c);
            Account        acc1 = a.CreateAccount(c1);

            a.DisplayAccount(acc);
            a.DisplayAccount(acc1);
            Console.ReadLine();
        }
示例#2
0
 public void DisplayAccount(Account acc)
 {
     Console.WriteLine("{0},{1},{2},{3},{4},{5}", acc.accno, acc.debit, acc.pin, acc.type, acc.login, acc.password);
     if (acc is Current)
     {
         Current temp = (Current)acc;
         Console.WriteLine("{0},{1},{2},{3}", temp.compname, temp.typebus, temp.contctname, temp.web);
         Console.WriteLine();
     }
     else
     {
         Savings_Corporate temp = (Savings_Corporate)acc;
         Console.WriteLine("{0}", temp.companyname);
     }
 }