Beispiel #1
0
        private void bb_Cotacao_Click(object sender, EventArgs e)
        {
            string vColunas = "a.ID_Cotacao|Cód. Cotação|100;" +
                              "a.NM_Vendedor|Vendedor|350;" +
                              "a.cd_clifor|Cód. Clifor|100;" +
                              "b.nm_clifor|Nome Clifor|350;" +
                              "a.NM_Contato|Contato|350";

            string vParam = "e.st_requisicao |=|'NG'";

            UtilPesquisa.BTN_BUSCA(vColunas, new Componentes.EditDefault[] { CD_Cotacao, CD_Clifor, NM_Clifor, NM_Contato },
                                   new TCD_LanCotacao(), vParam);
            if (!CD_Cotacao.Text.Equals(""))
            {
                buscarRegistros();
            }
        }
Beispiel #2
0
        private void bb_produto_Click(object sender, EventArgs e)
        {
            string vColunas = "a.ds_produto|Produto|200;" +
                              "a.cd_produto|Cd. Produto|80;" +
                              "b.sigla_unidade|Sigla Unidade|80";
            string vParam = string.Empty;

            if (id_formulacao.Text.Trim() != string.Empty)
            {
                vParam = "|exists|(select 1 from tb_prd_fichatec_acabado x " +
                         "where x.cd_produto = a.cd_produto " +
                         "and x.cd_empresa = '" + cd_empresa.Text.Trim() + "' " +
                         "and x.id_formulacao = " + id_formulacao.Text + ")";
            }
            UtilPesquisa.BTN_BUSCA(vColunas, new Componentes.EditDefault[] { cd_produto, ds_produto },
                                   new CamadaDados.Estoque.Cadastros.TCD_CadProduto(), vParam);
        }
Beispiel #3
0
        private void Nr_Pedido_Leave(object sender, EventArgs e)
        {
            UtilPesquisa.EDIT_LEAVE("a.nr_pedido|=|'" + Nr_Pedido.Text + "'",
                                    new Componentes.EditDefault[] { Nr_Pedido, Nm_Empresa, NM_Clifor, Nr_cpf_cnpj, CD_Clifor },
                                    new TCD_Pedido());

            if (Nr_Pedido.Text != "")
            {
                buscarRegistros();
            }
            else
            {
                BS_Registro_Pedido.Clear();
                BS_Lancamento_Item.Clear();
                BS_Registro_Pedido.ResetBindings(true);
            }
            //vTP_Modo = TTpModo.tm_Insert;
        }
Beispiel #4
0
        private void BB_TabelaDesconto_Click(object sender, EventArgs e)
        {
            string vColunas = "DS_TabelaDesconto|Tabela de Desconto|350;" +
                              "CD_TabelaDesconto|Código|100";

            UtilPesquisa.BTN_BUSCA(vColunas, new Componentes.EditDefault[] { CD_TabelaDesconto, DS_TabelaDesconto },
                                   new CamadaDados.Graos.TCD_TabelaDesconto(), null);

            if ((tpModo == TTpModo.tm_Insert) && (CD_TabelaDesconto.Text.Trim() != string.Empty))
            {
                (bs_PesagemGraos.Current as TRegistro_LanPesagemGraos).Classificacao =
                    TCN_LanClassificacao.buscarDadosClassif(CD_TabelaDesconto.Text,
                                                            Utils.Parametros.pubLogin);

                BT_Classificacao.Enabled = true;
                bs_Classificacao_PositionChanged(this, new EventArgs());
            }
        }
Beispiel #5
0
        private void BB_TP_Pesagem_Click(object sender, EventArgs e)
        {
            string vColunas = "a.NM_TPPesagem|Tipo Pesagem|350;" +
                              "a.TP_Pesagem|TP. Pesagem|100";
            string vParamFixo = "a.TP_Modo|=|'G';" +
                                "|EXISTS|(select 1 from tb_div_usuario_x_tppesagem x " +
                                "           where x.tp_pesagem = a.tp_pesagem " +
                                "           and ((x.login = '******') or " +
                                "           (EXISTS(select 1 from tb_div_usuario_x_grupos y " +
                                "                   where y.logingrp = x.login and y.loginusr = '******'))))";
            DataRowView linha = UtilPesquisa.BTN_BUSCA(vColunas, new Componentes.EditDefault[] { TP_Pesagem, NM_TPPesagem },
                                                       new CamadaDados.Balanca.Cadastros.TCD_CadTpPesagem(), vParamFixo);

            if (linha != null)
            {
                ID_Ticket.Enabled = linha["ST_SeqManual"].ToString().Trim().Equals("S");
            }
        }
