private void button_Confirmar_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Tem certeza que deseja alterar esta agência?", "Confirmação", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
     {
         if (MySQLFunction.AlterarAgencia(textBox_NumeroAgencia.Text, textBox_identificadorAgencia.Text))
         {
             MessageBox.Show("A agência foi alterada com sucesso!");
             MySQLFunction.ListarAgencias(dataGridView_AlterarAgencia, auxIdEndereco);
         }
     }
 }
        private void button_CarregarAgencia_Click(object sender, EventArgs e)
        {
            MySQLFunction.CarregarAgenciaStr(textBox_identificadorAgencia.Text, textBox_NumeroAgencia, "numero");
            string idEndereco = MySQLFunction.CarregarAgenciaEndereco(textBox_identificadorAgencia.Text, "id_endereco");

            auxIdEndereco = idEndereco;
            MySQLFunction.ListarAgencias(dataGridView_AlterarAgencia, idEndereco);
            //MySQLFunctions.CarregarEnderecoStr(idEndereco, textBox_Cep, "cep");
            //MySQLFunctions.CarregarEnderecoStr(idEndereco, textBox_Rua, "rua");
            //MySQLFunctions.CarregarEnderecoStr(idEndereco, textBox_Bairro, "bairro");
            //MySQLFunctions.CarregarEnderecoStr(idEndereco, textBox_Cidade, "cidade");
            //MySQLFunctions.CarregarEnderecoStr(idEndereco, textBox_Complemento, "complemento");
        }
Beispiel #3
0
        public bool success()
        {
            MySQL_Ancestor sql = new MySQLFunction(Connection.connectionString);

            List <MySqlParameter> paramList = new List <MySqlParameter>();

            paramList.Add(new MySqlParameter("username", this.username));
            paramList.Add(new MySqlParameter("password", this.password));


            DataTable result = sql.runQuery("SELECT login(@username, @password) AS res", paramList);

            int i = Convert.ToInt32(result.Rows[0]["res"]);

            if (i == 1)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }