Ejemplo n.º 1
0
 public Product[] ProductSearch(Session session, string search)
 {
   if (session.Value == "N/A")
   {
     return specials.Where(s => s.EANBarcode == search || s.Name.Contains(search)).ToArray();
   }
   else
   {
     var client = new Tesco.SOAPServiceSoapClient();
     int pageCount, prodCount;
     Tesco.Product[] products;
     client.ProductSearch(sessions[session.Value], search, false, 1, out products, out pageCount, out prodCount);
     return
       (specials
         .Where(s => s.EANBarcode == search || s.Name.Contains(search))
         .Concat(products.Select(p =>
           new Product
           {
             EANBarcode = p.EANBarcode,
             ImagePath = p.ImagePath,
             Name = p.Name,
             Price = p.Price
           }))).ToArray();
   }
 }
Ejemplo n.º 2
0
 public Product[] ProductSearch(Session session, string search)
 {
   return specials.Where(s => s.EANBarcode == search || s.Name.Contains(search)).ToArray();
 }