Beispiel #6
0
        private void BB_ContaGer_Click(object sender, EventArgs e)
        {
            string vColunas = "a.DS_ContaGer|Conta|350;" +
                              "a.CD_ContaGer|Cód. Conta|100";
            string vParamFixo = "|exists|(select 1 from tb_div_usuario_x_contager x " +
                                "where x.cd_contager = a.cd_contager " +
                                "and x.login = '******');" +
                                "|exists|(select 1 from TB_Fin_ContaGer_X_Empresa k " +
                                "where k.CD_ContaGer = a.CD_ContaGer " +
                                "and k.cd_Empresa = '" + cbEmpresa.SelectedValue.ToString().Trim() + "' );" +
                                "a.st_contaCF|=|1;" +
                                "ISNULL(a.ST_ContaCompensacao,'N')|=|'N';" +
                                "a.st_contacartao|<>|0";

            UtilPesquisa.BTN_BUSCA(vColunas,
                                   new Componentes.EditDefault[] { CD_ContaGer, DS_ContaGer },
                                   new TCD_CadContaGer(), vParamFixo);
        }
Beispiel #7
0
        private void CD_Empresa_Leave(object sender, EventArgs e)
        {
            string vColunas = "a.CD_Empresa|=|'" + CD_Empresa.Text.Trim() + "';" +
                              "|EXISTS|(select 1 from tb_div_usuario_x_empresa x " +
                              "where x.cd_empresa = a.cd_empresa " +
                              "and ((x.login = '******') or " +
                              "(exists(select 1 from tb_div_usuario_x_grupos y " +
                              "         where y.logingrp = x.login and y.loginusr = '******'))))";

            if (!string.IsNullOrEmpty(cd_domiciliobancario.Text))
            {
                vColunas += ";|exists|(select 1 from tb_fin_contager_x_empresa x " +
                            "where x.cd_empresa = a.cd_empresa " +
                            "and x.cd_contager = '" + cd_domiciliobancario.Text.Trim() + "')";
            }
            UtilPesquisa.EDIT_LEAVE(vColunas, new Componentes.EditDefault[] { CD_Empresa },
                                    new CamadaDados.Diversos.TCD_CadEmpresa());
        }
Beispiel #8
0
        private void BB_PlacaCarreta_Click(object sender, EventArgs e)
        {
            string vColunas = "a.placacarreta|Nº Placa|80;" +
                              "a.tp_movimento|Tipo Movimento|80;" +
                              "a.cd_empresa|Cd. Empresa|80;" +
                              "a.Ds_Carga|Descrição Carga|200;" +
                              "a.NM_Clifor|Cliente/Fornecedor|200";
            string vParam = "isnull(a.st_registro, 'A')|=|'A';" +
                            "|EXISTS|(select 1 from Tb_div_usuario_X_empresa  x where x.cd_empresa = A.cd_empresa " +
                            "and ((x.login = '******') or " +
                            "(exists(select 1 from tb_div_usuario_x_grupos y " +
                            "         where y.logingrp = x.login and y.loginusr = '******'))))";

            UtilPesquisa.BTN_BUSCA(vColunas, new Componentes.EditDefault[] { placaCarreta },
                                   new CamadaDados.Balanca.TCD_PesagemAvulsa(), vParam);

            placaCarreta_Leave(this, new EventArgs());
        }
