Пример #1
0
 private void TFListaDuplicata_Load(object sender, EventArgs e)
 {
     bsCarne.DataSource = new TCD_LanDuplicata().Select(
         new TpBusca[]
     {
         new TpBusca()
         {
             vNM_Campo = "isnull(a.st_registro, 'A')",
             vOperador = "<>",
             vVL_Busca = "'C'"
         },
         new TpBusca()
         {
             vNM_Campo = "g.TP_Mov",
             vOperador = "=",
             vVL_Busca = "'R'"
         },
         new TpBusca()
         {
             vNM_Campo = "a.cd_empresa",
             vOperador = "=",
             vVL_Busca = "'" + Cd_empresa.Trim() + "'"
         },
         new TpBusca()
         {
             vNM_Campo = "a.cd_clifor",
             vOperador = "=",
             vVL_Busca = "'" + Cd_clifor.Trim() + "'"
         }
     }, 0, string.Empty);
 }
Пример #2
0
 private void LimpaFiltros()
 {
     Id_locacao.Clear();
     Cd_empresa.Clear();
     Cd_clifor.Clear();
     dt_ini.Clear();
     dt_fin.Clear();
 }
Пример #3
0
        private void nr_pedido_Leave(object sender, EventArgs e)
        {
            string vColunas = "a.nr_pedido|=|" + nr_pedido.Text + ";" +
                              "||(isnull(a.st_pedido, 'A') in ('F', 'P'));" +
                              "a.cd_clifor|=|'" + Cd_clifor.Trim() + "';" +
                              "a.tp_movimento|=|'" + Tp_movimento.Trim().ToUpper() + "';" +
                              "|EXISTS|(select 1 from tb_div_usuario_x_cfgpedido x " +
                              "where x.cfg_pedido = a.cfg_pedido " +
                              "and ((x.login = '******') or " +
                              "(exists(select 1 from tb_div_usuario_x_grupos y " +
                              "         where y.logingrp = x.login and y.loginusr = '******'))))";

            UtilPesquisa.EDIT_LEAVE(vColunas,
                                    new Componentes.EditDefault[] { nr_pedido }, new CamadaDados.Faturamento.Pedido.TCD_Pedido());
        }
Пример #4
0
        private void bb_pedido_Click(object sender, EventArgs e)
        {
            string vParam = "||(isnull(a.st_pedido, 'A') in ('F', 'P'));" +
                            "a.cd_clifor|=|'" + Cd_clifor.Trim() + "';" +
                            "a.tp_movimento|=|'" + Tp_movimento.Trim().ToUpper() + "';" +
                            "|EXISTS|(select 1 from tb_div_usuario_x_cfgpedido x " +
                            "where x.cfg_pedido = a.cfg_pedido " +
                            "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("a.NR_Pedido|Nº Pedido|100;f.NM_Clifor|Nome|120;a.CD_Clifor|CódClifor|80"
                                   , new Componentes.EditDefault[] { nr_pedido }
                                   , new CamadaDados.Faturamento.Pedido.TCD_Pedido(), vParam);
        }
Пример #5
0
 private void afterBusca()
 {
     Utils.TpBusca[] filtro = new Utils.TpBusca[5];
     //Empresa
     filtro[0].vNM_Campo = "a.cd_empresa";
     filtro[0].vOperador = "=";
     filtro[0].vVL_Busca = "'" + Cd_empresa.Trim() + "'";
     //Tipo de Movimento
     filtro[1].vNM_Campo = "a.tp_movimento";
     filtro[1].vOperador = "=";
     filtro[1].vVL_Busca = "'" + Tp_movimento.Trim().ToUpper() + "'";
     //Clifor
     filtro[2].vNM_Campo = "a.cd_clifor";
     filtro[2].vOperador = "=";
     filtro[2].vVL_Busca = "'" + Cd_clifor.Trim() + "'";
     //Nota nao cancelada
     filtro[3].vNM_Campo = "isnull(a.st_registro, 'A')";
     filtro[3].vOperador = "=";
     filtro[3].vVL_Busca = "'A'";
     //Nao pode estar amarrado a um conhecimento de frete diferente de cancelado
     filtro[4].vNM_Campo = string.Empty;
     filtro[4].vOperador = "not exists";
     filtro[4].vVL_Busca = "(select 1 from tb_ctr_notafiscal x " +
                           "inner join tb_ctr_conhecimentofrete y " +
                           "on x.cd_empresa = y.cd_empresa " +
                           "and x.nr_lanctoctr = y.nr_lanctoctr " +
                           "where x.cd_empresa = a.cd_empresa " +
                           "and x.nr_lanctofiscal = a.nr_lanctofiscal " +
                           "and isnull(y.st_registro, 'A') in('A', 'P'))";
     if (nr_notafiscal.Text.Trim() != string.Empty)
     {
         Array.Resize(ref filtro, filtro.Length + 1);
         filtro[filtro.Length - 1].vNM_Campo = "a.nr_notafiscal";
         filtro[filtro.Length - 1].vOperador = "=";
         filtro[filtro.Length - 1].vVL_Busca = nr_notafiscal.Text;
     }
     if (nr_serie.Text.Trim() != string.Empty)
     {
         Array.Resize(ref filtro, filtro.Length + 1);
         filtro[filtro.Length - 1].vNM_Campo = "a.nr_serie";
         filtro[filtro.Length - 1].vOperador = "=";
         filtro[filtro.Length - 1].vVL_Busca = nr_serie.Text;
     }
     if (nr_pedido.Text.Trim() != string.Empty)
     {
         Array.Resize(ref filtro, filtro.Length + 1);
         filtro[filtro.Length - 1].vNM_Campo = "a.nr_pedido";
         filtro[filtro.Length - 1].vOperador = "=";
         filtro[filtro.Length - 1].vVL_Busca = nr_pedido.Text;
     }
     if ((DT_Inicial.Text.Trim() != string.Empty) &&
         (DT_Inicial.Text.Trim() != "/  /"))
     {
         Array.Resize(ref filtro, filtro.Length + 1);
         filtro[filtro.Length - 1].vNM_Campo = rbEmissao.Checked ? "a.dt_emissao":"a.dt_saient";
         filtro[filtro.Length - 1].vOperador = ">=";
         filtro[filtro.Length - 1].vVL_Busca = "'" + string.Format(new System.Globalization.CultureInfo("en-US", true), Convert.ToDateTime(DT_Inicial.Text).ToString("yyyyMMdd")) + " 00:00:00'";
     }
     if ((DT_Final.Text.Trim() != string.Empty) &&
         (DT_Final.Text.Trim() != "/  /"))
     {
         Array.Resize(ref filtro, filtro.Length + 1);
         filtro[filtro.Length - 1].vNM_Campo = rbEmissao.Checked ? "a.dt_emissao" : "a.dt_saient";
         filtro[filtro.Length - 1].vOperador = "<=";
         filtro[filtro.Length - 1].vVL_Busca = "'" + string.Format(new System.Globalization.CultureInfo("en-US", true), Convert.ToDateTime(DT_Final.Text).ToString("yyyyMMdd")) + " 23:59:59'";
     }
     bsNotaFiscal.DataSource = new CamadaDados.Faturamento.NotaFiscal.TCD_LanFaturamento().Select(filtro, 0, string.Empty);
 }