コード例 #1
0
        private void button_Register_Click(object sender, EventArgs e)
        {
            label_WrongUserName.Visible = textBox_Username.Text == "" || textBox_Username.Text == "User Name";

            label_WrongEmail.Visible = !CheckEmail(textBox_Email.Text);


            label_WrongPassword.Visible = (textBox_Password.Text == "" ||
                                           textBox_Password.Text == "Password") ||
                                          (textBox_Password2.Text == "" ||
                                           textBox_Password2.Text == "Confirm Password");

            if (!label_WrongUserName.Visible && !label_WrongEmail.Visible && !label_WrongPassword.Visible)
            {
                DataSet_AccountsTableAdapters.AccountsTableAdapter queriesTableAdapter = new DataSet_AccountsTableAdapters.AccountsTableAdapter();

                queriesTableAdapter.Insert(textBox_Username.Text, textBox_Email.Text, textBox_Password.Text, 0, 0);

                int Id = (int)QueriesTableAdapter.GetIdUser_ByEmail(textBox_Email.Text);

                QueriesTableAdapter.Insert_User(Id);

                Form_DoneRegister form = new Form_DoneRegister(formLogin);

                form.Show();

                Close();
                formLogin.Hide();
            }
        }
コード例 #2
0
ファイル: Form_Lobby.cs プロジェクト: LeonardRumeghea/Archero
        private void button1_Click(object sender, EventArgs e)
        {
            Form_DoneRegister form = new Form_DoneRegister(this);

            this.Hide();
            form.Show();
        }