コード例 #1
0
ファイル: Login.xaml.cs プロジェクト: ndtam1112/BuyNow
        private void btnLogin_Click(object sender, RoutedEventArgs e)
        {
            LoginUser lu = new LoginUser(tbPhone.Text.Trim(), pbBox.Password.Trim());

            if (Accountdatabase.CheckAccount(lu.Phone_number, lu.Password))
            {
                MainWindow m = new MainWindow(lu.Phone_number);
                Window.GetWindow(this).Hide();
                m.Show();
            }
        }
コード例 #2
0
ファイル: Account.xaml.cs プロジェクト: ndtam1112/BuyNow
 private void btnChangePass_Click(object sender, RoutedEventArgs e)
 {
     if (Accountdatabase.CheckAccount(phoneNumberto.Text.Trim(), passwordold.Text.Trim()))
     {
         if (passssword1.Password.Equals("") || password2.Password.Equals(""))
         {
             MessageBox.Show("ERROR: account or password is blank");
         }
         else
         {
             if (passssword1.Password == password2.Password)
             {
                 Accountdatabase.UpdateToPassWord(phoneNumberto.Text.Trim(), passssword1.Password.Trim());
                 MessageBox.Show("Update Success!");
             }
             else
             {
                 MessageBox.Show("That password doesn't match, please re-enter it!");
             }
         }
     }
 }
コード例 #3
0
 private void btnSignUp_Click(object sender, RoutedEventArgs e)
 {
     if (ktra())
     {
         if (passWordSignUp.Password == passWordSignUp2.Password)
         {
             if (Accountdatabase.insert(phoneSignUp.Text.Trim(), passWordSignUp.Password.Trim()))
             {
                 if (Clientdatabase.InsertToClient(phoneSignUp.Text.Trim(), "", ""))
                 {
                     MessageBox.Show("Sign Up Success!");
                 }
             }
             else
             {
                 MessageBox.Show("Registration failed");
             }
         }
         else
         {
             MessageBox.Show("That password doesn't match, please re-enter it!");
         }
     }
 }