internal LsFuncao Listar() { try { var m_oFuncao = new LsFuncao(); sbSQL.Length = 0; sbSQL.Append("SELECT DSAPLDFUNC, IDPRO031, IDPRO039, IDPRO042, NMFUNC, IDPRO018"); sbSQL.Append(" FROM TBPRO031"); oAdapter = ObterDataAdapter(sbSQL.ToString()); ITableMapping objMapping = oAdapter.TableMappings.Add("Table", LsFuncao.tbFuncao); objMapping.ColumnMappings.Add("DSAPLDFUNC", LsFuncao.cpApelido); objMapping.ColumnMappings.Add("IDPRO031", LsFuncao.cpCodigo); objMapping.ColumnMappings.Add("IDPRO039", LsFuncao.cpCodigoMenu); objMapping.ColumnMappings.Add("IDPRO042", LsFuncao.cpCodigoClasse); objMapping.ColumnMappings.Add("NMFUNC", LsFuncao.cpNome); objMapping.ColumnMappings.Add("IDPRO018", LsFuncao.cpCodigoProjeto); oAdapter.Fill(m_oFuncao); return m_oFuncao; } catch (Exception ex) { throw new Dor.Util.OperacaoInvalidaBD(ex); } }
internal LsFuncao ListarDisponivel(long v_iPerfil) { try { LsFuncao m_oFuncao = new LsFuncao(); sbSQL.Length = 0; // //seleciona todas as funcoes de um projeto qq que ainda não tenham sido atribuída a nenhum perfil // sbSQL.Append("SELECT DSAPLDFUNC, Funcao.IDPRO031, Funcao.IDPRO039, IDPRO042, NMFUNC, Funcao.IDPRO018"); sbSQL.Append(" FROM TBPRO031 Funcao"); sbSQL.Append(" WHERE Funcao.IDPRO031 NOT IN (SELECT IDPRO031 FROM TBPRO033 WHERE IDPRO016 =: IDPRO016)"); sbSQL.Append(" ORDER BY NMFUNC"); sbSQL = TratarSQLParametroBanco(sbSQL.ToString()); oAdapter = ObterDataAdapter(sbSQL.ToString()); UtDbNet.AdicionarParametro(oAdapter, "IDPRO016", v_iPerfil); ITableMapping objMapping = oAdapter.TableMappings.Add("Table", LsFuncao.tbFuncao); objMapping.ColumnMappings.Add("DSAPLDFUNC", LsFuncao.cpApelido); objMapping.ColumnMappings.Add("IDPRO031", LsFuncao.cpCodigo); objMapping.ColumnMappings.Add("IDPRO039", LsFuncao.cpCodigoMenu); objMapping.ColumnMappings.Add("IDPRO042", LsFuncao.cpCodigoClasse); objMapping.ColumnMappings.Add("NMFUNC", LsFuncao.cpNome); objMapping.ColumnMappings.Add("IDPRO018", LsFuncao.cpCodigoProjeto); oAdapter.Fill(m_oFuncao); return m_oFuncao; } catch (Exception ex) { throw new Dor.Util.OperacaoInvalidaBD(ex); } }