static void Main(string[] args) { BankAccount acc1 = new BankAccount(1, "ivan", "shumilin", 100, 0, BankAccount.AccountGradation.Gold, BankAccount.AccountStatus.Active); BankAccount acc2 = new BankAccount(2, "alex", "petrov", 200, 200, BankAccount.AccountGradation.Platinum, BankAccount.AccountStatus.Active); BankAccount acc3 = new BankAccount(3, "petr", "ivanov", 10, 1000, BankAccount.AccountGradation.Base, BankAccount.AccountStatus.Active); AccountService bls = new AccountService(); FileWorker fw = new FileWorker("C:/Users/Shumilin/Documents/Visual Studio 2017/Projects/NET.W.2018.Shumilin.8/file2.txt"); bls.Load(fw); //bls.AddAccount(acc1); //bls.AddAccount(acc2); //bls.AddAccount(acc3); bls.AddMoney(1, 200); bls.WithdrawMoney(1, 111); bls.Save(fw); //Console.WriteLine(acc1.ToString()); Console.ReadKey(); }
static void Main(string[] args) { AccountService bank = new AccountService(); AccountHolder client = new AccountHolder("ksenia", "tabova", "+375 29 666 66 66"); AccountHolder client2 = new AccountHolder("Dana", "sidorova", "80 11 666 66 66"); AccountHolder client3 = new AccountHolder("Anton", "reu666t", "80 29 666 66 66"); bank.CreateAccount(client, AccountType.Gold, 5000); try { bank.CreateAccount(client2, AccountType.Base, 30); } catch (InvalidPhoneNumberException e) { Console.WriteLine(e.message); } try { bank.CreateAccount(client3, AccountType.Premium, 30000); } catch (InvalidNameException e) { Console.WriteLine(e.message); } bank.CloseAccount(1); try { bank.CloseAccount(15); } catch (AccountNotExistsException e) { Console.WriteLine(e.message); } bank.AddMoney(2, 600); bank.WithdrawMoney(3, 7999999); try { bank.WithdrawMoney(1, -6666); } catch (NegativeSumException e) { Console.WriteLine(e.message); } bank.GetAllAccounts(); }