Ejemplo n.º 1
0
 public void setTextBoxes()
 {
     txbCdPrdt.Text               = Cd_produto.ToString();
     txbNomePrdt.Text             = Nome_produto;
     txbRemetente.Text            = Filial_Remetente;
     cbDestinataria.DataSource    = ConManager.Consultar("SELECT nome FROM Filiais WHERE disponivel = 1 AND nome !=@nome ", "@nome", Filial_Remetente).Tables[0];
     cbDestinataria.DisplayMember = "nome";
     cbDestinataria.DropDownStyle = ComboBoxStyle.DropDownList;
 }
Ejemplo n.º 2
0
        private void id_almox_Leave(object sender, EventArgs e)
        {
            string vParam = "a.id_almox|=|" + id_almox.Text + ";" +
                            "|exists|(select 1 from tb_amx_almox_x_empresa x " +
                            "           where x.id_almox = a.id_almox " +
                            "           and x.cd_empresa = '" + Cd_empresa.Trim() + "');" +
                            "|exists|(select 1 from tb_amx_itens y " +
                            "           where y.id_almox = a.id_almox " +
                            "           and y.cd_produto = '" + Cd_produto.Trim() + "')";

            FormBusca.UtilPesquisa.EDIT_LEAVE(vParam, new Componentes.EditDefault[] { id_almox, ds_almoxarifado },
                                              new CamadaDados.Almoxarifado.TCD_CadAlmoxarifado());
            this.BuscarAlocacao();
        }
Ejemplo n.º 3
0
        private void bb_almox_Click(object sender, EventArgs e)
        {
            string vColunas = "a.ds_almoxarifado|Almoxarifado|150;" +
                              "a.id_almox|Id. Almox.|80";
            string vParam = "|exists|(select 1 from tb_amx_almox_x_empresa x " +
                            "           where x.id_almox = a.id_almox " +
                            "           and x.cd_empresa = '" + Cd_empresa.Trim() + "');" +
                            "|exists|(select 1 from tb_amx_itens y " +
                            "           where y.id_almox = a.id_almox " +
                            "           and y.cd_produto = '" + Cd_produto.Trim() + "')";

            FormBusca.UtilPesquisa.BTN_BUSCA(vColunas, new Componentes.EditDefault[] { id_almox, ds_almoxarifado },
                                             new CamadaDados.Almoxarifado.TCD_CadAlmoxarifado(), vParam);
            this.BuscarAlocacao();
        }
Ejemplo n.º 4
0
        private void TFTermoLMC_Load(object sender, EventArgs e)
        {
            Icon = Utils.ResourcesUtils.TecnoAliance_ICO;
            pDados.set_FormatZero();

            if (dt_ref.HasValue)
            {
                dt_referencia.Value = dt_ref.Value;
            }
            CD_Empresa.Text = Cd_empresa;
            NM_Empresa.Text = Nm_empresa;
            //Buscar combustivel
            bsProduto.DataSource = new CamadaDados.Estoque.Cadastros.TCD_CadProduto().Select(
                new Utils.TpBusca[]
            {
                new Utils.TpBusca()
                {
                    vNM_Campo = "isnull(e.st_combustivel, 'N')",
                    vOperador = "=",
                    vVL_Busca = "'S'"
                },
                new Utils.TpBusca()
                {
                    vNM_Campo = string.Empty,
                    vOperador = "exists",
                    vVL_Busca = "(select 1 from tb_pdc_tanque x " +
                                "where x.cd_produto = a.cd_produto)"
                }
            }, 0, string.Empty, string.Empty, string.Empty);
            if ((bsProduto.Count > 0) && (!string.IsNullOrEmpty(Cd_produto)))
            {
                if ((bsProduto.List as CamadaDados.Estoque.Cadastros.TList_CadProduto).Exists(p => p.CD_Produto.Trim().Equals(Cd_produto.Trim())))
                {
                    (bsProduto.List as CamadaDados.Estoque.Cadastros.TList_CadProduto).Find(p => p.CD_Produto.Trim().Equals(Cd_produto.Trim())).St_processar = true;
                    bsProduto.ResetBindings(true);
                }
            }
        }
