public string readAllProductos() { ProductosCollection p = new ProductosCollection(); string xml = Util.Serializar <List <Producto> >(p.getAll()); return(xml); }
public string readAllProductosByTipo(string val) { ProductosCollection pc = new ProductosCollection(); List <Producto> lpc = pc.getAllByTipo(int.Parse(val)); string xml = Util.Serializar <List <Producto> >(lpc); return(xml); }
private void cbTipoProducto_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (cbTipoProducto.SelectedValue != null) { int val = int.Parse(cbTipoProducto.SelectedValue.ToString()); ProductosCollection fpc = new ProductosCollection(); string xml = _servicio.readAllProductosByTipo(val.ToString()); List <Producto> lfp = Util.Deserializar <List <Producto> >(xml); cbProducto.ItemsSource = lfp; cbProducto.SelectedValuePath = "Id"; } }