static void Main(string[] args) { string name = "Bank"; string author = "Ja"; Console.WriteLine("Program: " + name); Console.WriteLine("Autor: " + author); Console.WriteLine(); Account savingsAccount = new SavingsAccount(1, "Janusz", "Klepka", 95071711111); Account savingsAccount2 = new SavingsAccount(2, "Andrzej", "Warchol", 87040322222); Account billingAccount2 = new BillingAccount(3, savingsAccount2.FirstName, savingsAccount2.LastName, savingsAccount2.Pesel); IPrinter printer = new Printer(); IPrinter smallprinter = new SmallPrinter(); printer.Print(savingsAccount); printer.Print(savingsAccount2); printer.Print(billingAccount2); smallprinter.Print(savingsAccount); Console.ReadKey(); }
public BillingAccount CreateBillingAccount(string firstName, string lastName, long pesel) { int id = generateId(); BillingAccount account = new BillingAccount(id, firstName, lastName, pesel); _accounts.Add(account); return(account); }
public BillingAccount CreateBillingAccount(string firstName, string lastName, long pesel)//tworzenie konta oszczednosciowego// { int id = generateId(); BillingAccount account = new BillingAccount(id, firstName, lastName, pesel); _accounts.Add(account); return(account); }
public void Print(BillingAccount account) { Console.WriteLine("Dane konta: {0}", account.AccountNumber); Console.WriteLine("Typ: {0}", account.TypeName()); Console.WriteLine("Saldo: {0} zł", account.Balance); Console.WriteLine("Imię właściciela: {0}", account.FirstName); Console.WriteLine("Nazwisko właściciela: {0}", account.LastName); Console.WriteLine("PESEL właściciela: {0}", account.Pesel); Console.WriteLine(); }
static void Main(string[] args) { SavingsAccount savingsAccount = new SavingsAccount(1, 0.0M, "Marek", "Zając", 92010133333); SavingsAccount secondSavingsAccount = new SavingsAccount(2, 0.0M, "Marek", "Zając", 92010133333); ClientData billingAccount = new BillingAccount(3, 0.0M, "Marek", "Zając", 92010133333); Printer printer = new Printer(); printer.Print(savingsAccount); printer.Print(secondSavingsAccount); printer.Print(billingAccount); Console.ReadKey(); //savingsAccount. }
static void Main(string[] args) { string name = "Bank accounts support."; string author = "Author: Dominik S."; Console.WriteLine(name); Console.WriteLine(author); Console.WriteLine(); Account savacc = new SavingAccount(7, "Dominik", "Sm.", 01234567890); Account savacc2 = new SavingAccount(13, "Ewelina", "O.", 09876543210); Account bilacc = new BillingAccount(20, savacc.FirstName, savacc.LastName, savacc.Pesel); string fullName = savacc.GetFullName2(); string fullName2 = savacc2.GetFullName2(); string fullName3 = bilacc.GetFullName2(); string balance = savacc.GetBalance(); string balance2 = savacc2.GetBalance(); string balance3 = bilacc.GetBalance(); Console.WriteLine("Właścicel pierwszego konta oszczędnościowego: {0}", fullName); Console.WriteLine(balance); Console.WriteLine("Właściciel drugiego konta oszczędnościowego: {0}", fullName2); Console.WriteLine(balance2); Console.WriteLine("Właściciel pierwszego konta rozliczeniowego: {0}", fullName3); Console.WriteLine(balance3); Console.WriteLine(); Printer printer = new Printer(); printer.Print(savacc); printer.Print(savacc2); printer.Print(bilacc); Console.ReadKey(); }