Ejemplo n.º 5
0
 private void TFSaldoLoteSemente_Load(object sender, EventArgs e)
 {
     Utils.ShapeGrid.RestoreShape(this, gLoteSemente);
     Utils.ShapeGrid.RestoreShape(this, gGridNf);
     if (!string.IsNullOrEmpty(Utils.Parametros.pubCultura))
     {
         Idioma.TIdioma.AjustaCultura(this);
     }
     Icon = Utils.ResourcesUtils.TecnoAliance_ICO;
     pDadosLote.set_FormatZero();
     qtd_totalnf.Value  = Qtd_nota;
     rbVenda.Checked    = !St_devolucao;
     rbDevVenda.Checked = St_devolucao;
     rbDevVenda.Text    = St_devolucao ? Tp_mov.Trim().ToUpper().Equals("E") ? "Devolução Venda" : "Devolução Compra" : "Devolução";
     //Buscar lista de lotes disponiveis
     //Empresa
     TpBusca[] filtro = new TpBusca[3];
     filtro[0].vNM_Campo = "a.cd_empresa";
     filtro[0].vOperador = "=";
     filtro[0].vVL_Busca = "'" + Cd_empresa.Trim() + "'";
     //Produto
     filtro[1].vNM_Campo = "a.cd_produto";
     filtro[1].vOperador = "=";
     filtro[1].vVL_Busca = "'" + Cd_produto.Trim() + "'";
     //Lote Aprovado
     filtro[2].vNM_Campo = "isnull(a.st_registro, 'A')";
     filtro[2].vOperador = "=";
     filtro[2].vVL_Busca = "'P'";
     if (St_devolucao && Tp_mov.Trim().ToUpper().Equals("S"))
     {
         Array.Resize(ref filtro, filtro.Length + 1);
         filtro[filtro.Length - 1].vNM_Campo = "a.tp_lote";
         filtro[filtro.Length - 1].vOperador = "=";
         filtro[filtro.Length - 1].vVL_Busca = "'T'";
     }
     if (Tp_mov.Trim().ToUpper().Equals("S") && !St_devolucao)
     {
         Array.Resize(ref filtro, filtro.Length + 2);
         //Lote a vencer
         filtro[filtro.Length - 2].vNM_Campo = "CONVERT(DATETIME,FLOOR(CONVERT(NUMERIC(30,10),a.dt_valgerminacao)))";
         filtro[filtro.Length - 2].vOperador = ">=";
         filtro[filtro.Length - 2].vVL_Busca = "CONVERT(DATETIME,FLOOR(CONVERT(NUMERIC(30,10),getdate())))";
         //Lote com saldo
         filtro[filtro.Length - 1].vNM_Campo = "((isnull(dbo.F_CONVERTE_UNID(f.cd_unidade, d.cd_unidade, a.qtd_lote), a.qtd_lote) - " +
                                               //Notas Vendas
                                               "isnull((select sum(isnull(x.quantidade, 0)) " +
                                               "                 from tb_sem_lotesemente_x_nfitem x " +
                                               "                 inner join tb_fat_notafiscal_item y " +
                                               "                 on x.cd_empresa = y.cd_empresa " +
                                               "                 and x.nr_lanctofiscal = y.nr_lanctofiscal " +
                                               "                 and x.id_nfitem = y.id_nfitem " +
                                               "                 inner join tb_fat_notafiscal z " +
                                               "                 on y.cd_empresa = z.cd_empresa " +
                                               "                 and y.nr_lanctofiscal = z.nr_lanctofiscal " +
                                               "                 inner join tb_fat_notafiscal_cmi cmi " +
                                               "                 on z.cd_empresa = cmi.cd_empresa " +
                                               "                 and z.nr_lanctofiscal = cmi.nr_lanctofiscal " +
                                               "                 where z.tp_movimento = 'S' " +
                                               "                 and x.tp_movimento = 'D' " +
                                               "                 and isnull(cmi.st_devolucao, 'N') = 'S' " +
                                               "                 and isnull(z.st_registro, 'A') <> 'C' " +
                                               "                 and x.id_lote = a.id_lote), 0)) - " +
                                               //Devolucao Compra
                                               "(isnull((select sum(isnull(x.quantidade, 0)) " +
                                               "                 from tb_sem_lotesemente_x_nfitem x " +
                                               "                 inner join tb_fat_notafiscal_item y " +
                                               "                 on x.cd_empresa = y.cd_empresa " +
                                               "                 and x.nr_lanctofiscal = y.nr_lanctofiscal " +
                                               "                 and x.id_nfitem = y.id_nfitem " +
                                               "                 inner join tb_fat_notafiscal z " +
                                               "                 on y.cd_empresa = z.cd_empresa " +
                                               "                 and y.nr_lanctofiscal = z.nr_lanctofiscal " +
                                               "                 inner join tb_fat_notafiscal_cmi cmi " +
                                               "                 on z.cd_empresa = cmi.cd_empresa " +
                                               "                 and z.nr_lanctofiscal = cmi.nr_lanctofiscal " +
                                               "                 where z.tp_movimento = 'S' " +
                                               "                 and isnull(z.st_registro, 'A') <> 'C' " +
                                               "                 and x.tp_movimento = 'V' " +
                                               "                 and isnull(cmi.st_devolucao, 'N') <> 'S' " +
                                               "                 and x.id_lote = a.id_lote ), 0) - " +
                                               //Devolucao Venda
                                               "isnull((select sum(isnull(x.quantidade, 0)) " +
                                               "                 from tb_sem_lotesemente_x_nfitem x " +
                                               "                 inner join tb_fat_notafiscal_item y " +
                                               "                 on x.cd_empresa = y.cd_empresa " +
                                               "                 and x.nr_lanctofiscal = y.nr_lanctofiscal " +
                                               "                 and x.id_nfitem = y.id_nfitem " +
                                               "                 inner join tb_fat_notafiscal z " +
                                               "                 on y.cd_empresa = z.cd_empresa " +
                                               "                 and y.nr_lanctofiscal = z.nr_lanctofiscal " +
                                               "                 inner join tb_fat_notafiscal_cmi cmi " +
                                               "                 on z.cd_empresa = cmi.cd_empresa " +
                                               "                 and z.nr_lanctofiscal = cmi.nr_lanctofiscal " +
                                               "                 where z.tp_movimento = 'E' " +
                                               "                 and x.tp_movimento = 'D' " +
                                               "                 and isnull(cmi.st_devolucao, 'N') = 'S' " +
                                               "                 and isnull(z.st_registro, 'A') <> 'C' " +
                                               "                 and x.id_lote = a.id_lote), 0))) ";
         filtro[filtro.Length - 1].vOperador = ">";
         filtro[filtro.Length - 1].vVL_Busca = "0";
     }
     bsLoteSemente.DataSource = new CamadaDados.Sementes.TCD_LoteSemente().Select(filtro, 0, string.Empty);
 }