Exemplo n.º 1
0
        private Conexao GetInformacoesConexao(ConfigConnectionFirebird config)
        {
            Conexao conexao = new Conexao();

            conexao.NOME = config.NomeConexao;
            conexao.PROPRIEDADES.Add("Driver", "{Firebird/InterBase(r) driver}");
            conexao.PROPRIEDADES.Add("Dialect", config.Dialeto);
            conexao.PROPRIEDADES.Add("uid", config.Usuario);
            conexao.PROPRIEDADES.Add("dbname", config.CaminhoBase);
            conexao.PROPRIEDADES.Add("pwd", config.Senha);

            return(conexao);
        }
Exemplo n.º 2
0
        private void configConnectionFirebird_TestarConexao(ConfigConnectionFirebird sender)
        {
            //if (_ConfigConnectionsController.ValidarConexao(
            //    this.GetInformacoesConexao(sender)))
            //    MessageBox.Show("Conexão válida!");
            //else
            //    MessageBox.Show("Erro ao se tentar efetuar a conexão com a base de dados!");
            Conexao conexao = this.GetInformacoesConexao(sender);

            if (conexao != null)
            {
                _ConfigConnectionsController.ConexoesService.RemoveConexao(conexao);
                sender.Clear();                
            }
        }
Exemplo n.º 3
0
        private void configConnectionFirebird_TestarConexao(ConfigConnectionFirebird sender)
        {
            //if (_ConfigConnectionsController.ValidarConexao(
            //    this.GetInformacoesConexao(sender)))
            //    MessageBox.Show("Conexão válida!");
            //else
            //    MessageBox.Show("Erro ao se tentar efetuar a conexão com a base de dados!");
            Conexao conexao = this.GetInformacoesConexao(sender);

            if (conexao != null)
            {
                _ConfigConnectionsController.ConexoesService.RemoveConexao(conexao);
                sender.Clear();
            }
        }
Exemplo n.º 4
0
        private void configConnectionFirebird_SalvarConexao(ConfigConnectionFirebird sender)
        {
            Conexao conexao = this.GetInformacoesConexao(sender);

            conexao.bCOMPLETO = ckbCompleto.Checked;

            if (!_ConfigConnectionsController.ValidarConexao(conexao))
            {
                MessageBox.Show("Impossível salvar esta configuração, pois ocorreu um erro " +
                    "ao se tentar efetuar a conexão com a base de dados!");
                return;
            }

            _ConfigConnectionsController.SalvarConexao(conexao);
            MessageBox.Show("Conexão salva com sucesso!");
        }
Exemplo n.º 5
0
        private void configConnectionFirebird_SalvarConexao(ConfigConnectionFirebird sender)
        {
            Conexao conexao = this.GetInformacoesConexao(sender);

            conexao.bCOMPLETO = ckbCompleto.Checked;

            if (!_ConfigConnectionsController.ValidarConexao(conexao))
            {
                MessageBox.Show("Impossível salvar esta configuração, pois ocorreu um erro " +
                                "ao se tentar efetuar a conexão com a base de dados!");
                return;
            }

            _ConfigConnectionsController.SalvarConexao(conexao);
            MessageBox.Show("Conexão salva com sucesso!");
        }
Exemplo n.º 6
0
        private void CarregarConfiguracoes(ConfigConnectionFirebird config)
        {
            Conexao conexao = _ConfigConnectionsController.ObterConexao(
                config.NomeConexao);

            if (conexao != null)
            {
                //config.Dialeto = conexao.PROPRIEDADES["Dialect"];
                //config.Usuario = conexao.PROPRIEDADES["uid"];
                //config.Senha = conexao.PROPRIEDADES["pwd"];
                config.CaminhoBase = conexao.PROPRIEDADES["dbname"];

                if (conexao.bCOMPLETO)
                {
                    config.Visible      = true;
                    ckbCompleto.Checked = true;
                    configConnectionFirebirdSpedContabil.Visible = true;
                    configConnectionContmatic.Visible            = true;
                }
            }
        }
Exemplo n.º 7
0
        private void CarregarConfiguracoes(ConfigConnectionFirebird config)
        {
            Conexao conexao = _ConfigConnectionsController.ObterConexao(
                config.NomeConexao);
            if (conexao != null)
            {
                //config.Dialeto = conexao.PROPRIEDADES["Dialect"];
                //config.Usuario = conexao.PROPRIEDADES["uid"];
                //config.Senha = conexao.PROPRIEDADES["pwd"];
                config.CaminhoBase = conexao.PROPRIEDADES["dbname"];

                if (conexao.bCOMPLETO)
                {
                    config.Visible = true;
                    ckbCompleto.Checked = true;
                    configConnectionFirebirdSpedContabil.Visible = true;
                    configConnectionContmatic.Visible = true;
                }
            }
        }
Exemplo n.º 8
0
        private Conexao GetInformacoesConexao(ConfigConnectionFirebird config)
        {
            Conexao conexao = new Conexao();

            conexao.NOME = config.NomeConexao;
            conexao.PROPRIEDADES.Add("Driver", "{Firebird/InterBase(r) driver}");
            conexao.PROPRIEDADES.Add("Dialect", config.Dialeto);
            conexao.PROPRIEDADES.Add("uid", config.Usuario);
            conexao.PROPRIEDADES.Add("dbname", config.CaminhoBase);
            conexao.PROPRIEDADES.Add("pwd", config.Senha);

            return conexao;
        }