コード例 #1
0
        private void bunifuImageButton6_Click(object sender, EventArgs e)
        {
            ParticipantLogin pl = new ParticipantLogin();

            pl.Show();
            this.Hide();
        }
コード例 #2
0
        private void ButtonFacilitatorCreateAccount_Click(object sender, EventArgs e)
        {
            if (TextboxName.Text == "" || TextboxMName.Text == "" || TextboxLName.Text == "" || TextboxUsername.Text == "" || TextboxPassword.Text == "" || TextboxReTypePassword.Text == "")
            {
                Dialogue.Show("Fill All Fields!", "", "Ok", "Cancel");
            }

            else
            {
                if (labelAvailableUsername.ForeColor == System.Drawing.Color.Green)
                {
                    if (TextboxPassword.Text == TextboxReTypePassword.Text)
                    {
                        con.Open();


                        SqlCommand cmd = new SqlCommand("Insert into participant(fullname,F_name, M_name, L_name, p_username, p_password) Values('" + TextboxName.Text + " " + TextboxMName.Text + " " + TextboxLName.Text + "','" + TextboxName.Text + "','" + TextboxMName.Text + "','" + TextboxLName.Text + "','" + TextboxUsername.Text + "','" + TextboxPassword.Text + "')", con);
                        cmd.ExecuteNonQuery();
                        Dialogue.Show("Successfully Inserted", "", "Ok", "Cancel");

                        con.Close();

                        this.Hide();

                        ParticipantLogin cf = new ParticipantLogin();
                        cf.Show();
                    }
                    else
                    {
                        Dialogue.Show("Your Password does not Match", "", "Ok", "Cancel");
                    }
                }
                else
                {
                    Dialogue.Show("Please use Available Username", "", "Ok", "Cancel");
                }
            }
        }
コード例 #3
0
        private void buttonEnterGame_Click(object sender, EventArgs e)
        {
            con.Open();
            SqlParameter param = new SqlParameter();

            param.ParameterName = "@PIN";
            param.Value         = bunifuMetroTextbox1.Text;
            SqlCommand sda = new SqlCommand("Select count(*) From SERVER Where PIN=@PIN COLLATE SQL_Latin1_General_CP1_CS_AS ", con);

            sda.Parameters.Add(param);
            Int32 count = (Int32)sda.ExecuteScalar();

            con.Close();
            if (count == 0)
            {
                Dialogue.Show("Access Denied", "", "Ok", "Cancel");
            }
            else
            {
                this.Hide();
                ParticipantLogin PL = new ParticipantLogin();
                PL.Show();
            }
        }