コード例 #1
0
ファイル: PriceQuery.cs プロジェクト: joeiren/smarths
        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);
        }
コード例 #2
0
ファイル: PriceQuery.cs プロジェクト: joeiren/smarths
        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);
        }
コード例 #3
0
ファイル: PriceQuery.cs プロジェクト: joeiren/smarths
        public int QueryMonitorsCountBy(FoodMonitor entity)
        {
            PriceService.PriceClient client = new PriceClient();
            var count = client.GetFoodMonitorsCounts(entity);

            return(count);
        }
コード例 #4
0
ファイル: PriceQuery.cs プロジェクト: joeiren/smarths
        public string[] QueryAllCategorys()
        {
            PriceService.PriceClient client = new PriceClient();
            var categorys = client.GetCategorys();

            return(categorys);
        }
コード例 #5
0
ファイル: PriceQuery.cs プロジェクト: joeiren/smarths
        public IEnumerable <KeyValuePair <string, string> > QueryAllMonitorSites()
        {
            PriceService.PriceClient client = new PriceClient();
            var sites = client.GetMonitorSites();

            return(sites);
        }
コード例 #6
0
ファイル: PriceQuery.cs プロジェクト: joeiren/smarths
        //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);
        }
コード例 #7
0
        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));
        }
コード例 #8
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);
        }
コード例 #9
0
ファイル: PriceQuery.cs プロジェクト: joeiren/smarths
 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;
     }
 }
コード例 #10
0
        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);
        }
コード例 #11
0
ファイル: PriceDownloadUtils.cs プロジェクト: Zelfrom/Mtgdb
        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));
        }
コード例 #12
0
        public static PriceClient CreatePriceClientWithUri(this CommerceClients source, string serviceUrl)
        {
            var client = new PriceClient(new Uri(serviceUrl), source.CreateMessageProcessingHandler());

            return(client);
        }
コード例 #13
0
 public static PriceClient CreatePriceClient(this CommerceClients source, string serviceUrl, string appId, string secretKey)
 {
     var client = new PriceClient(new Uri(serviceUrl), appId, secretKey);
     return client;
 }
コード例 #14
0
 public static PriceClient CreatePriceClientWithUri(this CommerceClients source, string serviceUrl)
 {
     var client = new PriceClient(new Uri(serviceUrl), source.CreateMessageProcessingHandler());
     return client;
 }
コード例 #15
0
        public static PriceClient CreatePriceClient(this CommerceClients source, string serviceUrl, string appId, string secretKey)
        {
            var client = new PriceClient(new Uri(serviceUrl), appId, secretKey);

            return(client);
        }