public string TestarBuscarAvisosParaUsuariosDoHomeBroker(string pCBLC) { BuscarAvisosParaUsuariosDoHomebrokerRequest lRequest = new BuscarAvisosParaUsuariosDoHomebrokerRequest(); BuscarAvisosParaUsuariosDoHomebrokerResponse lResponse; lRequest.CBLC = pCBLC; lRequest.BuscarSomenteAvisosAtivos = true; lResponse = BuscarAvisosParaUsuariosDoHomeBroker(lRequest); return(string.Format("[{0}] avisos encontrados para o CBLC [{1}]", lResponse.Avisos.Count, pCBLC)); }
public BuscarAvisosParaUsuariosDoHomebrokerResponse BuscarAvisosParaUsuariosDoHomeBroker(BuscarAvisosParaUsuariosDoHomebrokerRequest pRequest) { BuscarAvisosParaUsuariosDoHomebrokerResponse lResponse = new BuscarAvisosParaUsuariosDoHomebrokerResponse(); try { ServicoHostColecao.Default.CarregarConfig("Desenvolvimento"); ConsultarEntidadeRequest <AvisoHomeBrokerInfo> lRequestAviso = new ConsultarEntidadeRequest <AvisoHomeBrokerInfo>(); ConsultarObjetosResponse <AvisoHomeBrokerInfo> lResponseAviso; lRequestAviso.Objeto = new AvisoHomeBrokerInfo(); lRequestAviso.Objeto.IdSistema = pRequest.IdSistema; lResponseAviso = Gradual.Intranet.Servicos.BancoDeDados.Persistencias.ClienteDbLib.ConsultarAvisosHomeBroker(lRequestAviso); if (pRequest.BuscarSomenteAvisosAtivos) { lResponse.Avisos = new List <AvisoHomeBrokerInfo>(); foreach (AvisoHomeBrokerInfo lAviso in lResponseAviso.Resultado) { if ((lAviso.DtEntrada <= DateTime.Now && DateTime.Now <= lAviso.DtSaida) || lAviso.StAtivacaoManual == "S") { if (string.IsNullOrEmpty(lAviso.DsCBLCs) || lAviso.ContemCBLC(pRequest.CBLC)) { lResponse.Avisos.Add(lAviso); } } } } else { lResponse.Avisos = lResponseAviso.Resultado; } //lResponse.TextoDoContrato = System.Text.UTF8Encoding.UTF8.GetString(lResponseArquivo.Objeto.Arquivo); lResponse.StatusResposta = "OK"; } catch (Exception ex) { lResponse.StatusResposta = "ERRO"; lResponse.DescricaoResposta = string.Format("{0}\r\n\r\n{1}", ex.Message, ex.StackTrace); } return(lResponse); }