public void CriarTabela()
 {
     try
     {
         DalHelper.CriarTabelaSQlite();
         btnOk.Enabled = false;
     }
     catch (Exception ex)
     {
         MessageBox.Show("Erro : " + ex.Message);
     }
 }
 public void CriarBancoDados()
 {
     try
     {
         DalHelper.CriarBancoSQLite();
         btnOk.Enabled = false;
     }
     catch (Exception ex)
     {
         MessageBox.Show("Erro : " + ex.Message);
     }
 }
 public void IncluirDados()
 {
     try
     {
         Cliente cli = new Cliente();
         cli.Cnpj = txtCnpj.Text;
         cli.Ip   = txtIp.Text;
         MessageBox.Show("Seus dados foram inseridos com sucesso!");
         DalHelper.Add(cli);
     }
     catch (Exception ex)
     {
         MessageBox.Show("Erro : " + ex.Message);
     }
 }
        void ExibirDados()
        {
            try
            {
                DataTable dt = new DataTable();
                dt = DalHelper.GetCadastro();
                dgvDados.DataSource = dt;
            }
            catch (Exception ex)
            {
                MessageBox.Show("Erro : " + ex.Message);
            }
            if (!Valida())
            {
                MessageBox.Show("Informe os dados cliente a incluir");
                return;
            }
            try
            {
                Cliente cli = new Cliente();

                cli.Cnpj = txtCnpj.Text;
                cli.Ip   = txtIp.Text;

                DalHelper.Add(cli);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Erro : " + ex.Message);
            }

            bool Valida()
            {
                if (string.IsNullOrEmpty(txtCnpj.Text) && string.IsNullOrEmpty(txtIp.Text))
                {
                    return(false);
                }
                else
                {
                    return(true);
                }
            }
        }