//public void Query() //{ // try // { // PriceService.PriceClient client = new PriceService.PriceClient(); // var foods = client.GetFoods(); // var rfoods = foods.Where(it => !string.IsNullOrEmpty(it.Value)).ToList(); // var foodNames = client.GetFoodName(); // var categ = client.GetCategorys(); // var tables = client.GetTableNames(); // var dd = client.GetMonitorSites(); // PriceService.FoodMonitor monitor = new FoodMonitor(); // monitor.FoodID = foods[0].Key; // monitor.FoodName = foods[0].Value; // var result = client.FindFoodMonitors(null, null, true, 50, 0); // } // catch (Exception ex) // { // LogHelper.GetInstance().Error(ex.ToString()); // return; // } //} public IEnumerable <KeyValuePair <string, string> > QueryAllFoods() { PriceService.PriceClient client = new PriceClient(); var foods = client.GetFoodName(); return(foods); }
public IEnumerable <KeyValuePair <string, string> > QueryFoodsByCategory(string category) { PriceService.PriceClient client = new PriceClient(); var list = client.GetFoodName().Where(it => it.Value == category).ToList(); return(list); }
public void Query() { try { PriceService.PriceClient client = new PriceClient(); var foods = client.GetFoods(); var rfoods = foods.Where(it => !string.IsNullOrEmpty(it.Value)).ToList(); var foodNames = client.GetFoodName(); var categ = client.GetCategorys(); var tables = client.GetTableNames(); var dd = client.GetMonitorSites(); PriceService.FoodMonitor monitor = new FoodMonitor(); monitor.FoodID = foods[0].Key; monitor.FoodName = foods[0].Value; var result = client.FindFoodMonitors(null, null, true, 50, 0); } catch (Exception ex) { LogHelper.GetInstance().Error(ex.ToString()); return; } }