Beispiel #9
0
 private void bb_local_Click(object sender, EventArgs e)
 {
     if (cbEmpresa.SelectedValue != null)
     {
         string vColunas = "DS_Local|Local Armazenagem|200;" +
                           "CD_Local|Cd. Local|80";
         string vParam = "|exists|(select 1 from TB_EST_Empresa_X_LocalArm x " +
                         "           where x.cd_local = a.cd_local " +
                         "           and x.cd_empresa = '" + cbEmpresa.SelectedValue.ToString() + "');" +
                         "isnull(a.st_registro, 'A')|<>|'C'";
         UtilPesquisa.BTN_BUSCA(vColunas, new Componentes.EditDefault[] { cd_local, ds_local },
                                new CamadaDados.Estoque.Cadastros.TCD_CadLocalArm(), vParam);
     }
     else
     {
         MessageBox.Show("Obrigatório selecionar empresa.", "Mensagem", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Beispiel #10
0
        private void BB_Empresa_Click(object sender, EventArgs e)
        {
            DataRowView linha = UtilPesquisa.BTN_BUSCA("a.NM_empresa|Nome Empresa|300;a.CD_Empresa|Cód Empresa|100;cd_uf|UF Empresa|80"
                                                       , new Componentes.EditDefault[] { CD_Empresa, NM_Empresa, uf_empresa }
                                                       , new CamadaDados.Diversos.TCD_CadEmpresa(),
                                                       "|EXISTS|(select 1 from Tb_div_usuario_X_empresa  x where x.cd_empresa = A.cd_empresa " +
                                                       "and ((x.login = '******') or " +
                                                       "(exists(select 1 from tb_div_usuario_x_grupos y " +
                                                       "         where y.logingrp = x.login and y.loginusr = '******'))))");

            if (linha != null)
            {
                regimefiscal.Text = linha["tp_regimetributario"].ToString().Trim().ToUpper().Equals("LR") ?
                                    "LUCRO REAL" : linha["tp_regimetributario"].ToString().Trim().ToUpper().Equals("LP") ?
                                    "LUCRO PRESUMIDO" : linha["tp_regimetributario"].ToString().Trim().ToUpper().Equals("SP") ?
                                    "SIMPLES" : string.Empty;
            }
        }
Beispiel #11
0
 private void BB_Clifor_Headge_Click(object sender, EventArgs e)
 {
     UtilPesquisa.BTN_BUSCA("a.nm_clifor|Nome Clifor|300;a.cd_clifor|Código Clifor|90;" +
                            "tp_pessoa|Tipo Pessoa|80;" +
                            "nr_cgc|C.N.P.J|80;" +
                            "nr_cpf|C.P.F|80;" +
                            "nr_rg|R.G|80;" +
                            "nm_razaosocial|Razão Social|100;" +
                            "nm_fantasia|Fantasia|100;" +
                            "EMAILPF|E-Mail P.F|100;" +
                            "EMAILPJ|E-Mail P.J|100;" +
                            "a.cd_transportador|Cd. Tranportadora|80;" +
                            "transp.nm_clifor|Transportadora|200;" +
                            "a.cd_endereco_transp|Cd. Transportadora|80;" +
                            "endTransp.ds_endereco|Endereco Transportadora|200",
                            new Componentes.EditDefault[] { CD_Clifor_Headge, NM_Clifor_Headge },
                            new CamadaDados.Financeiro.Cadastros.TCD_CadClifor(), null);
 }
Beispiel #12
0
        private void CD_Historico_Leave(object sender, EventArgs e)
        {
            string vColunas = "a." + CD_Historico.NM_CampoBusca + "|=|'" + CD_Historico.Text + "'";

            if (tp_movimento.SelectedValue != null)
            {
                if (tp_movimento.SelectedValue.ToString().Trim().ToUpper().Equals("E"))
                {
                    vColunas += ";a.TP_Mov|=|'P'";
                }
                else if (tp_movimento.SelectedValue.ToString().Trim().ToUpper().Equals("S"))
                {
                    vColunas += ";a.TP_Mov|=|'R'";
                }
            }
            UtilPesquisa.EDIT_LEAVE(vColunas, new Componentes.EditDefault[] { CD_Historico, ds_historico },
                                    new TCD_CadHistorico());
        }
Beispiel #13
0
        private void Id_Headge_Leave(object sender, EventArgs e)
        {
            DataRow linha = UtilPesquisa.EDIT_LEAVE("a.ID_Headge|=|" + Id_Headge.Text,
                                                    new Componentes.EditDefault[] { Id_Headge, DS_Headge },
                                                    new CamadaDados.Graos.TCD_CadHeadge());

            if (linha != null)
            {
                Tp_Valor.SelectedIndex = 0;
                Tp_Valor_SelectedIndexChanged(this, e);
            }
            else
            {
                Tp_Valor.SelectedIndex = -1;
                Vl_Headge.Value        = 0;
                Pc_Headge.Value        = 0;
            }
        }
Beispiel #14
0
        private void BB_Local_Click(object sender, EventArgs e)
        {
            TList_CadLocalArm_X_Produto List_Local_x_Produto = new TList_CadLocalArm_X_Produto();

            if (!string.IsNullOrEmpty(CD_Produto.Text))
            {
                List_Local_x_Produto = TCN_CadLocalArm_X_Produto.Busca("", CD_Produto.Text);
            }

            UtilPesquisa.BTN_BUSCA("a.DS_Local|Local|300;a.CD_Local|Código|80",
                                   new Componentes.EditDefault[] { CD_Local, DS_Local },
                                   new TCD_CadLocalArm(List_Local_x_Produto.Count > 0 ? CD_Produto.Text : string.Empty, CD_Empresa), "isnull(a.st_registro, 'A')|<>|'C'");

            if ((!string.IsNullOrEmpty(CD_Empresa)) && (!string.IsNullOrEmpty(CD_Produto.Text)) && (!string.IsNullOrEmpty(CD_Local.Text)))
            {
                saldo_local.Value = CamadaNegocio.Estoque.TCN_LanEstoque.Busca_Saldo_Local(CD_Empresa, CD_Produto.Text, CD_Local.Text, null);
            }
        }
Beispiel #15
0
        private void cd_contager_Leave(object sender, EventArgs e)
        {
            string vParam = "a.cd_contager|=|'" + cd_contager.Text.Trim() + "';" +
                            "|EXISTS|(select 1 from Tb_div_usuario_X_contager  x where x.cd_contager = A.cd_contager " +
                            "and ((x.login = '******') or " +
                            "(exists(select 1 from tb_div_usuario_x_grupos y " +
                            "         where y.logingrp = x.login and y.loginusr = '******'))));" +
                            "isnull(a.cd_banco, '')|<>|'';" +
                            "isnull(a.st_contacompensacao, 'N')|<>|'S'";

            if (!string.IsNullOrEmpty(cd_empresa.Text))
            {
                vParam += ";|exists|(select 1 from tb_fin_contager_x_empresa x " +
                          "         where x.cd_contager = a.cd_contager " +
                          "         and x.cd_empresa = '" + cd_empresa.Text.Trim() + "')";
            }
            UtilPesquisa.EDIT_LEAVE(vParam, new Componentes.EditDefault[] { cd_contager }, new CamadaDados.Financeiro.Cadastros.TCD_CadContaGer());
        }
Beispiel #16
0
        private void cd_Empresa_Leave(object sender, EventArgs e)
        {
            string vColunas = "a.CD_Empresa|=|'" + cd_Empresa.Text.Trim() + "';" +
                              "|exists|(select 1 from tb_div_usuario_x_empresa x " +
                              "where x.cd_empresa = a.cd_empresa " +
                              "and ((x.login = '******') or " +
                              "(exists(select 1 from tb_div_usuario_x_grupos y " +
                              "         where y.logingrp = x.login and y.loginusr = '******'))))";

            if (cd_ContaGer.Text != "")
            {
                vColunas += ";|exists|(select 1 from TB_Fin_ContaGer_X_Empresa k where k.CD_ContaGer = '" + cd_ContaGer.Text + "' and k.cd_Empresa = a.cd_empresa )";
            }

            UtilPesquisa.EDIT_LEAVE(vColunas,
                                    new Componentes.EditDefault[] { cd_Empresa, nm_empresa },
                                    new CamadaDados.Diversos.TCD_CadEmpresa());
        }
Beispiel #17
0
        private void CD_Empresa_Leave(object sender, EventArgs e)
        {
            DataRow linha = UtilPesquisa.EDIT_LEAVE("a.cd_empresa|=|'" + CD_Empresa.Text.Trim() + "';" +
                                                    "|EXISTS|(select 1 from Tb_div_usuario_X_empresa  x where x.cd_empresa = A.cd_empresa " +
                                                    "and((x.login = '******') or " +
                                                    "(exists(select 1 from tb_div_usuario_x_grupos y " +
                                                    "        where y.logingrp = x.login " +
                                                    "        and y.loginusr = '******'))))"
                                                    , new Componentes.EditDefault[] { CD_Empresa, NM_Empresa, uf_empresa }, new CamadaDados.Diversos.TCD_CadEmpresa());

            if (linha != null)
            {
                regimefiscal.Text = linha["tp_regimetributario"].ToString().Trim().ToUpper().Equals("LR") ?
                                    "LUCRO REAL" : linha["tp_regimetributario"].ToString().Trim().ToUpper().Equals("LP") ?
                                    "LUCRO PRESUMIDO" : linha["tp_regimetributario"].ToString().Trim().ToUpper().Equals("SP") ?
                                    "SIMPLES" : string.Empty;
            }
        }
Beispiel #18
0
 private void bb_cfop_Click(object sender, EventArgs e)
 {
     if (tp_movimento.SelectedIndex >= 0)
     {
         string vParam = string.Empty;
         if (tp_movimento.SelectedValue.ToString().Trim().ToUpper().Equals("E"))
         {
             vParam = "substring(a.cd_cfop, 1, 1)|in|('1', '2', '3')";
         }
         else
         {
             vParam = "substring(a.cd_cfop, 1, 1)|in|('5', '6', '7')";
         }
         string vColunas = "a.ds_cfop|CFOP|250;a.cd_cfop|Código|50";
         UtilPesquisa.BTN_BUSCA(vColunas, new Componentes.EditDefault[] { cd_cfop, ds_cfop },
                                new CamadaDados.Fiscal.TCD_CadCFOP(), vParam);
     }
 }
Beispiel #19
0
        private void cd_empresadest_Leave(object sender, EventArgs e)
        {
            string vColunas = "a.CD_Empresa|=|'" + cd_empresadest.Text + "';" +
                              "|exists|(select 1 from tb_div_usuario_x_empresa x" +
                              " where x.cd_empresa = a.cd_empresa and ((x.login = '******') or " +
                              "(exists(select 1 from tb_div_usuario_x_grupos y " +
                              "       where y.logingrp = x.login and y.loginusr = '******'))))";

            if (!string.IsNullOrEmpty(CD_Local_Dest.Text))
            {
                vColunas += ";|exists|(select 1 from TB_EST_Empresa_X_LocalArm x " +
                            "            where x.cd_empresa = a.cd_empresa " +
                            "            and x.cd_local = '" + CD_Local_Dest.Text.Trim() + "')";
            }
            UtilPesquisa.EDIT_LEAVE(vColunas, new Componentes.EditDefault[] { cd_empresadest, nm_empresadest },
                                    new CamadaDados.Diversos.TCD_CadEmpresa());
            this.Busca_Saldo_Local_Destino();
        }
Beispiel #20
0
        private void BB_NotaFiscal_Click(object sender, EventArgs e)
        {
            string vParam = "c.Tp_Movimento|=|'E';c.st_registro|<>|'C'";

            if (cd_clifor.Text.Trim() != "")
            {
                vParam += ";c.cd_clifor|=|'" + cd_clifor.Text.Trim() + "'";
            }
            string vColunas = "c.Nr_NotaFiscal|Nr. Nota Fiscal|80;" +
                              "c.Nr_LanctoFiscal|Nr. Lancto Fiscal|80;" +
                              "a.ID_NFItem|ID. Nf. Item|80;" +
                              "c.CD_Empresa|Cód. Empresa|80;" +
                              "c.CD_Clifor|Cód. Clifor|80;" +
                              "d.NM_Clifor|Nome Clifor|250;" +
                              "c.DT_Emissao|Data Emissão|80;" +
                              "c.DT_SaiEnt|Data Entrada/Saída|80;" +
                              "c.Especie|Espécie|150;" +
                              "a.Quantidade|Quantidade|100;" +
                              "a.Vl_Unitario|Valor Unitario|100;" +
                              "a.Vl_Subtotal|Valor Subtotal|100;" +
                              "QTD_Disponivel|Qtd. Disponivel|100;" +
                              "VL_Disponivel|Vl. Disponivel|100;" +
                              "c.Marca|Marca|200;" +
                              "C.Tp_Movimento|Tipo Movimento|80";

            UtilPesquisa.BTN_BUSCA(vColunas, new Componentes.EditDefault[] { Nr_NotaFiscal, Nr_LanctoFiscal, ID_NFItem },
                                   new TCD_Lan_SaldoNotasOriginacao(), vParam);

            if (Nr_NotaFiscal.Text.Trim() != "")
            {
                Nr_NotaFiscal_Leave(this, e);
            }
            else
            {
                Nr_LanctoFiscal.Text = "";
                Nr_NotaFiscal.Text   = "";
                ID_NFItem.Text       = "";
                VL_SubtotalNF.Value  = 0;
                Quantidade.Value     = 0;
                Quantidade.Maximum   = 0;
                VL_Subtotal.Value    = 0;
                VL_Subtotal.Maximum  = 0;
            }
        }
Beispiel #21
0
 private void ncm_Leave(object sender, EventArgs e)
 {
     if (!string.IsNullOrWhiteSpace(ncm.Text))
     {
         Componentes.EditDefault cadNcm = new Componentes.EditDefault();
         cadNcm.Text = ncm.Text;
         string  vColunas = "a.ncm|=|'" + ncm.Text.Trim() + "'";
         DataRow linha    = UtilPesquisa.EDIT_LEAVE(vColunas, new Componentes.EditDefault[] { ncm, ds_ncm },
                                                    new CamadaDados.Fiscal.TCD_CadNCM());
         if (linha == null)
         {
             if (cadNcm.Text.SoNumero().Trim().Length != 8)
             {
                 MessageBox.Show("NCM incorreto!", "Mensagem", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 return;
             }
             InputBox ibp = new InputBox();
             ibp.Text = "NCM";
             string ds = ibp.ShowDialog();
             if (string.IsNullOrEmpty(ds))
             {
                 MessageBox.Show("Obrigatorio informar descrição NCM.", "Mensagem", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 return;
             }
             try
             {
                 CamadaNegocio.Fiscal.TCN_CadNCM.GravarNCM(
                     new CamadaDados.Fiscal.TRegistro_CadNCM()
                 {
                     NCM    = cadNcm.Text,
                     Ds_NCM = ds
                 });
                 MessageBox.Show("NCM gravado com sucesso.", "Mensagem", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 ncm.Text    = cadNcm.Text;
                 ds_ncm.Text = ds;
             }
             catch (Exception ex)
             {
                 MessageBox.Show(ex.Message.Trim(), "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 return;
             }
         }
     }
 }
Beispiel #22
0
        private void CD_Local_Leave(object sender, EventArgs e)
        {
            TList_CadLocalArm_X_Produto List_Local_x_Produto = new TList_CadLocalArm_X_Produto();

            if (!string.IsNullOrEmpty(CD_Produto.Text))
            {
                List_Local_x_Produto = TCN_CadLocalArm_X_Produto.Busca(string.Empty, CD_Produto.Text);
            }
            string vParam = "a.cd_local|=|'" + CD_Local.Text.Trim() + "';isnull(a.st_registro, 'A')|<>|'C'";

            UtilPesquisa.EDIT_LEAVE(vParam,
                                    new Componentes.EditDefault[] { CD_Local, DS_Local },
                                    new TCD_CadLocalArm(List_Local_x_Produto.Count > 0 ? CD_Produto.Text : string.Empty, CD_Empresa));

            if ((!string.IsNullOrEmpty(CD_Empresa)) && (!string.IsNullOrEmpty(CD_Produto.Text)) && (!string.IsNullOrEmpty(CD_Local.Text)))
            {
                saldo_local.Value = CamadaNegocio.Estoque.TCN_LanEstoque.Busca_Saldo_Local(CD_Empresa, CD_Produto.Text, CD_Local.Text, null);
            }
        }
Beispiel #23
0
        private void id_formulacao_Leave(object sender, EventArgs e)
        {
            string vParam = "a.id_formulacao|=|" + id_formulacao.Text.Trim() + ";" +
                            "a.cd_empresa|=|'" + cd_empresa.Text.Trim() + "';" +
                            "|exists|(select 1 from tb_prd_fichatec_mprima x " +
                            "           where x.id_formulacao = a.id_formulacao " +
                            "           and x.cd_empresa = a.cd_empresa " +
                            "           and x.cd_produto = '" + cd_amostra.Text.Trim() + "')";

            if (cd_produto.Text.Trim() != string.Empty)
            {
                vParam += ";|exists|(select 1 from tb_prd_fichatec_acabado x " +
                          "           where x.cd_empresa = a.cd_empresa " +
                          "           and x.id_formulacao = a.id_formulacao " +
                          "           and x.cd_produto = '" + cd_produto.Text.Trim() + "')";
            }
            UtilPesquisa.EDIT_LEAVE(vParam, new Componentes.EditDefault[] { id_formulacao, ds_formula },
                                    new CamadaDados.Producao.Producao.TCD_FormulaApontamento());
        }
Beispiel #24
0
        private void Nr_Serie_Leave(object sender, EventArgs e)
        {
            string vColunas = "nr_serie|=|'" + Nr_Serie.Text.Trim() + "'";

            if (st_servico.Checked)
            {
                vColunas += ";tp_serie|in|('S', 'M')";
            }
            else
            {
                vColunas += ";tp_serie|<>|'S'";
            }
            if (!string.IsNullOrEmpty(cd_modelo.Text))
            {
                vColunas += ";a.cd_modelo|=|'" + cd_modelo.Text.Trim() + "'";
            }
            UtilPesquisa.EDIT_LEAVE(vColunas, new Componentes.EditDefault[] { Nr_Serie, DS_Serie, cd_modelo, ds_modelo },
                                    new TCD_CadSerieNF());
        }
Beispiel #25
0
        private void bb_contager_Click(object sender, EventArgs e)
        {
            string vColunas = "a.DS_Contager|Conta Gerencial|300;a.CD_ContaGer|Cd. Conta|100";
            string vParam   = "|EXISTS|(select 1 from Tb_div_usuario_X_contager  x where x.cd_contager = A.cd_contager " +
                              "and ((x.login = '******') or " +
                              "(exists(select 1 from tb_div_usuario_x_grupos y " +
                              "         where y.logingrp = x.login and y.loginusr = '******'))));" +
                              "isnull(a.cd_banco, '')|<>|'';" +
                              "isnull(a.st_contacompensacao, 'N')|<>|'S'";

            if (!string.IsNullOrEmpty(cd_empresa.Text))
            {
                vParam += ";|exists|(select 1 from tb_fin_contager_x_empresa x " +
                          "         where x.cd_contager = a.cd_contager " +
                          "         and x.cd_empresa = '" + cd_empresa.Text.Trim() + "')";
            }
            UtilPesquisa.BTN_BUSCA(vColunas, new Componentes.EditDefault[] { cd_contager, ds_contager }
                                   , new CamadaDados.Financeiro.Cadastros.TCD_CadContaGer(), vParam);
        }
Beispiel #26
0
        private void cd_autoriz_Leave(object sender, EventArgs e)
        {
            string vParam = "a.id_autoriz|=|" + cd_autoriz.Text + ";" +
                            "a.nr_contrato|=|" + nr_contrato_origem.Text + ";" +
                            "(a.qtd_retirar - a.qtd_retirada)|>|0";
            DataRow linha = UtilPesquisa.EDIT_LEAVE(vParam, new Componentes.EditDefault[] { cd_autoriz },
                                                    new CamadaDados.Graos.TCD_Autoriz_RetDeposito());

            if (linha != null)
            {
                qtd_sdautoriz.Value = Convert.ToDecimal(linha["saldo_retirar"].ToString());
                Cd_unid_autoriz     = linha["cd_unidade"].ToString();
            }
            else
            {
                qtd_sdautoriz.Value = decimal.Zero;
                Cd_unid_autoriz     = string.Empty;
            }
        }
Beispiel #27
0
        private void bb_empresa_Click(object sender, EventArgs e)
        {
            string vColunas = "a.NM_Empresa|Descrição Empresa|350;" +
                              "a.CD_Empresa|Cód. Empresa|100";
            string empresa_aux = "|exists|(select 1 from tb_div_usuario_x_empresa x" +
                                 " where x.cd_empresa = a.cd_empresa and ((x.login = '******') or " +
                                 "(exists(select 1 from tb_div_usuario_x_grupos y " +
                                 "        where y.logingrp = x.login and y.loginusr = '******'))))";

            if (!string.IsNullOrEmpty(CD_Local_Orig.Text))
            {
                empresa_aux += ";|exists|(select 1 from TB_EST_Empresa_X_LocalArm x " +
                               "            where x.cd_empresa = a.cd_empresa " +
                               "            and x.cd_local = '" + CD_Local_Orig.Text.Trim() + "')";
            }
            UtilPesquisa.BTN_BUSCA(vColunas, new Componentes.EditDefault[] { CD_Empresa, NM_Empresa },
                                   new CamadaDados.Diversos.TCD_CadEmpresa(), empresa_aux);
            this.Busca_Saldo_Local_Origem();
        }
Beispiel #28
0
        private void CD_Empresa_Leave(object sender, EventArgs e)
        {
            string vColunas = "a.CD_Empresa|=|'" + CD_Empresa.Text.Trim() + "';" +
                              "|EXISTS|(select 1 from tb_div_usuario_x_empresa x " +
                              "where x.cd_empresa = a.cd_empresa " +
                              "and ((x.login = '******') or " +
                              "(exists(select 1 from tb_div_usuario_x_grupos y " +
                              "       where y.logingrp = x.login and y.loginusr = '******'))))";

            if (!string.IsNullOrEmpty(CD_Local.Text))
            {
                vColunas += "|exists|(select 1 from tb_est_empresa_x_localarm x " +
                            "           where x.cd_empresa = a.cd_empresa " +
                            "           and x.cd_local = '" + CD_Local.Text.Trim() + "')";
            }
            UtilPesquisa.EDIT_LEAVE(vColunas, new Componentes.EditDefault[] { CD_Empresa, NM_Empresa },
                                    new TCD_CadEmpresa());
            busca_Valor_Unitario();
        }
Beispiel #29
0
 private void bb_clifor_Click(object sender, EventArgs e)
 {
     UtilPesquisa.BTN_BUSCA("a.nm_clifor|Nome Clifor|300;a.cd_clifor|Código Clifor|90;" +
                            "tp_pessoa|Tipo Pessoa|80;" +
                            "nr_cgc|C.N.P.J|80;" +
                            "nr_cpf|C.P.F|80;" +
                            "nr_rg|R.G|80;" +
                            "nm_razaosocial|Razão Social|100;" +
                            "nm_fantasia|Fantasia|100;" +
                            "EMAILPF|E-Mail P.F|100;" +
                            "EMAILPJ|E-Mail P.J|100;" +
                            "a.cd_transportador|Cd. Tranportadora|80;" +
                            "transp.nm_clifor|Transportadora|200;" +
                            "a.cd_endereco_transp|Cd. Transportadora|80;" +
                            "endTransp.ds_endereco|Endereco Transportadora|200"
                            , new Componentes.EditDefault[] { cd_transportadora, nm_transportadora },
                            new CamadaDados.Financeiro.Cadastros.TCD_CadClifor(), "isnull(a.st_registro, 'A')|<>|'C';isnull(a.st_transportadora, 'N')|=|'S'");
     this.BuscarEnd();
 }
Beispiel #30
0
        private void CD_Empresa_Leave(object sender, EventArgs e)
        {
            string vColunas = "a.CD_Empresa|=|'" + CD_Empresa.Text.Trim() + "';" +
                              "|EXISTS|(select 1 from tb_div_usuario_x_empresa x " +
                              "where x.cd_empresa = a.cd_empresa " +
                              "and ((x.login = '******') or " +
                              "(exists(select 1 from tb_div_usuario_x_grupos y " +
                              "       where y.logingrp = x.login and y.loginusr = '******'))))";

            if (!string.IsNullOrEmpty(CD_Local.Text))
            {
                vColunas += "|exists|(select 1 from tb_est_empresa_x_localarm x " +
                            "           where x.cd_empresa = a.cd_empresa " +
                            "           and x.cd_local = '" + CD_Local.Text.Trim() + "')";
            }
            UtilPesquisa.EDIT_LEAVE(vColunas, new Componentes.EditDefault[] { CD_Empresa, NM_Empresa },
                                    new CamadaDados.Diversos.TCD_CadEmpresa());
            VL_Unitario.Value = CamadaNegocio.Estoque.TCN_LanEstoque.Valor_Medio_Est_Produto(CD_Empresa.Text, cd_produto.Text, null);
        }