private void button5_Click(object sender, EventArgs e) { if (textBox1.Text == "*****@*****.**" && textBox2.Text == "jwZh2x@p") { MenuBegyna zakaz = new MenuBegyna(); zakaz.Show(); this.Hide(); } else if (textBox1.Text == "*****@*****.**" && textBox2.Text == "9ApEdKdo") { MenuKoordinacii zakaz = new MenuKoordinacii(); zakaz.Show(); this.Hide(); } else if (textBox1.Text == "*****@*****.**" && textBox2.Text == "OPuDrw9O") { MenuAdministracii zakaz = new MenuAdministracii(); zakaz.Show(); this.Hide(); } else { MessageBox.Show("Неправильный логин/пароль"); } }
private void Back_Click(object sender, EventArgs e) { MenuBegyna zakaz = new MenuBegyna(); zakaz.Show(); this.Hide(); }
private void Registration_Click(object sender, EventArgs e) { if (EmailText.Text == "" && PasswordText.Text == PasswordText2.Text && NameText.Text == "" && SurnameText.Text == "") { connection = new SqlConnection(connectionString); try { connection.Open(); cmd = new SqlCommand($"INSERT INTO [dbo].[User] (Email, Password, FirstName, LastName, RoleId) VALUES ('{EmailText.Text}','{PasswordText.Text}','{NameText.Text}','{SurnameText.Text}','{label1.Text}')", connection); cmd.ExecuteNonQuery(); MenuBegyna zakaz = new MenuBegyna(); zakaz.Show(); this.Hide(); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { connection.Close(); } } else { MessageBox.Show("Ошибка"); } }
private void Registration_Click(object sender, EventArgs e) { if (EmailText.Text == "" && PasswordText.Text == PasswordText2.Text && NameText.Text == "" && SurnameText.Text == "") { MenuBegyna zakaz = new MenuBegyna(); zakaz.Show(); this.Hide(); } else { MessageBox.Show("Ошибка"); } }