private void button1_Click(object sender, EventArgs e)
        {
            MySqlOperations.OpenConnection();
            string output = string.Empty;

            MySqlOperations.Select_Text(MySqlQueries.Select_Avtorizaciya, ref output, null, textBox1.Text, textBox2.Text);
            if (output == "1")
            {
                MySqlOperations.Select_Text(MySqlQueries.Select_User_Form, ref output, null, textBox1.Text, textBox2.Text);
                if (output == "")
                {
                    this.DialogResult = DialogResult.No;
                    this.Close();
                }
                else
                {
                    ID = output;
                    this.DialogResult = DialogResult.Yes;
                    this.Close();
                }
            }
            else
            {
                MessageBox.Show("Неверный логин или пароль.", "Авторизация", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            MySqlOperations.CloseConnection();
        }
Esempio n. 2
0
 private void Zakazchik_Load(object sender, EventArgs e)
 {
     MySqlOperations.OpenConnection();
 }