private void backButton_Click(object sender, RoutedEventArgs e)
        {
            Window signinwindow = new SignInPage();

            signinwindow.Show();
            this.Close();
        }
Example #2
0
        private void backB_Click(object sender, RoutedEventArgs e)
        {
            var win = new SignInPage();

            win.Show();
            this.Close();
        }
        private void SignOut_Click(object sender, RoutedEventArgs e)
        {
            SignInPage signInPage = new SignInPage();

            signInPage.Show();
            this.Close();
        }
        private void Login_Click(object sender, RoutedEventArgs e)
        {
            SignInPage login = new SignInPage();

            login.Show();
            Close();
        }
Example #5
0
 private void txtbx_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key != 0)
     {
         var win = new SignInPage();
         win.Show();
         this.Close();
     }
 }
 private void Submit_Click(object sender, RoutedEventArgs e)
 {
     if (textBlockFirstname.Text.Length == 0)
     {
         errormessage.Text = "Enter a username.";
         textBlockFirstname.Focus();
     }
     else if (passwordBox1.Password.Length == 0)
     {
         errormessage.Text = "enter a password";
         passwordBox1.Focus();
     }
     else if (!(IsValidEmail(mailbox.Text)) || mailbox.Text == "")
     {
         MessageBox.Show("Enter a valid email address");
         mailbox.Clear();
         mailbox.Focus();
     }
     else
     {
         if (passwordBox1.Password != passwordBoxConfirm.Password)
         {
             errormessage.Text = " password do not match";
             passwordBoxConfirm.Focus();
         }
         else
         {
             if (checkInputGuest() || checkInputHost())
             {
                 MessageBox.Show("user name already exists, please try again");
                 Reset();
             }
             else
             {
                 SaveGuest();
                 MessageBox.Show("added to the system");
                 SignInPage login = new SignInPage();
                 login.Show();
                 Close();
             }
         }
     }
 }
Example #7
0
        public void saveHost()
        {
            BE.Host host = new BE.Host();
            host.PrivateName1         = privateName1TextBox.Text;
            host.FamilyName1          = familyName1TextBox.Text;
            host.MailAddress1         = mailAddress1TextBox.Text;
            host.PhoneNumber1         = phoneNumber1TextBox.Text;
            host.BankAccountNumber1   = int.Parse(bankAccountNumber1TextBox.Text);
            host.CollectionClearance1 = bool.Parse(collectionClearance1CheckBox.IsChecked.ToString());
            host.BankBranchDetails1   = banky;
            XElement username = new XElement("username", textBoxUserName.Text);
            XElement password = new XElement("password", passwordBox1.Password);

            bl.AddHost(host, textBoxUserName.Text, passwordBox1.Password);
            MessageBox.Show("added to the system, Host Key: " + host.HostKey1);
            SignInPage login = new SignInPage();

            login.Show();
            Close();
        }
Example #8
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if (usernametxtbx.Text == "")
            {
                MessageBox.Show("please enter your user name", "error", MessageBoxButton.OKCancel, MessageBoxImage.Question);
                usernametxtbx.Focus();
            }
            else
            {
                newPass = putrand();

                try
                {
                    BE.Host host     = bl.getHostByUser(usernametxtbx.Text);
                    Thread  passmail = new Thread(() => SendMail(host.MailAddress1));
                    passmail.Start();
                    updatePasswordHost();

                    var win = new SignInPage();
                    win.Show();
                    this.Close();
                }
                catch
                {
                    try
                    {
                        string mal      = GetGuestByuser();
                        Thread passmail = new Thread(() => SendMail(mal));
                        passmail.Start();
                        updatePasswordGuest();
                    }
                    catch
                    {
                        MessageBox.Show("this user is not in the system");
                        usernametxtbx.Clear();
                        usernametxtbx.Focus();
                    }
                }
            }
        }