Esempio n. 1
0
        private void signUp_Click(object sender, RoutedEventArgs e)
        {
            MediaPlayer m = new MediaPlayer();

            m.Open(new Uri("../../digi_plink.wav", UriKind.RelativeOrAbsolute));
            m.Play();

            if (userName.Text == string.Empty || password.Password == string.Empty || Email.Text == string.Empty || userName.Text == "user name" || password.Password == "password" || Email.Text == "email")
            {
                MessageBox.Show($"Please enter user name and password...");
            }
            else
            {
                Responses.Signup signupResponse = this.communicator.submitRequest <Requests.Signup, Responses.Signup>(new Requests.Signup(userName.Text, password.Password, Email.Text), (int)Defs.Codes.SIGN_UP_REQUEST);

                if (signupResponse.status == 0)
                {
                    MessageBox.Show($"Signup faild...");
                }
                else
                {
                    MessageBox.Show($"send: {userName.Text} {password.Password} {Email.Text}");
                    mainManu main = new mainManu(this.communicator);
                    main.Show();
                    this.Close();
                }
            }
        }
Esempio n. 2
0
        private void login_Click(object sender, RoutedEventArgs e)
        {
            MediaPlayer m = new MediaPlayer();

            m.Open(new Uri("../../digi_plink.wav", UriKind.RelativeOrAbsolute));
            m.Play();

            if (userName.Text == string.Empty || password.Password == string.Empty || userName.Text == "user name" || password.Password == "password")
            {
                MessageBox.Show($"Please enter user name and password...");
            }
            else
            {
                Responses.Login loginResponse = this.communicator.submitRequest <Requests.Login, Responses.Login>(new Requests.Login(userName.Text, password.Password), (int)Defs.Codes.LOGIN_REQUEST);

                if (loginResponse.status == 0)
                {
                    MessageBox.Show($"Login faild...");
                }
                else
                {
                    mainManu main = new mainManu(this.communicator);
                    main.Show();
                    this.Close();
                }
            }
        }