public List <Entidades.Cadastral.ResponseSearchTelefonePF> PesquisaSearchPF(Entidades.Cadastral.FiltroPesquisaSearchTelefonePF filtro) { try { List <Entidades.Cadastral.ResponseSearchTelefonePF> listRet = new List <Entidades.Cadastral.ResponseSearchTelefonePF>(); DataSet ds = new DataSet(); Dados.Cadastral.WS.RastreamentoSearchTelefonePF neg = new Dados.Cadastral.WS.RastreamentoSearchTelefonePF(); neg.PesquisaSearchTelefonePF(filtro, ref ds); if (ds != null && ds.Tables.Count > 0) { // Tabela 1 -> Resultado foreach (DataRow dr in ds.Tables[0].Rows) { Entidades.Cadastral.ResponseSearchTelefonePF retResponse = new Entidades.Cadastral.ResponseSearchTelefonePF(); retResponse.CPF = dr["CPF"].ToString(); retResponse.Nome = dr["NOME"].ToString(); retResponse.DataNascimento = dr["DATA_NASCIMENTO"].ToString(); retResponse.NomeMae = dr["NOME_MAE"].ToString(); listRet.Add(retResponse); } if (ds.Tables[0].Rows.Count == 0) { return(null); } else { return(listRet); } } return(null); } catch (Exception ex) { throw ex; } }
public void PesquisaSearchTelefonePF(Entidades.Cadastral.FiltroPesquisaSearchTelefonePF filtro, ref DataSet oDS) { try { ConexaoPersonalizada oConn = new ConexaoPersonalizada(); try { OracleParameter[] arParms = new OracleParameter[3]; arParms[0] = new OracleParameter(); arParms[0].ParameterName = "P_DDD"; arParms[0].OracleDbType = OracleDbType.Varchar2; arParms[0].Direction = ParameterDirection.Input; arParms[0].Value = filtro.DDD; arParms[1] = new OracleParameter(); arParms[1].ParameterName = "P_TEL"; arParms[1].OracleDbType = OracleDbType.Varchar2; arParms[1].Direction = ParameterDirection.Input; arParms[1].Value = filtro.NumeroTel; arParms[2] = new OracleParameter(); arParms[2].ParameterName = "R_CURSOR"; arParms[2].OracleDbType = OracleDbType.RefCursor; arParms[2].Direction = ParameterDirection.Output; oConn.Execute("DNAINFO.P_L_WS_RASTREA_SEARCH_TEL_PF", arParms, ref oDS); } catch (Exception ex) { throw ex; } finally { oConn.CloseConnection(); oConn = null; } } catch (Exception ex) { throw ex; } }
private void Consultar() { try { string HTMLRetornado = string.Empty; lblMensagemRetorno.Text = ""; lblMensagemRetorno.Visible = false; divEspacoBranco.Visible = false; divResultado.Visible = false; divImprimirMensagemErro.Attributes.Add("style", "display:none;"); Negocios.Cadastral.WEB.RastreamentoSearchTelefonePF n = new Negocios.Cadastral.WEB.RastreamentoSearchTelefonePF(); List <Entidades.Cadastral.ResponseSearchTelefonePF> listRet = new List <Entidades.Cadastral.ResponseSearchTelefonePF>(); Entidades.Cadastral.FiltroPesquisaSearchTelefonePF filtro = new Entidades.Cadastral.FiltroPesquisaSearchTelefonePF(); filtro.DDD = txtDDD.Text.Trim(); filtro.NumeroTel = txtTelefone.Text.Trim().Replace("-", ""); listRet = n.PesquisaSearchPF(filtro); if (listRet != null) { divResultado.Visible = true; if (listRet.Count > 0) { gridResult.DataSource = listRet; gridResult.DataBind(); Util.Format.OcultaColunaEspecificaGrid(ref gridResult, 4); Util.Format.OcultaColunaEspecificaGrid(ref gridResult, 5); Util.Format.OcultaColunaEspecificaGrid(ref gridResult, 6); Util.Format.OcultaColunaEspecificaGrid(ref gridResult, 7); } else { gridResult.DataSource = null; gridResult.EmptyDataText = "NENHUM REGISTRO ENCONTRADO."; gridResult.DataBind(); } //Transformando o Retorno em XML para gravar no banco var xns = new XmlSerializerNamespaces(); xns.Add(string.Empty, string.Empty); var xs = new XmlSerializer(listRet.GetType()); var xml = new StringWriter(); xs.Serialize(xml, listRet, xns); HTMLRetornado = xml.ToString(); string parametrosPesquisado = "(" + filtro.DDD + ") " + filtro.NumeroTel; string NomeInternoProduto = "WEB RASTREAMENTO SEARCH TELEFONE PF"; Entidades.HistoricoPesquisa hist = SalvarHistoricoPesquisa("S", codigoItemProduto, "", parametrosPesquisado, "TELEFONE"); SalvarHistoricoFornecedor("S", hist.IdHistoricoConsulta, xml.ToString(), NomeInternoProduto, "DNA"); lblDataConsulta.Text = DataBR.ToString("dd/MM/yyyy") + " às " + DataBR.ToString("HH:mm"); lblNumeroConsulta.Text = hist.IdHistoricoConsulta.ToString().PadLeft(5, '0'); } else { lblMensagemRetorno.Visible = true; lblMensagemRetorno.Text = ""; lblMensagemRetorno.Text = "NENHUM REGISTRO ENCONTRADO.<br/><br/>"; string mensagemExibir = "<span id='lblTexto30DiasTexto1' class='texto' style='display:inline-block;font-weight:normal'>"; //mensagemExibir += ddlFiltro.Value.Trim().ToUpper() + ": <b>" + txtParametroInformado.Text + "</b>"; mensagemExibir += " </span><br/><br/>"; lblMensagemRetorno.Text += mensagemExibir; //divImprimirMensagemErro.Attributes.Add("style", "display:block;"); divEspacoBranco.Visible = true; divResultado.Visible = false; LimparCampos(); string parametrosPesquisado = "(" + filtro.DDD + ") " + filtro.NumeroTel; string NomeInternoProduto = "WEB RASTREAMENTO SEARCH TELEFONE PF"; Entidades.HistoricoPesquisa hist = SalvarHistoricoPesquisa("N", codigoItemProduto, "", parametrosPesquisado, "TELEFONE"); SalvarHistoricoFornecedor("N", hist.IdHistoricoConsulta, "CNENHUM REGISTRO ENCONTRADO.", NomeInternoProduto, "DNA"); lblDataConsulta.Text = DataBR.ToString("dd/MM/yyyy") + " às " + DataBR.ToString("HH:mm"); lblNumeroConsulta.Text = hist.IdHistoricoConsulta.ToString().PadLeft(5, '0'); //Page.ClientScript.RegisterStartupScript(this.GetType(), "Mensagem", "<script>alert('Veículo não encontrado.')</script>", false); } } catch (Exception ex) { Util.Log.Save("ex:" + ex.Message, "Consultar", "ConsultaWebRastreamentoSearchTelefonePF", HttpContext.Current.Server.MapPath(diretorioLog)); throw ex; } }