Example #1
0
        public DataTable PreencherDataGridView()
        {
            DAL Conexao = new DAL(); //as conexões estao no constructor
            MySqlDataAdapter Myda = new MySqlDataAdapter();
            Myda.SelectCommand = new MySqlCommand(SelectAll(), Conexao.BdConn);

            DataTable table = new DataTable();
            Myda.Fill(table);
            return table;
        }
Example #2
0
        public bool CadastrarCliente(string Nome,String Login,String Senha)
        {
            DAL Conexao = new DAL(); //as conexões estao no constructor

            if (Conexao.VerificarConexao())
            {
                Cliente C1 = new Cliente();
                C1.Nome = Nome;
                C1.Login = Login;
                C1.Senha = Senha;

                CommInserir = new MySqlCommand(InserirDados(C1.Nome,C1.Login,C1.Senha), Conexao.BdConn);
                CommInserir.BeginExecuteNonQuery();

                return true;
            }
            else
            {
                return false;
            }
        }