Exemplo n.º 1
0
        private void registerButton_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(IDtextBox.Text))
            {
                MessageBox.Show("please enter Id");
                return;
            }
            if (string.IsNullOrEmpty(NametextBox.Text))
            {
                MessageBox.Show("please enter name");
                return;
            }
            if (string.IsNullOrEmpty(UserNametextBox.Text))
            {
                MessageBox.Show("please enter User name");
                return;
            }
            if (string.IsNullOrEmpty(EmailtextBox.Text))
            {
                MessageBox.Show("please enter email");
                return;
            }
            if (string.IsNullOrEmpty(MoneytextBox.Text))
            {
                MessageBox.Show("please enter money");
                return;
            }
            if (string.IsNullOrEmpty(NewPasswordfirstTextBox.Password))
            {
                MessageBox.Show("please enter password");
                return;
            }
            if (string.IsNullOrEmpty(NewPasswordSecTextBox.Password))
            {
                MessageBox.Show("please enter password again");
                return;
            }
            if (!NewPasswordfirstTextBox.Password.Equals(NewPasswordSecTextBox.Password))
            {
                MessageBox.Show("password dont match");
                return;
            }
            bool registerOk = cl.Register(Id, name, username, NewPasswordSecTextBox.Password, money, email);

            if (registerOk)
            {
                MainAfterLogin mainAfterLogin = new MainAfterLogin(this, Id, cl);
                mainAfterLogin.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Invalid input");
            }
        }
Exemplo n.º 2
0
 public void LoginOk(bool isOk)
 {
     if (isOk)
     {
         Dispatcher.Invoke(() =>
         {
             MainAfterLogin mainAfterLogin = new MainAfterLogin(this, cl.user.id, cl);
             mainAfterLogin.Show();
             Hide();
         });
     }
     else
     {
         Dispatcher.Invoke(() =>
         {
             MessageBox.Show("login fail! - please try again");
         });
     }
 }