internal Resultados <Papel> Filtrar(Filtro <PapelListarFiltro> filtros, BancoDeDados banco = null) { Resultados <Papel> retorno = new Resultados <Papel>(); using (BancoDeDados bancoDeDados = BancoDeDados.ObterInstancia(banco)) { string comandtxt = string.Empty; Comando comando = bancoDeDados.CriarComando(""); #region Adicionando Filtros comandtxt += comando.FiltroAndLike("p.nome", "nome", filtros.Dados.Nome, true); List <String> ordenar = new List <String>() { "nome" }; List <String> colunas = new List <String>() { "nome" }; #endregion #region Executa a pesquisa nas tabelas comando.DbCommand.CommandText = "select count(*) from tab_autenticacao_papel p where p.tipo = 1 and p.funcionario_tipo = 3 " + comandtxt; retorno.Quantidade = Convert.ToInt32(bancoDeDados.ExecutarScalar(comando)); comando.AdicionarParametroEntrada("menor", filtros.Menor); comando.AdicionarParametroEntrada("maior", filtros.Maior); comandtxt = String.Format(@" select p.id, p.nome, p.tid from tab_autenticacao_papel p where p.tipo = 1 and p.funcionario_tipo = 3 {0} {1}", comandtxt, DaHelper.Ordenar(colunas, ordenar)); comando.DbCommand.CommandText = @"select * from (select a.*, rownum rnum from ( " + comandtxt + @") a) where rnum <= :maior and rnum >= :menor"; #endregion using (IDataReader reader = bancoDeDados.ExecutarReader(comando)) { Papel papel; while (reader.Read()) { papel = new Papel(); papel.Id = Convert.ToInt32(reader["id"]); papel.Tid = reader["tid"].ToString(); papel.Nome = reader["nome"].ToString(); retorno.Itens.Add(papel); } reader.Close(); } } return(retorno); }
internal List <ListaValor> ObterAssinanteCargos(int setorId, BancoDeDados banco = null) { List <ListaValor> lst = new List <ListaValor>(); using (BancoDeDados bancoDeDados = BancoDeDados.ObterInstancia(banco)) { Comando comando = bancoDeDados.CriarComando(@"select c.id, c.nome from {0}tab_cargo c where c.id in ( select tfc.cargo from {0}tab_funcionario_setor tse, {0}tab_funcionario_cargo tfc where tse.setor = :setorId and tse.funcionario = tfc.funcionario) order by 2" , EsquemaBanco); comando.AdicionarParametroEntrada("setorId", setorId, DbType.Int32); IEnumerable <IDataReader> daReader = DaHelper.ObterLista(comando, bancoDeDados); foreach (var item in daReader) { lst.Add(new ListaValor() { Id = Convert.ToInt32(item["id"]), Texto = item["nome"].ToString(), IsAtivo = true }); } } return(lst); }
internal List <TituloModeloLst> ObterModelosAnteriores(int modelo, BancoDeDados banco = null) { List <TituloModeloLst> lst = new List <TituloModeloLst>(); using (BancoDeDados bancoDeDados = BancoDeDados.ObterInstancia(banco)) { Comando comando = bancoDeDados.CriarComando(@"select ttm.id, ttm.nome, ttm.sigla from tab_titulo_modelo_respostas ttmr, {0}tab_titulo_modelo ttm, {0}tab_titulo_modelo_regras ttmreg where to_number(ttmr.valor) = ttm.id and ttmr.regra = ttmreg.id and ttmreg.regra = 10 /*Possui fase anterior?*/ and ttmr.resposta = 7 /*Modelo de Título*/ and ttmr.modelo = :modelo" , EsquemaBanco); comando.AdicionarParametroEntrada("modelo", modelo, DbType.Int32); IEnumerable <IDataReader> daReader = DaHelper.ObterLista(comando, bancoDeDados); foreach (var item in daReader) { lst.Add(new TituloModeloLst() { Id = Convert.ToInt32(item["id"]), Texto = item["nome"].ToString(), Sigla = item["sigla"].ToString(), IsAtivo = true }); } } return(lst); }
internal List <Lista> ObterAtividadesLista(int requerimentoId) { List <Lista> lst = new List <Lista>(); Comando comando = null; using (BancoDeDados bancoDeDados = BancoDeDados.ObterInstancia(EsquemaBanco)) { comando = bancoDeDados.CriarComando(@"select ta.id, ta.atividade, ta.codigo from {0}tab_requerimento_atividade t, {0}tab_atividade ta where t.atividade = ta.id and t.requerimento = :requerimento" , EsquemaBanco); comando.AdicionarParametroEntrada("requerimento", requerimentoId); IEnumerable <IDataReader> daReader = DaHelper.ObterLista(comando, bancoDeDados); foreach (var item in daReader) { lst.Add(new Lista() { Id = item.GetValue <string>("id"), Texto = item.GetValue <string>("atividade"), Codigo = item.GetValue <string>("codigo"), IsAtivo = true }); } } return(lst); }
internal List <AtividadeSolicitada> ObterAtividadesLista(int id) { List <AtividadeSolicitada> lst = new List <AtividadeSolicitada>(); using (BancoDeDados bancoDeDados = BancoDeDados.ObterInstancia()) { Comando comando = bancoDeDados.CriarComando(@"select pa.id, pa.atividade from {0}tab_protocolo_atividades t, {0}tab_atividade pa where t.atividade = pa.id and t.protocolo = :id" , EsquemaBanco); comando.AdicionarParametroEntrada("id", id); IEnumerable <IDataReader> daReader = DaHelper.ObterLista(comando, bancoDeDados); foreach (var item in daReader) { lst.Add(new AtividadeSolicitada() { Id = Convert.ToInt32(item["id"]), Texto = item["atividade"].ToString(), IsAtivo = true }); } } return(lst); }
internal Dictionary <int, List <Municipio> > ObterMunicipios(List <Estado> estados) { Dictionary <int, List <Municipio> > lst = new Dictionary <int, List <Municipio> >(); List <Municipio> lstMun = null; foreach (var estado in estados) { IEnumerable <IDataReader> daReader = DaHelper.ObterLista(string.Format(@"select c.id, c.texto, c.estado, c.cep, c.ibge from lov_municipio c where c.estado = {0} order by c.texto", estado.Id.ToString())); lstMun = new List <Municipio>(); foreach (var item in daReader) { lstMun.Add(new Municipio() { Id = Convert.ToInt32(item["id"]), Texto = item["texto"].ToString(), Estado = new Estado() { Id = Convert.ToInt32(item["estado"]) }, IsAtivo = true, Ibge = Convert.ToInt32(item["ibge"]) }); } lst.Add(estado.Id, lstMun); } return(lst); }
public Dictionary <Int32, String> ObterDiretorioArquivo() { Dictionary <Int32, String> lstDiretorios = new Dictionary <int, string>(); IEnumerable <IDataReader> daReader = DaHelper.ObterLista(@"select c.id, c.raiz from cnf_arquivo c where c.ativo = 1 and tipo = 2", schema: UsuarioPublicoGeo); foreach (var item in daReader) { lstDiretorios.Add(Convert.ToInt32(item["id"]), item["raiz"].ToString()); } return(lstDiretorios); }
public Dictionary <Int32, String> ObterCredenciadoDiretorioArquivoTemp(BancoDeDados bancoCredenciado) { Dictionary <Int32, String> lstDiretorios = new Dictionary <int, string>(); IEnumerable <IDataReader> daReader = DaHelper.ObterLista(@"select c.id, c.raiz from cnf_arquivo c where c.ativo = 1 and tipo = 1", bancoCredenciado); foreach (var item in daReader) { lstDiretorios.Add(Convert.ToInt32(item["id"]), item["raiz"].ToString()); } return(lstDiretorios); }
internal String BuscarConfiguracaoSistema(string valor) { String retorno = String.Empty; IEnumerable <IDataReader> daReader = DaHelper.ObterLista(@"select c.valor from cnf_sistema c where lower(c.campo) = :valor", valor.ToLower()); foreach (var item in daReader) { retorno = item["valor"].ToString(); break; } return(retorno); }
internal List <String> BuscarRoteiroPadrao() { String retorno = String.Empty; IEnumerable <IDataReader> daReader = DaHelper.ObterLista(@"select c.valor from cnf_sistema c where lower(c.campo) = 'roteiropadrao'", BancoDeDados.ObterInstancia(UsuarioCredenciado)); foreach (var item in daReader) { retorno = item["valor"].ToString(); break; } return(retorno.Split(',').ToList() ?? new List <String>()); }
internal List <Lista> ObterExploracaoFlorestalExploracao() { List <Lista> lst = new List <Lista>(); IEnumerable <IDataReader> daReader = DaHelper.ObterLista(@"select t.id, t.texto from lov_crt_exp_flores_exploracao t"); foreach (var item in daReader) { lst.Add(new Lista() { Id = item["id"].ToString(), Texto = Convert.ToString(item["texto"]), IsAtivo = true }); } return(lst); }
internal List <Lista> ObterCaracterizacaoUnidadeMedida() { List <Lista> lst = new List <Lista>(); IEnumerable <IDataReader> daReader = DaHelper.ObterLista(@"select c.id, c.texto from lov_crt_unidade_medida c order by c.id"); foreach (var item in daReader) { lst.Add(new Lista() { Id = item["id"].ToString(), Texto = item["texto"].ToString(), IsAtivo = true }); } return(lst); }
internal List <Lista> ObterDadosLov(string strLov) { List <Lista> lst = new List <Lista>(); IEnumerable <IDataReader> daReader = DaHelper.ObterLista("select t.id, t.texto from " + strLov + " t order by t.id"); foreach (var item in daReader) { lst.Add(new Lista() { Id = item["id"].ToString(), Texto = Convert.ToString(item["texto"]), IsAtivo = true }); } return(lst); }
internal List <Lista> ObterTipoExploracaoFlorestal() { List <Lista> lst = new List <Lista>(); IEnumerable <IDataReader> daReader = DaHelper.ObterLista(@"select t.tipo_atividade, t.texto from lov_tipo_exploracao t", schema: "idafgeo"); foreach (var item in daReader) { lst.Add(new Lista() { Id = item["tipo_atividade"].ToString(), Texto = Convert.ToString(item["texto"]), IsAtivo = true }); } return(lst); }
internal List <Lista> ObterCultivoTipo() { List <Lista> lst = new List <Lista>(); IEnumerable <IDataReader> daReader = DaHelper.ObterLista(@"select t.id, t.texto from lov_crt_queima_c_cultivo_tipo t"); foreach (var item in daReader) { lst.Add(new Lista() { Id = item["id"].ToString(), Texto = Convert.ToString(item["texto"]), IsAtivo = true }); } return(lst); }
internal List <Situacao> ObterSituacaoFuncionario() { List <Situacao> lst = new List <Situacao>(); IEnumerable <IDataReader> daReader = DaHelper.ObterLista(@"select s.id, s.texto nome from lov_funcionario_situacao s"); foreach (var item in daReader) { lst.Add(new Situacao() { Id = Convert.ToInt32(item["id"]), Nome = item["nome"].ToString(), IsAtivo = true }); } return(lst); }
internal List <Lista> ObterCaracterizacaoDestinacaoMaterialLenhoso() { List <Lista> lst = new List <Lista>(); IEnumerable <IDataReader> daReader = DaHelper.ObterLista(@"select t.id, t.texto from lov_dest_material_lenhoso t"); foreach (var item in daReader) { lst.Add(new Lista() { Id = item["id"].ToString(), Texto = Convert.ToString(item["texto"]), IsAtivo = true }); } return(lst); }
internal List <Lista> ObterPulverizacaoProdutoCulturas() { List <Lista> lst = new List <Lista>(); IEnumerable <IDataReader> daReader = DaHelper.ObterLista(@"select t.id, t.texto from lov_crt_pulveriz_prod_agr_cult t order by t.id"); foreach (var item in daReader) { lst.Add(new Lista() { Id = item["id"].ToString(), Texto = Convert.ToString(item["texto"]), IsAtivo = true }); } return(lst); }
internal List <CoordenadaHemisferio> ObterHemisferios() { List <CoordenadaHemisferio> lst = new List <CoordenadaHemisferio>(); IEnumerable <IDataReader> daReader = DaHelper.ObterLista(@"select h.id, h.texto from lov_coordenada_hemisferio h"); foreach (var item in daReader) { lst.Add(new CoordenadaHemisferio() { Id = Convert.ToInt32(item["id"]), Texto = item["texto"].ToString(), IsAtivo = true }); } return(lst); }
internal List <Lista> ObterBarragemDispensaLicencaVertedouroTipo() { List <Lista> lst = new List <Lista>(); IEnumerable <IDataReader> daReader = DaHelper.ObterLista(@"select t.id, t.texto from lov_crt_bdla_vertedouro_tipo t order by t.texto"); foreach (var item in daReader) { lst.Add(new Lista() { Id = item["id"].ToString(), Texto = Convert.ToString(item["texto"]), IsAtivo = true }); } return(lst); }
internal List <Lista> ObterSilviculturaAtvCoberturaExitente() { List <Lista> lst = new List <Lista>(); IEnumerable <IDataReader> daReader = DaHelper.ObterLista(@"select t.id, t.texto from lov_crt_silvic_atv_cobe t order by t.id"); foreach (var item in daReader) { lst.Add(new Lista() { Id = item["id"].ToString(), Texto = Convert.ToString(item["texto"]), IsAtivo = true }); } return(lst); }
internal List <Lista> ObterDestinacaoMaterial() { List <Lista> lst = new List <Lista>(); IEnumerable <IDataReader> daReader = DaHelper.ObterLista(@"select t.id, t.texto from lov_crt_inf_corte_inf_dest_mat t order by t.texto"); foreach (var item in daReader) { lst.Add(new Lista() { Id = item["id"].ToString(), Texto = Convert.ToString(item["texto"]), IsAtivo = true }); } return(lst); }
internal List <ListaValor> ObterRegistroAtividadeFlorestalUnidade() { List <ListaValor> lst = new List <ListaValor>(); IEnumerable <IDataReader> daReader = DaHelper.ObterLista(@" select l.id, l.sigla texto from lov_crt_reg_ati_flo_unidade l order by l.sigla"); foreach (var item in daReader) { lst.Add(new ListaValor() { Id = Convert.ToInt32(item["id"]), Texto = Convert.ToString(item["texto"]), IsAtivo = true }); } return(lst); }
internal List <Lista> ObterBeneficiamentoMadeiraMateriaPrimaConsumida() { List <Lista> lst = new List <Lista>(); IEnumerable <IDataReader> daReader = DaHelper.ObterLista(@"select t.id, t.texto from lov_crt_benef_madeira_mat_pr_c t order by t.id"); foreach (var item in daReader) { lst.Add(new Lista() { Id = item["id"].ToString(), Texto = Convert.ToString(item["texto"]), IsAtivo = true }); } return(lst); }
internal List <Lista> ObterAviculturaConfinamentoFinalidades() { List <Lista> lst = new List <Lista>(); IEnumerable <IDataReader> daReader = DaHelper.ObterLista(@"select t.id, t.texto from lov_crt_avicultura_finalid t order by t.id"); foreach (var item in daReader) { lst.Add(new Lista() { Id = item["id"].ToString(), Texto = Convert.ToString(item["texto"]), IsAtivo = true }); } return(lst); }
internal List <Lista> ObterProducaoCarvaoVegetalMateriaPrimaConsumida() { List <Lista> lst = new List <Lista>(); IEnumerable <IDataReader> daReader = DaHelper.ObterLista(@"select t.id, t.texto from lov_crt_prod_carv_veg_mat_pr_c t order by t.id"); foreach (var item in daReader) { lst.Add(new Lista() { Id = item["id"].ToString(), Texto = Convert.ToString(item["texto"]), IsAtivo = true }); } return(lst); }
internal List <FinalidadeExploracao> ObterExploracaoFlorestalFinalidadeExploracao() { List <FinalidadeExploracao> lst = new List <FinalidadeExploracao>(); IEnumerable <IDataReader> daReader = DaHelper.ObterLista(@"select t.id, t.texto, t.codigo from lov_crt_exp_flores_finalidade t order by t.id"); foreach (var item in daReader) { lst.Add(new FinalidadeExploracao() { Id = Convert.ToInt32(item["id"]), Texto = Convert.ToString(item["texto"]), Codigo = Convert.ToInt32(item["codigo"]), IsAtivo = true }); } return(lst); }
internal List <Lista> ObterFormaColetaPonto() { List <Lista> lst = new List <Lista>(); IEnumerable <IDataReader> daReader = DaHelper.ObterLista(@"select c.id, c.texto from lov_empreendimento_forma_colet c order by c.id"); foreach (var item in daReader) { lst.Add(new Lista() { Id = item["id"].ToString(), Texto = item["texto"].ToString(), IsAtivo = true }); } return(lst); }
internal List <Lista> ObterBarragemDispensaLicencaFormacaoRT() { List <Lista> lst = new List <Lista>(); IEnumerable <IDataReader> daReader = DaHelper.ObterLista(@"select t.id, t.texto, t.codigo from lov_crt_bdla_formacao_rt t order by t.id"); foreach (var item in daReader) { lst.Add(new Lista() { Id = item["id"].ToString(), Texto = Convert.ToString(item["texto"]), Codigo = item["codigo"].ToString(), IsAtivo = true }); } return(lst); }
internal List <Lista> ObterDscLicAtvDestinoFinal() { List <Lista> lst = new List <Lista>(); IEnumerable <IDataReader> daReader = DaHelper.ObterLista("select t.id, t.texto, t.codigo from lov_crt_dsc_lc_atv_dt_final t order by t.id"); foreach (var item in daReader) { lst.Add(new Lista() { Id = item["id"].ToString(), Texto = item["texto"].ToString(), IsAtivo = true, Codigo = item["codigo"].ToString() }); } return(lst); }