Exemplo n.º 1
0
        private void SubmitButton_Click(object sender, RoutedEventArgs e)
        {
            var query = from user in dataSet.User
                        where (user.Username == txtName.Text)
                        where (user.Password == txtPassword.Text)
                        select user;

            // check if there is a match, query will have entry
            if (query.Count() >= 0)
            {
                // create instance of the MainWindow (new)

                MainAccountWindow mainAccountWindow = new MainAccountWindow();
                // show window
                mainAccountWindow.Show();
                // Close() this window
                this.Close();
            }
            else
            {
                // show message box that states the user does not exist


                MessageBoxResult result = MessageBox.Show("User does not exist", "Submit", MessageBoxButton.OK, MessageBoxImage.Error);
                // on the message box show an error icon and “Submit” caption
                // look at resources section below for message box information
                txtName.Clear();
                txtPassword.Clear();
                // clear text boxes
            }
        }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            number = int.Parse(amountDeposit.Text);

            MainAccountWindow mainAccountWindow = new MainAccountWindow();

            if (btnSavingsAccount.IsEnabled)
            {
                mainAccountWindow.txtSavingsBalanceAmount.Text += number.ToString();
            }
            else
            {
                mainAccountWindow.txtCheckingBalanceAmount.Text += number.ToString();
            }
        }
Exemplo n.º 3
0
 private void Cancel_Click(object sender, RoutedEventArgs e)
 {
     MainAccountWindow.shutdownWithdrawal();
 }