Beispiel #1
0
        Dictionary<string, string> p; //par [Campo, valor] do banco de dados

        #endregion Fields

        #region Constructors

        public MapeamentoBdCsv(string tabela, string arquivoCsv, Bd banco)
        {
            bd = banco;
            TabelaBdNome = tabela;
            csvArquivo = new Csv(arquivoCsv);
            csvArquivo.ColumnsRead();
        }
Beispiel #2
0
        public Roteiro()
        {
            lstPedidoFormaPagamento = new List<string>();
            lstPedidoCodigo = new List<string>();
            lstPedidoJaCadastradoAnteriomente  = new List<Guid>();
            D.Roteiro = this;
            // create reader & open file
            TextReader tr = null;
            try
            {
                tr = new StreamReader(D.ApplicationDirectory + "neosync.ini");
                D.BancoAlvo = tr.ReadLine().Trim();
                // close the stream
            }
            catch (Exception ex)
            {
                janela.MsgAppend("Não consegui localizar o arquivo neosync.ini " + ex.Message);
            }
            finally
            {
                tr.Close();
            }

            Bd bd = new Bd();
            D.Bd = bd;

            bd.ConStr = D.ConexaoParamentros();

            try
            {
                bd.Connect();
            }
            catch(Exception ex) {
                NeoDebug.Debug.ErrorRecord("Não foi possível conectar ao banco de dados " + ex.Message + " " + ex.StackTrace);
                FE.Show("Não foi possível conectar ao banco de dados ", "Erro", ex.Message + " " + ex.StackTrace);
                System.Environment.Exit(1);
            }
            ParametroCriar();
            Parametro.Carregar();
        }
Beispiel #3
0
        private void FrmRelPedido_Load(object sender, EventArgs e)
        {
            bd = new Bd();

            bd.ConStr = D.ConexaoParamentros();

            try
            {
                bd.Connect();
            }
            catch (Exception ex)
            {
                FE.Show(ex);
            }

            DataTable dtVendedores;
            //            dtVendedores = bd.DataTablePreenche(@"
            //
            //                    select '-1' as codigo, 'Todos' as nome from funcionario
            //                        UNION
            //                    Select
            //                            codigo, nome
            //                    from
            //                            funcionario
            //                    where
            //                            participa_forca_venda='1' and ativo ='1'", "funcionario");

            dtVendedores = bd.DataTablePreenche(@"
                                Select
                                        -1 as codigo, 'Todos' as nome
                                from
                                        funcionario
                                UNION
                                Select
                                        codigo, nome
                                from
                                        funcionario", "funcionario");

            cbxVendedor.DataSource = dtVendedores;
            cbxVendedor.DisplayMember = "nome";
            cbxVendedor.ValueMember = "codigo";

            DataTable dtLoja = bd.DataTablePreenche(@"

                SELECT
                        codigo, nome_fantasia
                FROM
                        loja", "loja");

            cbxLoja.DataSource = dtLoja;
            cbxLoja.DisplayMember = "nome_fantasia";
            cbxLoja.ValueMember = "codigo";
        }