Beispiel #1
0
        public WeixinResult Update()
        {
            string url    = WeUtil.GetUrl(WeShopConst.UPDATE_SHELF_URL);
            var    reuslt = WeUtil.PostToUri(url, this.WriteJson(), new WeixinResult());

            return(reuslt);
        }
Beispiel #2
0
        public WeThirdPartyGetAgentResponse get_agent()
        {
            string url    = WeCorpUtil.GetCorpUrl(WeThirdPartyConst.GET_AGENT, WeixinSettings.Current.CorpUserManagerSecret);
            var    result = WeUtil.PostToUri(url, this.WriteJson(), new WeThirdPartyGetAgentResponse());

            return(result);
        }
Beispiel #3
0
        public WeixinResult Update()
        {
            string url = WeCorpUtil.GetCorpUrl(WeCorpConst.UPDATE_DEPARTMENT,
                                               WeixinSettings.Current.CorpUserManagerSecret);

            return(WeUtil.PostToUri(url, this.WriteJson(WeConst.WRITE_SETTINGS), new WeixinResult()));
        }
Beispiel #4
0
        public long Send()
        {
            string url = WeUtil.GetUrl(WeConst.GROUP_MASS_MESSAGE_URL);
            var    msg = WeUtil.PostToUri(url, this.WriteJson(), new MassMessageResult());

            return(msg.ResultId);
        }
Beispiel #5
0
        public static WeServer <T> Query <T>(string query, string category, float latitude, float longitude)
        {
            WeSemanticRequest request = new WeSemanticRequest(query, category, latitude, longitude);
            WeServer <T>      result  = WeUtil.PostToUri(url, request.WriteJson(), new WeServer <T>());

            return(result);
        }
Beispiel #6
0
        public WeixinResult UpdateProducts(IEnumerable <string> insertProducts, IEnumerable <string> deleteProducts)
        {
            WeGroupProductActionList request = new WeGroupProductActionList
            {
                GroupId = GroupId
            };

            if (insertProducts != null)
            {
                var added = from item in insertProducts
                            select new WeGroupProductAction(item, GroupAction.Add);
                request.Product.AddRange(added);
            }

            if (deleteProducts != null)
            {
                var deleted = from item in deleteProducts
                              select new WeGroupProductAction(item, GroupAction.Remove);
                request.Product.AddRange(deleted);
            }

            string url    = WeUtil.GetUrl(WeShopConst.UPDATE_GROUP_PRODUCT_URL);
            var    result = WeUtil.PostToUri(url, request.WriteJson(), new WeixinResult());

            FetchDetail();
            return(result);
        }
Beispiel #7
0
        public WeixinResult Reduce()
        {
            string url    = WeUtil.GetUrl(WeShopConst.REDUCE_STOCK_URL);
            var    result = WeUtil.PostToUri(url, this.WriteJson(), new WeixinResult());

            return(result);
        }
Beispiel #8
0
        public WeixinResult Update()
        {
            string url = WeUtil.GetUrl(WeConst.REMARK_URL);

            return(WeUtil.PostToUri(url, this.WriteJson(WeConst.WRITE_SETTINGS),
                                    new WeixinResult()));
        }
Beispiel #9
0
        public static WeixinResult Delete(long msgId)
        {
            MassMessageResult msg = new MassMessageResult(msgId);
            string            url = WeUtil.GetUrl(WeConst.DELETE_MASS_MESSAGE_URL);

            return(WeUtil.PostToUri(url, msg.WriteJson(), new WeixinResult()));
        }
Beispiel #10
0
        private WeixinResult InternalCreateMenu(string url)
        {
            string       json   = ToJson();
            WeixinResult result = new WeixinResult();

            return(WeUtil.PostToUri(url, json, result));
        }
Beispiel #11
0
        public MediaId UploadMessage()
        {
            string url     = WeUtil.GetUrl(WeConst.NEWS_MASS_URL);
            var    mediaId = WeUtil.PostToUri(url, this.WriteJson(), new MediaId());

            return(mediaId);
        }
Beispiel #12
0
        public static WeShelf Query(int shelfId)
        {
            string    url     = WeUtil.GetUrl(WeShopConst.SHELF_ID_URL);
            WeShelfId request = new WeShelfId(shelfId);
            var       result  = WeUtil.PostToUri(url, request.WriteJson(), new WeShelfInfo());

            return((WeShelf)result);
        }
Beispiel #13
0
        public static IEnumerable <WeProduct> Query(ProductStatus status)
        {
            string          url     = WeUtil.GetUrl(WeShopConst.PRODUCT_STATUS_URL);
            WeProductStatus request = new WeProductStatus(status);
            var             result  = WeUtil.PostToUri(url, request.WriteJson(), new WeProductList());

            return(result.ProductsInfo);
        }
Beispiel #14
0
        public WeShelf Insert()
        {
            string url    = WeUtil.GetUrl(WeShopConst.ADD_SHELF_URL);
            var    result = WeUtil.PostToUri(url, this.WriteJson(), new WeShelfId());

            ShelfId = result.ShelfId;
            return(this);
        }
Beispiel #15
0
        public static WeCardBatch CardBatchGet(int offset, int count)
        {
            string             url     = WeUtil.GetUrl(WeCardConst.CARD_BATCH_GET);
            WeLocationBatchGet request = new WeLocationBatchGet(offset, count);
            var result = WeUtil.PostToUri(url, request.WriteJson(), new WeCardBatch());

            return(result);
        }
