static void Main(string[] args) { AdminClient admin = new AdminClient(); Client client = new Client(1429, "Vova", "O", "+380667577145", "-1"); Console.WriteLine( admin.RegisterClient(client) ); Console.WriteLine( admin.AddAccount(client, new Account("12345678", "2228", AccountType.CreditAccount)) ); //Client cl = admin.GetClient(1429, "-1"); //Console.WriteLine( // admin.AddAccount(cl, new Account("12345677", "2222", AccountType.BonusAccount)) //); ATMClient atm = new ATMClient(); Account ac = atm.LoginAccount("12345677", "2222"); Console.WriteLine( atm.AddTransaction(ac, "2222", "12345678", 200, DateTime.Now) //atm.WithdrawMoney(ac, "2222", 100) ); Console.Read(); }
static void Main() { string baseUrl = Properties.Settings.Default.baseUrl; string id = Properties.Settings.Default.id; string pw = Properties.Settings.Default.pw; var mre = new ManualResetEvent(false); new Task(async() => { ATMClient atmClient = new ATMClient(baseUrl); var atm = await atmClient.Login(id, pw); if (atm != null) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); var f1 = new Form1(atm); Application.Run(f1); f1.FormClosed += new FormClosedEventHandler((sender, e) => { mre.Set(); }); } }).Start(); mre.WaitOne(); }