Esempio n. 1
0
        private void LabelSignIN_Click(object sender, EventArgs e)
        {
            this.Hide();
            SIGNin sIGNin = new SIGNin();

            sIGNin.Show();
        }
Esempio n. 2
0
        private void gunaButton8_Click(object sender, EventArgs e)
        {
            this.Hide();
            SIGNin sIGNin = new SIGNin();

            sIGNin.Show();
        }
Esempio n. 3
0
        private void btnSignUP_Click(object sender, EventArgs e)
        {
            try
            {
                if (TextBoxName.Text != "Name" && TextBoxSurname.Text != "Surname" && TextBoxUsername.Text != "Username" && TextBoxPassword.Text != "Password")
                {
                    OleDbCommand command = new OleDbCommand("INSERT INTO Users (uName, uSurname, uUsername, uPassword) VALUES ('" + TextBoxName.Text + "', '" + TextBoxSurname.Text + "', '" + TextBoxUsername.Text + "', '" + TextBoxPassword.Text + "')", myConnection);

                    myConnection.Open();
                    command.ExecuteNonQuery();
                    myConnection.Close();

                    this.Hide();
                    SIGNin sIGNin = new SIGNin();
                    sIGNin.Show();
                }
                else
                {
                    if (TextBoxName.Text == "Name")
                    {
                        TextBoxName.BorderColor = Color.Red;
                    }
                    if (TextBoxSurname.Text == "Surname")
                    {
                        TextBoxSurname.BorderColor = Color.Red;
                    }
                    if (TextBoxPassword.Text == "Password")
                    {
                        TextBoxPassword.BorderColor = Color.Red;
                    }
                    if (TextBoxUsername.Text == "Username")
                    {
                        TextBoxUsername.BorderColor = Color.Red;
                    }
                    MessageBox.Show("Есть пустые поля");
                }
            }
            catch
            {
                MessageBox.Show("Пользователь с таким UserName уже зарегестрирован");
                myConnection.Close();
            }
        }