Beispiel #16
0
        public static WeixinResult Delete(int groupId)
        {
            string    url    = WeUtil.GetUrl(WeShopConst.DELETE_GROUP_URL);
            WeGroupId id     = new WeGroupId(groupId);
            var       result = WeUtil.PostToUri(url, id.WriteJson(), new WeixinResult());

            return(result);
        }
Beispiel #17
0
        public static WeMerchantGroup Query(int groupId)
        {
            string    url     = WeUtil.GetUrl(WeShopConst.GROUP_ID_URL);
            WeGroupId request = new WeGroupId(groupId);
            var       result  = WeUtil.PostToUri(url, request.WriteJson(), new WeMerchantGroupFetchData());

            return(result.GroupDetail);
        }
Beispiel #18
0
        public WeProduct Insert()
        {
            string url    = WeUtil.GetUrl(WeShopConst.ADD_PRODUCT_URL);
            var    result = WeUtil.PostToUri(url, this.WriteJson(), new WeProductId());

            ProductId = result.ProductId;
            return(this);
        }
Beispiel #19
0
        public string CardCreate()
        {
            string url     = WeUtil.GetUrl(WeCardConst.CARD_CREATE);
            WeCard request = new WeCard(this);
            var    result  = WeUtil.PostToUri(url, request.WriteJson(), new WeCardId());

            return(result.CardId);
        }
Beispiel #20
0
        public static WeixinResult Delete(int shelfId)
        {
            string    url     = WeUtil.GetUrl(WeShopConst.DELETE_SHELF_URL);
            WeShelfId request = new WeShelfId(shelfId);
            var       result  = WeUtil.PostToUri(url, request.WriteJson(), new WeixinResult());

            return(result);
        }
Beispiel #21
0
        public WeixinResult Update()
        {
            string       url    = WeUtil.GetUrl(WeConst.UPDATE_GROUP);
            WeGroupData  data   = new WeGroupData(this);
            WeixinResult result = new WeixinResult();

            return(WeUtil.PostToUri(url, data.WriteJson(WeConst.WRITE_SETTINGS), result));
        }
Beispiel #22
0
        public static WeDeliveryTemplate Query(long templateId)
        {
            WeTemplateId request  = new WeTemplateId(templateId);
            string       url      = WeUtil.GetUrl(WeShopConst.TEMPLATE_ID_URL);
            var          response = WeUtil.PostToUri(url, request.WriteJson(), new WeTemplateInfo());

            return(response.TemplateInfo);
        }
Beispiel #23
0
        public static WeixinResult Delete(long templateId)
        {
            string       url     = WeUtil.GetUrl(WeShopConst.DELETE_TEMPLATE_URL);
            WeTemplateId request = new WeTemplateId(templateId);
            var          result  = WeUtil.PostToUri(url, request.WriteJson(), new WeixinResult());

            return(result);
        }
Beispiel #24
0
        public static WeProduct Query(string productId)
        {
            TkDebug.AssertArgumentNullOrEmpty(productId, "productId", null);
            string      url     = WeUtil.GetUrl(WeShopConst.QUERY_PRODUCT_URL);
            WeProductId request = new WeProductId(productId);
            var         result  = WeUtil.PostToUri(url, request.WriteJson(), new WeProduct());

            return(result);
        }
Beispiel #25
0
        public static WeixinResult UpdateStatus(string productId, ProductStatus status)
        {
            TkDebug.AssertArgumentNullOrEmpty(productId, "productId", null);
            string             url     = WeUtil.GetUrl(WeShopConst.PRODUCT_SHELF_URL);
            WeProductModStatus request = new WeProductModStatus(status, productId);
            var result = WeUtil.PostToUri(url, request.WriteJson(), new WeixinResult());

            return(result);
        }
Beispiel #26
0
        public WeixinResult Update()
        {
            string url = WeCorpUtil.GetCorpUrl(WeCorpConst.AGENT_SET,
                                               WeixinSettings.Current.CorpUserManagerSecret);
            CorpAppUpdateInfo updateInfo = new CorpAppUpdateInfo(this);
            WeixinResult      result     = WeUtil.PostToUri(url, updateInfo.WriteJson(), new WeixinResult());

            return(result);
        }
Beispiel #27
0
        public WeixinResult Send()
        {
            string       url    = WeUtil.GetUrl(WeConst.SERVICE_URL);
            WeixinResult result = new WeixinResult();

            result = WeUtil.PostToUri(url, ToJson(), result);

            return(result);
        }
Beispiel #28
0
        public static WeSubCategoryList QueryAllSubCategories(string cateId)
        {
            TkDebug.AssertArgumentNullOrEmpty(cateId, "cateId", null);

            string       url     = WeUtil.GetUrl(WeShopConst.ALL_SUB_CATE_URL);
            WeCategoryId request = new WeCategoryId(cateId);
            var          result  = WeUtil.PostToUri(url, request.WriteJson(), new WeSubCategoryList());

            return(result);
        }
Beispiel #29
0
        public static WeCardInfo CardQuery(string cardId)
        {
            TkDebug.AssertArgumentNullOrEmpty(cardId, "cardId", null);

            string   url     = WeUtil.GetUrl(WeCardConst.GET_CARD);
            WeCardId request = new WeCardId(cardId);
            var      result  = WeUtil.PostToUri(url, request.WriteJson(), new WeCard());

            return(result.Card);
        }
Beispiel #30
0
        public static WeServer <T> Query <T>(string query, string category, string city, string region)
        {
            WeSemanticRequest request = new WeSemanticRequest(query, category, city)
            {
                Region = region
            };
            WeServer <T> result = WeUtil.PostToUri(url, request.WriteJson(), new WeServer <T>());

            return(result);
        }