예제 #1
0
        private void slideDAddButton_Click(object sender, EventArgs e)
        {
            if (slideDaddUserTextBox.Text != "")
            {
                if (getDataFromUser(slideDaddUserTextBox.Text) != "false")
                {
                    if (canSendFriendRequest(slideDaddUserTextBox.Text))
                    {
                        if (sendFriendRequest(slideDaddUserTextBox.Text) == "easy")
                        {
                            //Mensagem a dizer pedido enviado com sucesso
                        }
                        else
                        {
                            ConnectionIssues issues = new ConnectionIssues();
                            issues.ShowDialog();
                        }
                    }
                    else
                    {
                        slideDAddingError.Visible = true;
                    }
                }

                else
                {
                    slideDAddingError.Visible = true;
                    slideDAddingError.Text    = "Username doesn't exist";
                }
            }
        }
예제 #2
0
 //Sign up process
 private void bunifuThinButton23_Click(object sender, EventArgs e)
 {
     if (AllValid())
     {
         if (getDataSignUp(Username.Text) == "false")
         {
             label2.Visible = false;
             if (getDataSignUp2(FirstName.Text, LastName.Text, Username.Text, Password.Text) == "easy")
             {
                 SuccessfulRegister register = new SuccessfulRegister();
                 register.ShowDialog();
                 SignUp.Enabled = true;
             }
             else
             {
                 ConnectionIssues issues = new ConnectionIssues();
                 issues.ShowDialog();
                 SignUp.Enabled = true;
             }
         }
         else
         {
             label2.Visible = true;
             SignUp.Enabled = true;
         }
     }
 }
예제 #3
0
        private async void bunifuThinButton23_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                FirstName.Text       = FirstName.Text.Trim();
                LastName.Text        = LastName.Text.Trim();
                Username.Text        = Username.Text.Trim();
                Password.Text        = Password.Text.Trim();
                ConfirmPassword.Text = ConfirmPassword.Text.Trim();

                if (AllValid())
                {
                    if (getDataFromUser(Username.Text) == "false")
                    {
                        label2.Visible = false;
                        if (registerUser(FirstName.Text, LastName.Text, Username.Text.Trim(), Password.Text) == "easy")
                        {
                            e.Handled          = true;
                            e.SuppressKeyPress = true;

                            slideA.Visible = false;

                            slideC.Visible = false;
                            slideC.Left    = 53;
                            slideC.Visible = true;
                            slideC.Refresh();

                            await Loading();

                            this.Hide();
                            ChatScreen chat = new ChatScreen(getDataFromUser(Username.Text));
                            chat.ShowDialog();
                        }
                        else
                        {
                            ConnectionIssues issues = new ConnectionIssues();
                            issues.ShowDialog();

                            SignUp.Enabled = true;
                        }
                    }
                    else
                    {
                        label2.Visible = true;
                        SignUp.Enabled = true;
                    }
                }
            }
        }
예제 #4
0
        //Sign up process
        private async void bunifuThinButton23_Click(object sender, EventArgs e)
        {
            FirstName.Text       = FirstName.Text.Trim();
            LastName.Text        = LastName.Text.Trim();
            Username.Text        = Username.Text.Trim();
            Password.Text        = Password.Text.Trim();
            ConfirmPassword.Text = ConfirmPassword.Text.Trim();

            if (AllValid())
            {
                if (getDataFromUser(Username.Text) == "false")
                {
                    label2.Visible = false;
                    if (registerUser(FirstName.Text, LastName.Text, Username.Text.Trim(), Password.Text) == "easy")
                    {
                        label1.Visible = false;

                        slideA.Visible = false;

                        slideC.Visible = false;
                        slideC.Left    = 53;
                        slideC.Visible = true;
                        slideC.Refresh();

                        await Loading();

                        this.Hide();
                        ChatScreen chat = new ChatScreen(getDataFromUser(Username.Text));
                        chat.ShowDialog();
                    }
                    else
                    {
                        ConnectionIssues issues = new ConnectionIssues();
                        issues.ShowDialog();

                        SignUp.Enabled = true;
                    }
                }
                else
                {
                    label2.Visible = true;
                    label2.Text    = "Username already taken";

                    SignUp.Enabled = true;
                }
            }
        }
예제 #5
0
        private void AddButton_Click_1(object sender, EventArgs e)
        {
            if (addUserTextBox.Text != "")
            {
                if (getDataFromUser(addUserTextBox.Text) != "false")
                {
                    if (canSendFriendRequest(addUserTextBox.Text))
                    {
                        if (sendFriendRequest(addUserTextBox.Text) == "easy")
                        {
                            AddingError.Visible = false;

                            addUserTextBox.Text = "";
                            slideC.Visible      = false;
                            slideC.Left         = 525;

                            slideA.Visible = false;
                            slideA.Left    = 0;
                            slideA.Visible = true;
                            slideA.Refresh();
                        }
                        else
                        {
                            ConnectionIssues issues = new ConnectionIssues();
                            issues.ShowDialog();
                        }
                    }
                    else
                    {
                        AddingError.Visible = true;
                    }
                }

                else
                {
                    AddingError.Visible = true;
                    AddingError.Text    = "Username doesn't exist";
                }
            }
        }