public IEnumerable <FoodMonitor> QueryFoodMonitorsByPage(FoodMonitor condition, int pageSize, int pageNo) { PriceService.PriceClient client = new PriceClient(); var result = client.FindFoodMonitors(condition, "FoodName", true, pageSize, Math.Max(0, pageNo - 1)); return(result); }
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 int QueryMonitorsCountBy(FoodMonitor entity) { PriceService.PriceClient client = new PriceClient(); var count = client.GetFoodMonitorsCounts(entity); return(count); }
public string[] QueryAllCategorys() { PriceService.PriceClient client = new PriceClient(); var categorys = client.GetCategorys(); return(categorys); }
public IEnumerable <KeyValuePair <string, string> > QueryAllMonitorSites() { PriceService.PriceClient client = new PriceClient(); var sites = client.GetMonitorSites(); return(sites); }
//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 void GetPrice(string setCode, string number) { var client = new PriceClient(); var sid = client.DownloadSid(setCode, number); Assert.That(sid, Is.Not.Null); var result = client.DownloadPrice(sid); Assert.That(result, Is.Not.Null); Assert.That(result.Mid, Is.Not.Null); Assert.That(result.Mid.Value, Is.GreaterThan(0)); }
private CommerceService() { this._listClient = ClientContext.Clients.CreateListClient(); this._browseClient = ClientContext.Clients.CreateBrowseClient(); this._storeClient = ClientContext.Clients.CreateStoreClient(); this._cartClient = ClientContext.Clients.CreateCartClient(); this._orderClient = ClientContext.Clients.CreateOrderClient(); this._priceClient = ClientContext.Clients.CreatePriceClient(); this._marketingClient = ClientContext.Clients.CreateMarketingClient(); this._themeClient = ClientContext.Clients.CreateThemeClient(); this._reviewsClient = ClientContext.Clients.CreateReviewsClient(); _themesCacheStoragePath = ConfigurationManager.AppSettings["ThemeCacheFolder"]; this._viewLocator = new FileThemeViewLocator(_themesCacheStoragePath); this._cartHelper = new CartHelper(this); }
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; } }
public CommerceService() { this._listClient = ClientContext.Clients.CreateListClient(); this._browseClient = ClientContext.Clients.CreateBrowseClient(); this._storeClient = ClientContext.Clients.CreateStoreClient(); this._cartClient = ClientContext.Clients.CreateCartClient(); this._orderClient = ClientContext.Clients.CreateOrderClient(); this._securityClient = ClientContext.Clients.CreateSecurityClient(); this._priceClient = ClientContext.Clients.CreatePriceClient(); this._marketingClient = ClientContext.Clients.CreateMarketingClient(); this._inventoryClient = ClientContext.Clients.CreateInventoryClient(); this._themeClient = ClientContext.Clients.CreateThemeClient(); this._pageClient = ClientContext.Clients.CreatePageClient(); this._reviewsClient = ClientContext.Clients.CreateReviewsClient(); _themesCacheStoragePath = ConfigurationManager.AppSettings["ThemeCacheFolder"]; _pagesCacheStoragePath = ConfigurationManager.AppSettings["PageCacheFolder"]; this._viewLocator = new FileThemeViewLocator(HostingEnvironment.MapPath(_themesCacheStoragePath)); this._cartHelper = new CartHelper(this); }
public void GetPrice(string setCode, string name) { LoadCards(); var card = Repo.SetsByCode[setCode].CardsByName[name].First(); var client = new PriceClient(); var sid = client.DownloadSid(card); Assert.That(sid, Is.Not.Null); var result = client.DownloadPrice(sid.Sid); Assert.That(result, Is.Not.Null); Assert.That(result.Mid, Is.Not.Null); Assert.That(result.Mid.Value, Is.GreaterThan(0)); Assert.That(result.Low, Is.Not.Null); Assert.That(result.Low.Value, Is.GreaterThan(0)); Assert.That(result.High, Is.Not.Null); Assert.That(result.High.Value, Is.GreaterThan(0)); }
public static PriceClient CreatePriceClientWithUri(this CommerceClients source, string serviceUrl) { var client = new PriceClient(new Uri(serviceUrl), source.CreateMessageProcessingHandler()); return(client); }
public static PriceClient CreatePriceClient(this CommerceClients source, string serviceUrl, string appId, string secretKey) { var client = new PriceClient(new Uri(serviceUrl), appId, secretKey); return client; }
public static PriceClient CreatePriceClientWithUri(this CommerceClients source, string serviceUrl) { var client = new PriceClient(new Uri(serviceUrl), source.CreateMessageProcessingHandler()); return client; }
public static PriceClient CreatePriceClient(this CommerceClients source, string serviceUrl, string appId, string secretKey) { var client = new PriceClient(new Uri(serviceUrl), appId, secretKey); return(client); }