private void confirmButtonPress(object sender, MouseButtonEventArgs e) { if (input.Length == 4) { Customer customer = null; string[] customerDetails = new string[3]; try { using (StreamReader sr = new StreamReader("../../Assests/Token.txt")) { for (int i = 0; i < customerDetails.Length; i++) { customerDetails[i] = sr.ReadLine(); } customer = new Customer(customerDetails[1], customerDetails[2], Convert.ToInt32(customerDetails[0])); while (!sr.EndOfStream) { string data = sr.ReadLine(); string[] statement = data.Split(','); customer.addStatement(statement); } sr.Close(); } } catch (Exception ex) { Console.WriteLine("Error"); Console.WriteLine(ex.Message); } if (customer.getPIN() == input) { Console.WriteLine("Authenticated"); SelectCurrencyWindow window = new SelectCurrencyWindow(this, customer); window.Show(); } else { Console.WriteLine("Invalid Pin"); InvalidPINPopup popup = new InvalidPINPopup(); popup.Show(); authenticatorOutput.Text = ""; input = ""; confirmButton.Background = new SolidColorBrush(Color.FromArgb(0xFF, 0xB6, 0xB6, 0xB6)); confirmButton.Foreground = new SolidColorBrush(Color.FromArgb(0xFF, 0xC9, 0xC9, 0xC9)); confirmButton.BorderBrush = new SolidColorBrush(Color.FromArgb(0xFF, 0x64, 0x64, 0x64)); } } }
private void changeCurrencyButtonPush(object sender, MouseButtonEventArgs e) { SelectCurrencyWindow currency = new SelectCurrencyWindow(this, customer); currency.Show(); }