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

            sIGNin.Show();
        }
Ejemplo n.º 2
0
        private void btnSignIN_Click(object sender, EventArgs e)
        {
            this.Hide();
            Home.Instance.Hide();
            SIGNin sIGNin = new SIGNin();

            sIGNin.Show();
        }
Ejemplo 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;
                    }
                    panelInfo.Visible       = true;
                    labelMessenge.ForeColor = Color.Red;
                    labelMessenge.Text      = "Есть пустые поля";
                }
            }
            catch
            {
                panelInfo.Visible       = true;
                labelMessenge.ForeColor = Color.Red;
                labelMessenge.Text      = "Пользователь с таким UserName уже зарегестрирован";
                myConnection.Close();
            }
        }