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();
        }
示例#2
0
 private void Zakazchik_FormClosed(object sender, FormClosedEventArgs e)
 {
     MySqlOperations.CloseConnection();
 }