ASP.NET - Ayuda con Webservice que no me muestra datos

 
Vista:

Ayuda con Webservice que no me muestra datos

Publicado por Hubert Garcia (1 intervención) el 22/08/2012 07:01:29
Buenas noches, tengo un problema con este código, esta escrito en VS 2008 no tiene errores, sin embargo no me muestra el resultado, mucho les agradezco si me pueden ayudar.



namespace proyecto
{

public partial class _Default : System.Web.UI.Page
{


protected void buscarID_Click(object sender, EventArgs e)
{
obtenerResultado();
}

protected void btnlimpiar_Click(object sender, EventArgs e)
{
Limpia_campos();
}

public void Limpia_campos()
{
txtCompra.Text = " ";
txtVenta.Text = " ";
txtError.Text = " ";
txtFecha.Text = " ";

}

private void obtenerResultado()
{
string compradia = null;
string ventadia = null;
string fecha = null;
compradia = txtCompra.Text;
ventadia = txtVenta.Text;
fecha = txtFecha.Text;
txtFecha.Text = Convert.ToString(fecha);

if (txtFecha.Text == "")
{
txtError.Text = "El campo fecha no debe estar vacio.";
}
else
{
try
{


wsIndicadoresEconomicos compra = new wsIndicadoresEconomicos();

compra.ObtenerIndicadoresEconomicosXMLCompleted += new ObtenerIndicadoresEconomicosXMLCompletedEventHandler(venta_ObtenerIndicadoresEconomicosXMLCompleted);

compra.ObtenerIndicadoresEconomicosXML("317", fecha, fecha, "proyecto", "N");


wsIndicadoresEconomicos venta = new wsIndicadoresEconomicos();

venta.ObtenerIndicadoresEconomicosXMLCompleted += new ObtenerIndicadoresEconomicosXMLCompletedEventHandler(venta_ObtenerIndicadoresEconomicosXMLCompleted);

venta.ObtenerIndicadoresEconomicosXML("318", fecha, fecha, "Proyecto", "N");


}

catch (Exception ex)
{
txtError.Text = ex.Message;
}
}

}

void venta_ObtenerIndicadoresEconomicosXMLCompleted(object sender,ObtenerIndicadoresEconomicosXMLCompletedEventArgs e)
{
if (e.Error == null )
{
XDocument xdoc = XDocument.Parse(e.Result);
string resultado = xdoc.Descendants("INGC011_CAT_INDICADORECONOMIC").Descendants("NUM_VALOR").FirstOrDefault().Value;
txtVenta.Text = resultado.Remove(5);
}
}

void compra_ObtenerIndicadoresEconomicosXMLCompleted(object sender,ObtenerIndicadoresEconomicosXMLCompletedEventArgs e)
{

if (e.Error == null)
{

XDocument xdoc = XDocument.Parse(e.Result);
string resultado = xdoc.Descendants("INGC011_CAT_INDICADORECONOMIC").Descendants("NUM_VALOR").FirstOrDefault().Value;
txtCompra.Text = resultado.Remove(5);
}
}

}
}
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder