static void CreateCustomerAndAccount() { Customer newCustomer = new Customer(); Console.Write("\nSyötä pankin id, johon uusi asiakas tulee:"); newCustomer.BankId = long.Parse(Console.ReadLine()); Console.Write("Uuden asiakkaan etunimi: "); newCustomer.Firstname = Console.ReadLine(); Console.Write("Uuden asiakkaan sukunimi: "); newCustomer.Lastname = Console.ReadLine(); customerRepositories.CreateCustomer(newCustomer); Account newAccount = new Account(); newAccount.BankId = newCustomer.BankId; newAccount.CustomerId = newCustomer.Id; Console.Write("Syötä uuden tilin IBAN: "); newAccount.IBAN = Console.ReadLine(); Console.Write("Syötä uuden tilin nimi: "); newAccount.Name = Console.ReadLine(); accountRepositories.CreateAccount(newAccount); }
public static Account CreateAccount(Account account) => AccountRepositories.CreateAccount(account);