public static TList_Evento Buscar(string Cd_evento, string Ds_evento, string Tp_evento, BancoDados.TObjetoBanco banco) { Utils.TpBusca[] filtro = new Utils.TpBusca[0]; if (!string.IsNullOrEmpty(Cd_evento)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.cd_evento"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = Cd_evento; } if (!string.IsNullOrEmpty(Ds_evento)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.ds_evento"; filtro[filtro.Length - 1].vOperador = "like"; filtro[filtro.Length - 1].vVL_Busca = "'%" + Ds_evento.Trim() + "%'"; } if (!string.IsNullOrEmpty(Tp_evento)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.tp_evento"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = "'" + Tp_evento.Trim() + "'"; } return(new TCD_Evento(banco).Select(filtro, 0, string.Empty)); }
public static TList_CTRDuplicata Buscar(string Cd_empresa, string Nr_lanctoctr, string Nr_lanctoduplicata, short vTop, string vNm_campo, BancoDados.TObjetoBanco banco) { Utils.TpBusca[] filtro = new Utils.TpBusca[0]; if (Cd_empresa.Trim() != string.Empty) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.cd_empresa"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = "'" + Cd_empresa.Trim() + "'"; } if (Nr_lanctoctr.Trim() != string.Empty) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.nr_lanctoctr"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = Nr_lanctoctr; } if (Nr_lanctoduplicata.Trim() != string.Empty) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.nr_lanctoduplicata"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = Nr_lanctoduplicata; } return(new TCD_CTRDuplicata(banco).Select(filtro, vTop, vNm_campo)); }
public static TList_FotosPesagem Buscar(string Cd_empresa, string Id_ticket, string Tp_pesagem, BancoDados.TObjetoBanco banco) { Utils.TpBusca[] filtro = new Utils.TpBusca[0]; if (!string.IsNullOrEmpty(Cd_empresa)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.cd_empresa"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = "'" + Cd_empresa.Trim() + "'"; } if (!string.IsNullOrEmpty(Id_ticket)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.id_ticket"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = Id_ticket; } if (!string.IsNullOrEmpty(Tp_pesagem)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.tp_pesagem"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = "'" + Tp_pesagem.Trim() + "'"; } return(new TCD_FotosPesagem(banco).Select(filtro, 0, string.Empty)); }
private void TFGerarCupomNFe_Load(object sender, EventArgs e) { Utils.ShapeGrid.RestoreShape(this, gItens); Icon = Utils.ResourcesUtils.TecnoAliance_ICO; pFiltro.set_FormatZero(); bb_nfconsumo.Visible = St_habilitarNfConsumo; Utils.TpBusca[] vParam = new Utils.TpBusca[1]; vParam[0].vNM_Campo = string.Empty; vParam[0].vOperador = "exists"; vParam[0].vVL_Busca = "(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 (St_NFCe) { Array.Resize(ref vParam, vParam.Length + 1); vParam[vParam.Length - 1].vNM_Campo = string.Empty; vParam[vParam.Length - 1].vOperador = "exists"; vParam[vParam.Length - 1].vVL_Busca = "(select 1 from tb_fat_cfgnfe x " + " where x.cd_empresa = a.cd_empresa " + " and isnull(x.tp_ambiente_nfce, '') <> '')"; } cbEmpresa.DataSource = new CamadaDados.Diversos.TCD_CadEmpresa().Select(vParam, 0, string.Empty); cbEmpresa.DisplayMember = "nm_empresa"; cbEmpresa.ValueMember = "cd_empresa"; }
public static TList_ContingenciaNFCeOFF Buscar(string Cd_empresa, string Id_pdv, string St_registro, BancoDados.TObjetoBanco banco) { Utils.TpBusca[] filtro = new Utils.TpBusca[0]; if (!string.IsNullOrEmpty(Cd_empresa)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.cd_empresa"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = "'" + Cd_empresa.Trim() + "'"; } if (!string.IsNullOrEmpty(Id_pdv)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.id_pdv"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = Id_pdv; } if (!string.IsNullOrEmpty(St_registro)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "isnull(a.st_registro, 'A')"; filtro[filtro.Length - 1].vOperador = "in"; filtro[filtro.Length - 1].vVL_Busca = "(" + St_registro.Trim() + ")"; } return(new TCD_ContingenciaNFCeOFF(banco).Select(filtro, 0, string.Empty)); }
private void bbBuscarOrdem_Click(object sender, EventArgs e) { Utils.TpBusca[] filtro = new Utils.TpBusca[1]; //Empresa filtro[0].vNM_Campo = "a.cd_empresa"; filtro[0].vOperador = "="; filtro[0].vVL_Busca = "'" + cbEmpresa.SelectedValue.ToString() + "'"; Utils.Estruturas.CriarParametro(ref filtro, "(a.qtd_batch*a.qt_produto) - a.qtd_produzida", "0", ">"); if (!string.IsNullOrEmpty(cd_produtoordem.Text)) { Utils.Estruturas.CriarParametro(ref filtro, "a.CD_Produto", "'" + cd_produtoordem.Text.Trim() + "'"); } if (!string.IsNullOrEmpty(cd_grupoordem.Text)) { Utils.Estruturas.CriarParametro(ref filtro, "c.cd_grupo", "'" + cd_grupoordem.Text.Trim() + "%'", "like"); } if (!string.IsNullOrEmpty(nr_serie.Text)) { Utils.Estruturas.CriarParametro(ref filtro, string.Empty, "(select 1 from tb_prd_serieproduto x where x.id_ordem = a.id_ordem and x.nr_serie = '" + nr_serie.Text.Trim() + "')", "exists"); } if (cbStatus.SelectedIndex == 1) { Utils.Estruturas.CriarParametro(ref filtro, "isnull(a.st_registro, 'A')", "'A'"); } else if (cbStatus.SelectedIndex == 2) { Utils.Estruturas.CriarParametro(ref filtro, "isnull(a.st_registro, 'A')", "'P'"); } bsOrdemProduzir.DataSource = new TCD_OrdemProducao().Select(filtro, 0, string.Empty).OrderByDescending(p => p.Dt_prevfinprod).ToList(); }
public static TList_Cultura Buscar(string Id_cultura, string Ds_cultura, string Cd_produto, BancoDados.TObjetoBanco banco) { Utils.TpBusca[] filtro = new Utils.TpBusca[0]; if (!string.IsNullOrEmpty(Id_cultura)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.id_cultura"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = Id_cultura; } if (!string.IsNullOrEmpty(Ds_cultura)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.ds_cultura"; filtro[filtro.Length - 1].vOperador = "like"; filtro[filtro.Length - 1].vVL_Busca = "('%" + Ds_cultura.Trim() + "%')"; } if (!string.IsNullOrEmpty(Cd_produto)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.cd_produto"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = "'" + Cd_produto.Trim() + "'"; } return(new TCD_Cultura(banco).Select(filtro, 0, string.Empty)); }
public static TList_FaturaCartao_X_Caixa Buscar(string Id_fatura, string Cd_contager, string Cd_lanctocaixa, BancoDados.TObjetoBanco banco) { Utils.TpBusca[] filtro = new Utils.TpBusca[0]; if (!string.IsNullOrEmpty(Id_fatura)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.id_fatura"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = Id_fatura; } if (!string.IsNullOrEmpty(Cd_contager)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.cd_contager"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = "'" + Cd_contager.Trim() + "'"; } if (!string.IsNullOrEmpty(Cd_lanctocaixa)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.cd_lanctocaixa"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = Cd_lanctocaixa; } return(new TCD_FaturaCartao_X_Caixa(banco).Select(filtro, 0, string.Empty)); }
public static TList_CarregaCartaoPre Buscar(string Id_carga, string Cd_empresa, string Id_cartao, BancoDados.TObjetoBanco banco) { Utils.TpBusca[] filtro = new Utils.TpBusca[0]; if (!string.IsNullOrEmpty(Id_carga)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.Id_carga"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = Id_carga; } if (!string.IsNullOrEmpty(Cd_empresa)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.cd_empresa"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = "'" + Cd_empresa.Trim() + "'"; } if (!string.IsNullOrEmpty(Id_cartao)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.Id_cartao"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = Id_cartao; } return(new TCD_CarregaCartaoPre(banco).Select(filtro, 0, string.Empty, string.Empty)); }
public static TList_CTRLivroFiscal Buscar(string Cd_empresa, string Nr_lanctoctr, string Id_livro, short vTop, string vNm_campo, BancoDados.TObjetoBanco banco) { Utils.TpBusca[] filtro = new Utils.TpBusca[0]; if (!string.IsNullOrEmpty(Cd_empresa)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.cd_empresa"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = "'" + Cd_empresa.Trim() + "'"; } if (!string.IsNullOrEmpty(Nr_lanctoctr)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.nr_lanctoctr"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = Nr_lanctoctr; } if (!string.IsNullOrEmpty(Id_livro)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.id_livro"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = Id_livro; } return(new TCD_CTRLivroFiscal(banco).Select(filtro, vTop, vNm_campo)); }
public static TList_Markup Buscar(string Cd_empresa, string Id_markup, string Ds_markup, BancoDados.TObjetoBanco banco) { Utils.TpBusca[] filtro = new Utils.TpBusca[0]; if (!string.IsNullOrEmpty(Cd_empresa)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.cd_empresa"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = "'" + Cd_empresa.Trim() + "'"; } if (!string.IsNullOrEmpty(Id_markup)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.id_markup"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = Id_markup; } if (!string.IsNullOrEmpty(Ds_markup)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.ds_makup"; filtro[filtro.Length - 1].vOperador = "like"; filtro[filtro.Length - 1].vVL_Busca = "'%" + Ds_markup.Trim() + "%'"; } return(new TCD_Markup(banco).Select(filtro, 0, string.Empty)); }
public static TList_Gerente_X_Vendedor Buscar(string Cd_gerente, string Cd_vendedor, string Cd_empresa, BancoDados.TObjetoBanco banco) { Utils.TpBusca[] filtro = new Utils.TpBusca[0]; if (!string.IsNullOrEmpty(Cd_gerente)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.Cd_gerente"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = "'" + Cd_gerente.Trim() + "'"; } if (!string.IsNullOrEmpty(Cd_vendedor)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.cd_vendedor"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = "'" + Cd_vendedor.Trim() + "'"; } if (!string.IsNullOrEmpty(Cd_empresa)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.cd_empresa"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = "'" + Cd_empresa.Trim() + "'"; } return(new TCD_Gerente_X_Vendedor(banco).Select(filtro, 0, string.Empty)); }
public static TList_TpRequisicao Buscar(string id_tprequisicao, string ds_tprequisicao, string tp_requisicao, BancoDados.TObjetoBanco banco) { Utils.TpBusca[] filtro = new Utils.TpBusca[0]; if (!string.IsNullOrEmpty(id_tprequisicao)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.id_tprequisicao"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = id_tprequisicao; } if (!string.IsNullOrEmpty(ds_tprequisicao)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.ds_tprequisicao"; filtro[filtro.Length - 1].vOperador = "like"; filtro[filtro.Length - 1].vVL_Busca = "'%" + ds_tprequisicao.Trim() + "%'"; } if (!string.IsNullOrEmpty(tp_requisicao)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.tp_requisicao"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = "'" + tp_requisicao.Trim() + "'"; } return(new TCD_TpRequisicao(banco).Select(filtro, 0, string.Empty)); }
public static TList_CamposCC Buscar(string Cd_empresa, string Nr_lanctoctr, string Id_evento, BancoDados.TObjetoBanco banco) { Utils.TpBusca[] filtro = new Utils.TpBusca[0]; if (!string.IsNullOrEmpty(Cd_empresa)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.cd_empresa"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = "'" + Cd_empresa.Trim() + "'"; } if (!string.IsNullOrEmpty(Nr_lanctoctr)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.NR_LanctoCTR"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = Nr_lanctoctr; } if (!string.IsNullOrEmpty(Id_evento)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.id_evento"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = Id_evento; } return(new TCD_CamposCC(banco).Select(filtro, 0, string.Empty)); }
public static TList_Cad_BandeiraCartao Buscar(string ID_Bandeira, string DS_Bandeira, string Tp_cartao, int vTop, string vNm_campo, BancoDados.TObjetoBanco banco) { Utils.TpBusca[] filtro = new Utils.TpBusca[0]; if (!string.IsNullOrEmpty(ID_Bandeira)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.ID_Bandeira"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = ID_Bandeira; } if (!string.IsNullOrEmpty(DS_Bandeira)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.DS_Bandeira"; filtro[filtro.Length - 1].vOperador = "like"; filtro[filtro.Length - 1].vVL_Busca = "('%" + DS_Bandeira.Trim() + "%')"; } if (!string.IsNullOrEmpty(Tp_cartao)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.tp_cartao"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = "'" + Tp_cartao.Trim() + "'"; } return(new TCD_Cad_BandeiraCartao(banco).Select(filtro, vTop, vNm_campo)); }
public static TList_Viagem_X_Frete Buscar(string Id_viagem, string Cd_empresa, string Nr_lanctoCTR, BancoDados.TObjetoBanco banco) { Utils.TpBusca[] filtro = new Utils.TpBusca[0]; if (!string.IsNullOrEmpty(Id_viagem)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.id_viagem"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = Id_viagem; } if (!string.IsNullOrEmpty(Cd_empresa)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.cd_empresa"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = "'" + Cd_empresa.Trim() + "'"; } if (!string.IsNullOrEmpty(Nr_lanctoCTR)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.nr_lanctoCTR"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = Nr_lanctoCTR; } return(new TCD_Viagem_X_Frete(banco).Select(filtro, 0, string.Empty)); }
public static TList_Abastecidas Buscar(string Id_abastecida, string Cd_empresa, string Id_abastecimento, BancoDados.TObjetoBanco banco) { Utils.TpBusca[] filtro = new Utils.TpBusca[0]; if (!string.IsNullOrEmpty(Id_abastecida)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.id_abastecida"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = Id_abastecida; } if (!string.IsNullOrEmpty(Cd_empresa)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.cd_empresa"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = "'" + Cd_empresa.Trim() + "'"; } if (!string.IsNullOrEmpty(Id_abastecimento)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.id_abastecimento"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = Id_abastecimento; } return(new TCD_Abastecidas(banco).Select(filtro, 0, string.Empty)); }
public static TList_DevolucaoCF Buscar(string Cd_empresa, string Id_cupom, string Nr_lanctofiscal, BancoDados.TObjetoBanco banco) { Utils.TpBusca[] filtro = new Utils.TpBusca[0]; if (!string.IsNullOrEmpty(Cd_empresa)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.cd_empresa"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = "'" + Cd_empresa.Trim() + "'"; } if (!string.IsNullOrEmpty(Id_cupom)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.id_cupom"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = Id_cupom; } if (!string.IsNullOrEmpty(Nr_lanctofiscal)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.nr_lanctofiscal"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = Nr_lanctofiscal; } return(new TCD_DevolucaoCF(banco).Select(filtro, 0, string.Empty)); }
public static CamadaDados.Faturamento.Cadastros.TList_CFGImpNF Buscar(string Nr_serie, string Cd_modelo, string Cd_empresa, BancoDados.TObjetoBanco banco) { Utils.TpBusca[] filtro = new Utils.TpBusca[0]; if (!string.IsNullOrEmpty(Nr_serie.Trim())) { 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.Trim() + "'"; } if (!string.IsNullOrEmpty(Cd_modelo)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.cd_modelo"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = "'" + Cd_modelo.Trim() + "'"; } if (!string.IsNullOrEmpty(Cd_empresa.Trim())) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.cd_empresa"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = "'" + Cd_empresa.Trim() + "'"; } return(new CamadaDados.Faturamento.Cadastros.TCD_CFGImpNF(banco).Select(filtro, 0, string.Empty)); }
public static TList_Promocao_X_Grupo Buscar(string Id_promocao, string Cd_grupo, string Cd_produto, BancoDados.TObjetoBanco banco) { Utils.TpBusca[] filtro = new Utils.TpBusca[0]; if (!string.IsNullOrEmpty(Id_promocao)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.id_promocao"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = Id_promocao; } if (!string.IsNullOrEmpty(Cd_grupo)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.cd_grupo"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = "'" + Cd_grupo.Trim() + "'"; } if (!string.IsNullOrEmpty(Cd_produto)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.cd_produto"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = "'" + Cd_produto.Trim() + "'"; } return(new TCD_Promocao_X_Grupo(banco).Select(filtro, 0, string.Empty, string.Empty)); }
public static TList_AjusteICMS Buscar(string Cd_ajuste, string Cd_imposto, string Ds_ajuste, BancoDados.TObjetoBanco banco) { Utils.TpBusca[] filtro = new Utils.TpBusca[0]; if (!string.IsNullOrEmpty(Cd_ajuste)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.cd_ajuste"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = "'" + Cd_ajuste.Trim() + "'"; } if (!string.IsNullOrEmpty(Cd_imposto)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.cd_imposto"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = Cd_imposto; } if (!string.IsNullOrEmpty(Ds_ajuste)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.ds_ajuste"; filtro[filtro.Length - 1].vOperador = "like"; filtro[filtro.Length - 1].vVL_Busca = "('%" + Ds_ajuste.Trim() + "%')"; } return(new TCD_AjusteICMS(banco).Select(filtro, 0, string.Empty)); }
private void BuscarContaCtb() { Utils.TpBusca[] filtro = new Utils.TpBusca[0]; if (pFiltro != null) { if (pFiltro.Length > 0) { for (int i = 0; i < pFiltro.Length; i++) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = pFiltro[i].vNM_Campo; filtro[filtro.Length - 1].vOperador = pFiltro[i].vOperador; filtro[filtro.Length - 1].vVL_Busca = pFiltro[i].vVL_Busca; } } } if (!string.IsNullOrEmpty(ds_conta.Text)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.ds_contactb"; filtro[filtro.Length - 1].vOperador = "like"; filtro[filtro.Length - 1].vVL_Busca = "('%" + ds_conta.Text.Trim() + "%') or " + "exists (select 1 from TB_CTB_PlanoContas x " + "where x.cd_conta_CTB = a.CD_Conta_CTBPai " + "and x.DS_ContaCTB like '%" + ds_conta.Text.Trim() + "%')"; } BS_CadPlanoContas.DataSource = new TCD_CadPlanoContas().Select(filtro, 0, string.Empty, "a.cd_classificacao asc"); }
public static TList_OrdemCompra_X_PedItem Buscar(string Id_oc, string Nr_pedido, string Id_pedidoitem, int vTop, string vNm_campo, BancoDados.TObjetoBanco banco) { Utils.TpBusca[] filtro = new Utils.TpBusca[0]; if (Id_oc.Trim() != string.Empty) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.id_oc"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = Id_oc; } if (Nr_pedido.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; } if (Id_pedidoitem.Trim() != string.Empty) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.id_pedidoitem"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = Id_pedidoitem; } return(new TCD_OrdemCompra_X_PedItem(banco).Select(filtro, vTop, vNm_campo)); }
public static TList_ItensDevolvidos Buscar(string Cd_empresa, string Id_devolucao, string Id_cupom, BancoDados.TObjetoBanco banco) { Utils.TpBusca[] filtro = new Utils.TpBusca[0]; if (!string.IsNullOrEmpty(Cd_empresa)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.cd_empresa"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = "'" + Cd_empresa.Trim() + "'"; } if (!string.IsNullOrEmpty(Id_devolucao)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.id_devolucao"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = Id_devolucao; } if (!string.IsNullOrWhiteSpace(Id_cupom)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.id_cupom"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = Id_cupom; } return(new TCD_ItensDevolvidos(banco).Select(filtro, 0, string.Empty)); }
public static TList_CadJuro Buscar(string Cd_juro, string Ds_juro, string Tp_juro, int vTop, string vNm_campo) { Utils.TpBusca[] filtro = new Utils.TpBusca[0]; if (Cd_juro.Trim() != string.Empty) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "cd_juro"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = "'" + Cd_juro.Trim() + "'"; } if (Ds_juro.Trim() != string.Empty) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "ds_juro"; filtro[filtro.Length - 1].vOperador = "like"; filtro[filtro.Length - 1].vVL_Busca = "('%" + Ds_juro.Trim() + "%')"; } if (Tp_juro.Trim() != string.Empty) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "tp_juro"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = "'" + Tp_juro.Trim() + "'"; } return(new TCD_CadJuro().Select(filtro, vTop, vNm_campo)); }
public static TList_Manutencao_X_Almox Buscar(string Id_manutencao, string Id_veiculo, string Id_movimento, BancoDados.TObjetoBanco banco) { Utils.TpBusca[] filtro = new Utils.TpBusca[0]; if (!string.IsNullOrEmpty(Id_manutencao)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.id_manutencao"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = Id_manutencao; } if (!string.IsNullOrEmpty(Id_veiculo)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.id_veiculo"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = Id_veiculo.Trim(); } if (!string.IsNullOrEmpty(Id_movimento)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.id_movimento"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = Id_movimento; } return(new TCD_Manutencao_X_Almox(banco).Select(filtro, 0, string.Empty)); }
private void BuscaCentro() { Utils.TpBusca[] filtro = new Utils.TpBusca[0]; if (!string.IsNullOrEmpty(Tp_registro)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.tp_registro"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = "" + Tp_registro.Trim() + ""; } if (!string.IsNullOrEmpty(St_deducao)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "isnull(a.st_deducao, 'N')"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = "'" + St_deducao.Trim() + "'"; } if (!string.IsNullOrEmpty(ds_centro.Text) && cbFiltro.Checked) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.DS_CentroResultado"; filtro[filtro.Length - 1].vOperador = "like"; filtro[filtro.Length - 1].vVL_Busca = "'%" + ds_centro.Text.Trim() + "%'"; } bsCentroResult.DataSource = new CamadaDados.Financeiro.Cadastros.TCD_CentroResultado().Select(filtro, 0, string.Empty); }
private bool validarExistenciaVeiculo() { if (!pnEntradaDados.validarCampoObrigatorio()) { return(false); } Utils.TpBusca[] tpBuscas = new Utils.TpBusca[0]; Utils.Estruturas.CriarParametro(ref tpBuscas, "REPLACE(a.placa, '-', '')", "'" + Ed_NrPlacaOrigem.Text.Replace("-", string.Empty).Trim() + "'"); Utils.Estruturas.CriarParametro(ref tpBuscas, "isnull(a.st_registro, 'A')", "'A'"); _CadCavaloOrigem = new TCD_CadVeiculo().Select(tpBuscas, 1, string.Empty)[0]; if (_CadCavaloOrigem == null) { MessageBox.Show("Placa de origem informada não existe cadastrada.", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } tpBuscas = new Utils.TpBusca[0]; Utils.Estruturas.CriarParametro(ref tpBuscas, "REPLACE(a.placa, '-', '')", "'" + Ed_NrPlacaDestino.Text.Replace("-", string.Empty).Trim() + "'"); Utils.Estruturas.CriarParametro(ref tpBuscas, "isnull(a.st_registro, 'A')", "'A'"); _CadCavaloDestino = new TCD_CadVeiculo().Select(tpBuscas, 1, string.Empty)[0]; if (_CadCavaloDestino == null) { MessageBox.Show("Placa de destino informada não existe cadastrada.", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } return(true); }
public static TList_AjudantesMud Buscar(string Cd_empresa, string Id_mudanca, string Cd_ajudante, BancoDados.TObjetoBanco banco) { Utils.TpBusca[] filtro = new Utils.TpBusca[0]; if (!string.IsNullOrEmpty(Cd_empresa)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.Cd_empresa"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = "'" + Cd_empresa.Trim() + "'"; } if (!string.IsNullOrEmpty(Id_mudanca)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.Id_mudanca"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = Id_mudanca; } if (!string.IsNullOrEmpty(Cd_ajudante)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.Cd_ajudante"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = "'" + Cd_ajudante.Trim() + "'"; } return(new TCD_AjudantesMud(banco).Select(filtro, 0, string.Empty)); }
public static CamadaDados.Frota.Cadastros.TList_DevOutrasReceitas Buscar(string ID_Receita, string CD_ContaGer, string CD_LanctoCaixa, BancoDados.TObjetoBanco banco) { Utils.TpBusca[] filtro = new Utils.TpBusca[0]; if (!string.IsNullOrEmpty(ID_Receita)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.ID_Receita"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = ID_Receita; } if (!string.IsNullOrEmpty(CD_ContaGer)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.CD_ContaGer"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = "'" + CD_ContaGer.Trim() + "'"; } if (!string.IsNullOrEmpty(CD_LanctoCaixa)) { Array.Resize(ref filtro, filtro.Length + 1); filtro[filtro.Length - 1].vNM_Campo = "a.CD_LanctoCaixa"; filtro[filtro.Length - 1].vOperador = "="; filtro[filtro.Length - 1].vVL_Busca = CD_LanctoCaixa; } return(new CamadaDados.Frota.Cadastros.TCD_DevOutrasReceitas(banco).Select(filtro, 0, string.Empty)); }