Example #1
0
        /// <summary>
        /// 申请客户及门店
        /// </summary>
        public string ApplyCustomerAndUnit(CustomerUnitApply order,
                                           string customerId, string unitId, string userId)
        {
            string error = string.Empty;

            if (order == null)
            {
                return(null);
            }

            var customerInfo = ToCustomerInfoModel(order);
            var unitInfo     = ToCustomerShopInfoModel(order);

            var apService = new Dex.WsService.AP.APBasicService();

            // 处理客户/门店
            string content1 = string.Empty;
            string content2 = string.Empty;

            if (customerInfo != null && customerInfo.CustomerList != null)
            {
                Jayrock.Json.JsonTextWriter writer1 = new Jayrock.Json.JsonTextWriter();
                Jayrock.Json.Conversion.JsonConvert.Export(customerInfo, writer1);
                content1 = writer1.ToString();
            }
            if (unitInfo != null && unitInfo.CustomerShopList != null)
            {
                Jayrock.Json.JsonTextWriter writer2 = new Jayrock.Json.JsonTextWriter();
                Jayrock.Json.Conversion.JsonConvert.Export(unitInfo, writer2);
                content2 = writer2.ToString();
            }
            error = apService.ApplyCustomerAndUnit(userId, content1, content2);
            return(error);
        }
Example #2
0
 protected void OutPut(bool result, string message)
 {
     Jayrock.Json.JsonTextWriter writer = new Jayrock.Json.JsonTextWriter();
     Jayrock.Json.Conversion.JsonConvert.Export(new JsonResult(result, message), writer);
     Response.Clear();
     Response.Write(writer.ToString());
     Response.Flush();
     Response.End();
 }
Example #3
0
        /// <summary>
        /// 获取日志列表数量
        /// </summary>
        /// <param name="condition">查询条件</param>
        /// <returns></returns>
        public int GetLogsCount(LoggingSessionInfo loggingSession, Hashtable condition)
        {
            string uri = string.Format(ConfigurationManager.AppSettings["dex_url"].Trim() +
                                       "/logservice/getlogscount?user_id={0}&user_pwd={1}",
                                       loggingSession.UserID, new UserService().GetUserPassword(loggingSession.UserID));
            string method = "POST";

            Jayrock.Json.JsonTextWriter writer = new Jayrock.Json.JsonTextWriter();
            Jayrock.Json.Conversion.JsonConvert.Export(condition, writer);
            string content  = writer.ToString();
            string data     = DexUtils.GetRemoteData(uri, method, content);
            var    contract = JsonConvert.Import <DexCountContract>(data);

            return(contract.count);
        }
Example #4
0
        //测试JayrockJson性能
        public static void TestJayrockJson()
        {
            CodeTimer.Initialize();
            object obj = TestObject;

            {
                var writer = new Jayrock.Json.JsonTextWriter();
                Jayrock.Json.Conversion.JsonConvert.Export(obj, writer);
                writer.ToString();
            }
            CodeTimer.Time(N("JayrockJson序列化"), TestCount, () => {
                var writer = new Jayrock.Json.JsonTextWriter();
                Jayrock.Json.Conversion.JsonConvert.Export(obj, writer);
                writer.ToString();
            });
        }
Example #5
0
        /// <summary>
        /// 获取日志列表
        /// </summary>
        /// <param name="condition">查询条件</param>
        /// <param name="maxRowCount">返回最大行数</param>
        /// <param name="startRowIndex">起始行索引</param>
        /// <returns></returns>
        public IList <LogInfo> GetLogs(LoggingSessionInfo loggingSession,
                                       Hashtable condition, int maxRowCount, int startRowIndex)
        {
            string uri = string.Format(ConfigurationManager.AppSettings["dex_url"].Trim() +
                                       "/logservice/getlogs?user_id={0}&user_pwd={1}&start_row={2}&rows_count={3}",
                                       loggingSession.UserID, new UserService().GetUserPassword(loggingSession.UserID),
                                       startRowIndex, maxRowCount);
            string method = "POST";

            Jayrock.Json.JsonTextWriter writer = new Jayrock.Json.JsonTextWriter();
            Jayrock.Json.Conversion.JsonConvert.Export(condition, writer);
            string content  = writer.ToString();
            string data     = DexUtils.GetRemoteData(uri, method, content);
            var    contract = JsonConvert.Import <DexLogsContract>(data);

            return(contract.Logs);
        }
Example #6
0
 protected string ToJson(JsonResult model)
 {
     Jayrock.Json.JsonTextWriter writer = new Jayrock.Json.JsonTextWriter();
     Jayrock.Json.Conversion.JsonConvert.Export(model, writer);
     return writer.ToString();
 }
Example #7
0
 protected string ToJson(bool result, Dictionary<string, object> _obj)
 {
     Jayrock.Json.JsonTextWriter writer = new Jayrock.Json.JsonTextWriter();
     Jayrock.Json.Conversion.JsonConvert.Export(new JsonResult(result, "", _obj), writer);
     return writer.ToString();
 }
Example #8
0
 protected string ToJson(bool result, string message)
 {
     Jayrock.Json.JsonTextWriter writer = new Jayrock.Json.JsonTextWriter();
     Jayrock.Json.Conversion.JsonConvert.Export(new JsonResult(result, message), writer);
     return writer.ToString();
 }
Example #9
0
        //static void Main(string[] args)
        static void testMain(string[] args)
        {
            ///获取accesstoken示例,注意有效期
            DefaultAliClient defaultAliClient = new DefaultAliClient("https://gw.open.1688.com/openapi/", "1002071", "WsRIC:O6CF2");
            AccessTokenRequest accessTokenRequest = new AccessTokenRequest();
            accessTokenRequest.account = "testfree66"; //你的1688 memberId
            accessTokenRequest.password = "******"; //你的密码
            AccessTokenResponse accessTokenResponse = defaultAliClient.Execute(accessTokenRequest);
            Jayrock.Json.JsonTextWriter writer = new Jayrock.Json.JsonTextWriter();
            Jayrock.Json.Conversion.JsonConvert.Export(accessTokenResponse, writer);
            string str = writer.ToString();
            Console.WriteLine(str);

            ///获取阿里巴巴中国网站会员已发布的产品信息列表 offer.getPublishOfferList 示例
            PublishOfferListRequest publishOfferListRequest = new PublishOfferListRequest();
            publishOfferListRequest.access_token = accessTokenResponse.accessToken;
            publishOfferListRequest.type = "SALE";
            publishOfferListRequest.pageSize = 10;
            publishOfferListRequest.page = 2;
            publishOfferListRequest.returnFields = new string[] { "offerId", "subject", "productFeatureList", "details", "memberId", "postCategryId", "saledCount", "amountOnSale", "priceRanges", "unit", "gmtModified", "imageList" };
            PublishOfferListResponse publishOfferListResponse = defaultAliClient.Execute(publishOfferListRequest);
            Console.WriteLine(publishOfferListResponse.toReturn);
            //获取阿里的产品id跟物料编号的对应关系
            foreach(OfferDetailInfo offerDetailInfo in publishOfferListResponse.toReturn)
            {
                foreach (ProductFeatureInfo productFeatureInfo in offerDetailInfo.productFeatureList)
                {
                    if (productFeatureInfo.name.Equals("物料编号"))
                    {
                        Console.WriteLine("产品Id:" + offerDetailInfo.offerId + "  物料编号:" + productFeatureInfo.value);
                    }
                }
            }
            Jayrock.Json.JsonTextWriter writer2 = new Jayrock.Json.JsonTextWriter();
            Jayrock.Json.Conversion.JsonConvert.Export(publishOfferListResponse, writer2);
            string str2 = writer2.ToString();
            Console.WriteLine(str2);

            ///获取阿里巴巴中国网站会员所有的产品信息列表 offer.getAllOfferList -- version: 1 示例
            AllOfferListRequest allOfferListRequest = new AllOfferListRequest();
            allOfferListRequest.access_token = accessTokenResponse.accessToken;
            allOfferListRequest.type = "SALE";
            allOfferListRequest.returnFields = new string[] { "offerId", "subject", "productFeatureList", "details", "memberId", "postCategryId", "saledCount", "amountOnSale", "priceRanges", "unit", "gmtModified", "imageList" };
            PublishOfferListResponse publishOfferListResponse1 = defaultAliClient.Execute(allOfferListRequest);
            Console.WriteLine(publishOfferListResponse1.toReturn);

            ///查询单个产品信息 offer.get -- version: 1
            OfferQueryRequest offerQueryRequest = new OfferQueryRequest();
               // offerQueryRequest.access_token = accessTokenResponse.accessToken;
            offerQueryRequest.offerId = 36379282867;
            offerQueryRequest.returnFields = new string[] { "skuList", "offerId", "subject", "productFeatureList", "details", "memberId", "postCategryId", "saledCount", "amount", "amountOnSale", "priceRanges", "unit", "gmtModified", "imageList" };
            OfferResponse offerResponse = defaultAliClient.Execute(offerQueryRequest);
            Console.WriteLine(offerResponse.toReturn.ToString());

            ///增量修改产品库存 offer.modify.stock -- version: 1
            OfferModifyStockRequest offerModifyStockRequest = new OfferModifyStockRequest();
            offerModifyStockRequest.offerId = 36379282867;//产品id
            offerModifyStockRequest.offerAmountChange = 1; //+表示增加,负表示减少
            offerModifyStockRequest.access_token = accessTokenResponse.accessToken;
            Dictionary<string, string> skuAmountChange = new Dictionary<string, string>();
            skuAmountChange.Add("8a83875664478078358187ed938f4bab", "1");//如果是sku 产品,则需要修改sku的库存
            offerModifyStockRequest.skuAmountChange = skuAmountChange;
            OfferModifyStockResponse offerModifyStockResponse = defaultAliClient.Execute(offerModifyStockRequest);
            Console.WriteLine(offerModifyStockResponse);

            ///offer.modify.increment 增量修改offer(该接口只支持价格和标题的增量修改!请慎用!)
            OfferModifyIncrementRequest offerModifyIncrementRequest = new OfferModifyIncrementRequest();
            offerModifyIncrementRequest.access_token = accessTokenResponse.accessToken;
            OfferModifyIncrement offer = new OfferModifyIncrement();
            offer.offerId = "1295193597";
            offer.priceRanges = "60:10`70:9`80:8"; //修改价格区间
            offer.subject = "c# sdk test modify title";//修改标题
            offerModifyIncrementRequest.offer = offer;
            OfferModifyIncrementResponse offerModifyIncrementResponse = defaultAliClient.Execute(offerModifyIncrementRequest);
            Console.WriteLine(offerModifyIncrementResponse);

            ///获取提供该服务的物流公司列表 e56.logistics.companies.get -- version: 1
            LogisticsCompaniesGetRequest logisticsCompaniesGetRequest = new LogisticsCompaniesGetRequest();
            logisticsCompaniesGetRequest.access_token = accessTokenResponse.accessToken;
            logisticsCompaniesGetRequest.memberId = "testfree";
            logisticsCompaniesGetRequest.serviceType = "ZX";
            LogisticsCompaniesGetResponse logisticsCompaniesGetResponse = defaultAliClient.Execute(logisticsCompaniesGetRequest);
            Console.WriteLine(logisticsCompaniesGetResponse);

            ///用户调用该接口可实现自己联系发货(线下物流),使用该接口发货,交易订单状态会直接变成卖家已发货。不支持货到付款、在线下单类型的订单。e56.logistics.offline.send -- version: 1
            LogisticsOfflineSendRequest logisticsOfflineSendRequest = new LogisticsOfflineSendRequest();
            logisticsOfflineSendRequest.memberId = "testfree";
            logisticsOfflineSendRequest.orderId = "404252368801798";
            logisticsOfflineSendRequest.orderEntryIds = "404252368801798";
            logisticsOfflineSendRequest.tradeSourceType = "cbu-trade";
            logisticsOfflineSendRequest.logisticsCompanyId = "3"; //物流公司id
            logisticsOfflineSendRequest.selfCompanyName = "中通速递";//物流公司名称
            logisticsOfflineSendRequest.logisticsBillNo = "768070181853";//运单号
            logisticsOfflineSendRequest.gmtSystemSend = "2013-10-23 11:21:35";
            logisticsOfflineSendRequest.gmtLogisticsCompanySend = "2013-10-23 11:21:35";
            logisticsOfflineSendRequest.access_token = accessTokenResponse.accessToken;
            //LogisticsOfflineSendResponse logisticsOfflineSendResponse = defaultAliClient.Execute(logisticsOfflineSendRequest);
            //Console.WriteLine(logisticsOfflineSendResponse);

            ///本接口实现阿里巴巴中文站登录会员,根据交易信息获取当前卖家的会员信息
            AcrmCustomerTradeGetRequest acrmCustomerTradeGetRequest = new AcrmCustomerTradeGetRequest();
            acrmCustomerTradeGetRequest.memberId = "testfree";
            acrmCustomerTradeGetRequest.access_token = accessTokenResponse.accessToken;
            acrmCustomerTradeGetRequest.pageSize = 100;
            acrmCustomerTradeGetRequest.pageNum = 2;
            AcrmCustomerTradeGetResponse acrmCustomerTradeGetResponse = defaultAliClient.Execute(acrmCustomerTradeGetRequest);
            Console.WriteLine(acrmCustomerTradeGetResponse);

            ///查询某个memberId下面所有的分组标签
            AcrmGroupsGetRequest acrmGroupsGetRequest = new AcrmGroupsGetRequest();
            acrmGroupsGetRequest.memberId = "testfree";
            acrmGroupsGetRequest.access_token = accessTokenResponse.accessToken;
            AcrmGroupsGetResponse AcrmGroupsGetResponse = defaultAliClient.Execute(acrmGroupsGetRequest);
            Console.WriteLine(AcrmGroupsGetResponse);

            ///本接口实现阿里巴巴中文站登录会员,根据标签获取当前卖家的会员信息
            AcrmCustomerGroupGetRequest acrmCustomerGroupGetRequest = new AcrmCustomerGroupGetRequest();
            acrmCustomerGroupGetRequest.memberId = "testfree";
            acrmCustomerGroupGetRequest.access_token = accessTokenResponse.accessToken;
            acrmCustomerGroupGetRequest.groupId = 8416600;
            acrmCustomerGroupGetRequest.pageNum = 1;
            acrmCustomerGroupGetRequest.pageSize = 20;
            AcrmCustomerGroupGetResponse acrmCustomerGroupGetResponse = defaultAliClient.Execute(acrmCustomerGroupGetRequest);
            Console.WriteLine(acrmCustomerGroupGetResponse);

            ///本接口实现阿里巴巴中文站登录会员,根据等级获取当前卖家的会员信息
            AcrmCustomerRelationGetRequest AcrmCustomerRelationGetRequest = new AcrmCustomerRelationGetRequest();
            AcrmCustomerRelationGetRequest.memberId = "testfree";
            AcrmCustomerRelationGetRequest.access_token = accessTokenResponse.accessToken;
            AcrmCustomerRelationGetRequest.level = 1;
            AcrmCustomerRelationGetRequest.pageNum = 1;
            AcrmCustomerRelationGetRequest.pageSize = 20;
            AcrmCustomerRelationGetResponse AcrmCustomerRelationGetResponse = defaultAliClient.Execute(AcrmCustomerRelationGetRequest);
            Console.WriteLine(AcrmCustomerRelationGetResponse);
        }
Example #10
0
 public void ToJSON(Jayrock.Json.JsonTextWriter jwriter)
 {
     GeoJSONWriter.Write(this, jwriter);
 }
Example #11
0
        //static void mytest()
        static void Main(string[] args)
        {
            ///获取accesstoken示例,注意有效期 ,过期之后如何更新token?
            DefaultAliClient defaultAliClient = new DefaultAliClient("https://gw.open.1688.com/openapi/", "1002071", "WsRIC:O6CF2");
            AccessTokenRequest accessTokenRequest = new AccessTokenRequest();
            accessTokenRequest.account = "testfree66"; //你的1688 memberId
            accessTokenRequest.password = "******"; //你的密码
            AccessTokenResponse accessTokenResponse = defaultAliClient.Execute(accessTokenRequest);
            Jayrock.Json.JsonTextWriter writer = new Jayrock.Json.JsonTextWriter();
            Jayrock.Json.Conversion.JsonConvert.Export(accessTokenResponse, writer);
            string str = writer.ToString();
            Console.WriteLine(str);

            ///
            /// 查询会员信息示例
            ///
            MemberInfoRequest memberInfoRequest = new MemberInfoRequest();
            memberInfoRequest.access_token = accessTokenResponse.accessToken;
            memberInfoRequest.memberId = accessTokenResponse.memberId;
            MemberInfoResponse memberInfoResponse = defaultAliClient.Execute(memberInfoRequest);
            Console.WriteLine(memberInfoResponse.toReturn.isTP);
            Jayrock.Json.JsonTextWriter writer1 = new Jayrock.Json.JsonTextWriter();
            Jayrock.Json.Conversion.JsonConvert.Export(memberInfoResponse, writer1);
            string str1 = writer1.ToString();
            Console.WriteLine(str1);

            ///获取阿里巴巴阿中国网站会员诚信信息。包括诚信通和诚信保障相关数据
            CreditInfoGetRequest creditInfoGetRequest = new CreditInfoGetRequest();
            creditInfoGetRequest.memberIds = "mmm;cnabblp";
            CreditInfoGetResponse creditInfoGetResponse = defaultAliClient.Execute(creditInfoGetRequest);
            Console.WriteLine(creditInfoGetResponse);

            ///获取阿里巴巴中国网站会员的公司库信息
            CompanyGetRequest companyGetRequest = new CompanyGetRequest();
            companyGetRequest.memberId = "mmm";
            companyGetRequest.access_token = accessTokenResponse.memberId;
            CompanyGetResponse companyGetResponse = defaultAliClient.Execute(companyGetRequest);
            Console.WriteLine(companyGetResponse);

            ///获取阿里巴巴中国网站会员已发布的产品信息列表 offer.getPublishOfferList 示例
            PublishOfferListRequest publishOfferListRequest = new PublishOfferListRequest();
            publishOfferListRequest.access_token = accessTokenResponse.accessToken;
            publishOfferListRequest.type = "SALE";
            publishOfferListRequest.pageSize = 10;
            publishOfferListRequest.page = 2;
            publishOfferListRequest.returnFields = new string[] { "offerId", "subject", "productFeatureList", "details", "memberId", "postCategryId", "saledCount", "amountOnSale", "priceRanges", "unit", "gmtModified", "imageList" };
            PublishOfferListResponse publishOfferListResponse = defaultAliClient.Execute(publishOfferListRequest);
            Console.WriteLine(publishOfferListResponse.toReturn);
            Jayrock.Json.JsonTextWriter writer2 = new Jayrock.Json.JsonTextWriter();
            Jayrock.Json.Conversion.JsonConvert.Export(publishOfferListResponse, writer2);
            string str2 = writer2.ToString();
            Console.WriteLine(str2);

            ///获取阿里巴巴中国网站会员所有的产品信息列表 offer.getAllOfferList -- version: 1 示例
            AllOfferListRequest allOfferListRequest = new AllOfferListRequest();
            allOfferListRequest.access_token = accessTokenResponse.accessToken;
            allOfferListRequest.type = "SALE";
            allOfferListRequest.returnFields = new string[] { "offerId", "subject", "productFeatureList", "details", "memberId", "postCategryId", "saledCount", "amountOnSale", "priceRanges", "unit", "gmtModified", "imageList" };
            PublishOfferListResponse publishOfferListResponse1 = defaultAliClient.Execute(allOfferListRequest);
            Console.WriteLine(publishOfferListResponse1.toReturn);

            ///查询单个产品信息 offer.get -- version: 1
            OfferQueryRequest offerQueryRequest = new OfferQueryRequest();
            //offerQueryRequest.access_token = accessTokenResponse.accessToken;
            offerQueryRequest.offerId = 37014312231;
            //offerQueryRequest.returnFields = new string[] { "skuArray", "offerId", "subject", "productFeatureList", "details", "memberId", "postCategryId", "saledCount", "amount", "amountOnSale", "priceRanges", "unit", "gmtModified", "imageList" };
            OfferResponse offerResponse = defaultAliClient.Execute(offerQueryRequest);
            Console.WriteLine(offerResponse.toReturn);

            ///增量修改产品库存 offer.modify.stock -- version: 1
            OfferModifyStockRequest offerModifyStockRequest = new OfferModifyStockRequest();
            offerModifyStockRequest.offerId = 36379282867;//产品id
            offerModifyStockRequest.offerAmountChange = 1; //+表示增加,负表示减少
            offerModifyStockRequest.access_token = accessTokenResponse.accessToken;
            Dictionary<string, string> skuAmountChange = new Dictionary<string, string>();
            skuAmountChange.Add("8a83875664478078358187ed938f4bab", "1");//如果是sku 产品,则需要修改sku的库存
            offerModifyStockRequest.skuAmountChange = skuAmountChange;
            OfferModifyStockResponse offerModifyStockResponse = defaultAliClient.Execute(offerModifyStockRequest);
            Console.WriteLine(offerModifyStockResponse);

            ///offer.modify.increment 增量修改offer(该接口只支持价格和标题的增量修改!请慎用!)
            OfferModifyIncrementRequest offerModifyIncrementRequest = new OfferModifyIncrementRequest();
            offerModifyIncrementRequest.access_token = accessTokenResponse.accessToken;
            OfferModifyIncrement offer = new OfferModifyIncrement();
            offer.offerId = "1294434695";
            offer.priceRanges = "60:10`70:9`80:313.19";
            offer.subject = "c# sdk test modify title";
            offerModifyIncrementRequest.offer = offer;
            OfferModifyIncrementResponse offerModifyIncrementResponse = defaultAliClient.Execute(offerModifyIncrementRequest);
            Console.WriteLine(offerModifyIncrementResponse);

            ///offer.modify.increment 增量修改offer SKU价格(该接口只支持价格和标题的增量修改!请慎用!)
            OfferModifyIncrementRequest offerModifyIncrementRequest1 = new OfferModifyIncrementRequest();
            offerModifyIncrementRequest1.access_token = accessTokenResponse.accessToken;
            OfferModifyIncrement offer1 = new OfferModifyIncrement();
            offer1.offerId = "35687805905";
            OfferSkuParam[] offerSkuParam = new OfferSkuParam[1];
            OfferSkuParam OfferSkuParam1 = new OfferSkuParam();
            OfferSkuParam1.specAttributes = new Dictionary<string, string>();
            OfferSkuParam1.specAttributes.Add("450", "XXS");
            OfferSkuParam1.specAttributes.Add("3216", "黑色");
            OfferSkuParam1.amountOnSale = 100;
            OfferSkuParam1.price = 2000;
            OfferSkuParam1.retailPrice = 3000;
            OfferSkuParam1.cargoNumber = "11";
            offerSkuParam[0] = OfferSkuParam1;
            offer1.skuList = offerSkuParam;
            offerModifyIncrementRequest1.offer = offer1;
               ///         OfferModifyIncrementResponse offerModifyIncrementResponse1 = defaultAliClient.Execute(offerModifyIncrementRequest1);
               ///         Console.WriteLine(offerModifyIncrementResponse1);

            //用户运费模板列表描述查询
            E56DeliveryTemplateListRequest e56DeliveryTemplateListRequest = new E56DeliveryTemplateListRequest();
            e56DeliveryTemplateListRequest.memberId = "testfree";
            e56DeliveryTemplateListRequest.access_token = accessTokenResponse.accessToken;
            E56DeliveryTemplateListResponse e56DeliveryTemplateListResponse = defaultAliClient.Execute(e56DeliveryTemplateListRequest);
            Console.WriteLine(e56DeliveryTemplateListResponse);
            E56DeliveryTemplateGetRequest e56DeliveryTemplateGetRequest = new E56DeliveryTemplateGetRequest();
            e56DeliveryTemplateGetRequest.memberId = "testfree";
            e56DeliveryTemplateGetRequest.access_token = accessTokenResponse.accessToken;
            e56DeliveryTemplateGetRequest.templateId = "1069818";
            E56DeliveryTemplateGetResponse e56DeliveryTemplateGetResponse = defaultAliClient.Execute(e56DeliveryTemplateGetRequest);
            Console.WriteLine(e56DeliveryTemplateGetResponse);

            ///获取提供该服务的物流公司列表 e56.logistics.companies.get -- version: 1
            LogisticsCompaniesGetRequest logisticsCompaniesGetRequest = new LogisticsCompaniesGetRequest();
            logisticsCompaniesGetRequest.access_token = accessTokenResponse.accessToken;
            logisticsCompaniesGetRequest.memberId = "testfree";
            logisticsCompaniesGetRequest.serviceType = "ZX";
            LogisticsCompaniesGetResponse logisticsCompaniesGetResponse = defaultAliClient.Execute(logisticsCompaniesGetRequest);
            Console.WriteLine(logisticsCompaniesGetResponse);

            ///用户调用该接口可实现自己联系发货(线下物流),使用该接口发货,交易订单状态会直接变成卖家已发货。不支持货到付款、在线下单类型的订单。e56.logistics.offline.send -- version: 1
            LogisticsOfflineSendRequest logisticsOfflineSendRequest = new LogisticsOfflineSendRequest();
            logisticsOfflineSendRequest.memberId = "testfree";
            logisticsOfflineSendRequest.orderId = "404252368801798";
            logisticsOfflineSendRequest.orderEntryIds = "404252368801798";
            logisticsOfflineSendRequest.tradeSourceType = "cbu-trade";
            logisticsOfflineSendRequest.logisticsCompanyId = "3";
            logisticsOfflineSendRequest.selfCompanyName = "中通速递";
            logisticsOfflineSendRequest.logisticsBillNo = "768070181853";
            logisticsOfflineSendRequest.gmtSystemSend = "2013-10-23 11:21:35";
            logisticsOfflineSendRequest.gmtLogisticsCompanySend = "2013-10-23 11:21:35";
            logisticsOfflineSendRequest.access_token = accessTokenResponse.accessToken;
            //LogisticsOfflineSendResponse logisticsOfflineSendResponse = defaultAliClient.Execute(logisticsOfflineSendRequest);
            //Console.WriteLine(logisticsOfflineSendResponse);

            ///用户根据交易号查询物流流转信息,如2010-8-10 15:23:00到达杭州集散地。 此接口的返回信息都由物流公司提供。e56.logistics.trace.get -- version: 1
            LogisticsOrderGetRequest logisticsOrderGetRequest = new LogisticsOrderGetRequest();
            logisticsOrderGetRequest.memberId = "testfree";
            logisticsOrderGetRequest.orderId = "404252368801798";
            logisticsOrderGetRequest.tradeSourceType = "cbu-trade";
            logisticsOrderGetRequest.fields = "company.name,sender,receiver,sendgood";
            logisticsOrderGetRequest.access_token = accessTokenResponse.accessToken;
            LogisticsOrderGetResponse logisticsOrderGetResponse = defaultAliClient.Execute(logisticsOrderGetRequest);
            Console.WriteLine(logisticsOrderGetResponse);

            ///根据交易订单ID, 获取该订单下的物流单列表 e56.logistics.orders.get -- version: 1
            LogisticsTraceGetRequest logisticsTraceGetRequest = new LogisticsTraceGetRequest();
            logisticsTraceGetRequest.memberId = "testfree";
            logisticsTraceGetRequest.orderId = "404252368801798";
            logisticsTraceGetRequest.tradeSourceType = "cbu-trade";
            logisticsTraceGetRequest.access_token = accessTokenResponse.accessToken;
            LogisticsTraceGetResponse logisticsTraceGetResponse = defaultAliClient.Execute(logisticsTraceGetRequest);
            Console.WriteLine(logisticsTraceGetResponse);

            ///本接口查询当前会话会员的交易订单列表
            TradeOrderListGetRequest tradeOrderListGetRequest = new TradeOrderListGetRequest();
            tradeOrderListGetRequest.access_token = accessTokenResponse.accessToken;
            tradeOrderListGetRequest.sellerMemberId = "testfree";
            tradeOrderListGetRequest.pageSize = 20;
            tradeOrderListGetRequest.pageNO = 1;
            TradeOrderListGetResponse tradeOrderListGetResponse = defaultAliClient.Execute(tradeOrderListGetRequest);
            Console.WriteLine(tradeOrderListGetResponse);

            ///本接口查询当前会话会员的交易订单详情
            TradeOrderDetailGetRequest tradeOrderDetailGetRequest = new TradeOrderDetailGetRequest();
            tradeOrderDetailGetRequest.access_token = accessTokenResponse.accessToken;
            tradeOrderDetailGetRequest.orderId = 404252368801798;
            TradeOrderDetailGetResponse tradeOrderDetailGetResponse = defaultAliClient.Execute(tradeOrderDetailGetRequest);
            Console.WriteLine(tradeOrderDetailGetResponse);

            ///本接口实现获取指定会员在阿里巴巴中文站上的发货地址列表信息
            TradeFreightSendGoodsAddressListGetRequest tradeFreightSendGoodsAddressListGetRequest = new TradeFreightSendGoodsAddressListGetRequest();
            tradeFreightSendGoodsAddressListGetRequest.access_token = accessTokenResponse.accessToken;
            tradeFreightSendGoodsAddressListGetRequest.memberId = "testfree";
            tradeFreightSendGoodsAddressListGetRequest.returnFields = "deliveryAddressId,updateTime,isCommonUse,contactName,location,address,postcode,telephone,mobilephone";
            TradeFreightSendGoodsAddressListGetResponse tradeFreightSendGoodsAddressListGetResponse = defaultAliClient.Execute(tradeFreightSendGoodsAddressListGetRequest);
            Console.WriteLine(tradeFreightSendGoodsAddressListGetResponse);

            ///本接口实现获取指定会员在阿里巴巴中文站上的物流模板列表信息
            TradeFreightTemplateListGetRequest tradeFreightTemplateListGetRequest = new TradeFreightTemplateListGetRequest();
            tradeFreightTemplateListGetRequest.access_token = accessTokenResponse.accessToken;
            tradeFreightTemplateListGetRequest.memberId = "testfree";
            ///TradeFreightTemplateListGetResponse tradeFreightTemplateListGetResponse = defaultAliClient.Execute(tradeFreightTemplateListGetRequest);
            ///Console.WriteLine(tradeFreightTemplateListGetResponse);

            ///获取省份编码信息
            AreaCodeGetRequest areaCodeGetRequest = new AreaCodeGetRequest();
            AreaCodeGetResponse areaCodeGetResponse = defaultAliClient.Execute(areaCodeGetRequest);
            Console.WriteLine(areaCodeGetResponse.toReturn);
            Console.WriteLine(accessTokenResponse);

            ///本接口实现获取当前用户信息,包括可用空间和总空间等
            IbankProfileGetRequest ibankProfileGetRequest = new IbankProfileGetRequest();
            ibankProfileGetRequest.access_token = accessTokenResponse.accessToken;
            IbankProfileGetResponse IbankProfileGetResponse = defaultAliClient.Execute(ibankProfileGetRequest);
            Console.WriteLine(IbankProfileGetResponse);

            ///本接口实现获取当前用户相册列表
            IbankAlbumListRequest ibankAlbumListRequest = new IbankAlbumListRequest();
            ibankAlbumListRequest.access_token = accessTokenResponse.accessToken;
            ibankAlbumListRequest.albumType = "MY";
            ibankAlbumListRequest.pageNo = 1;
            ibankAlbumListRequest.pageSize = 20;
            IbankAlbumListResponse ibankAlbumListResponse = defaultAliClient.Execute(ibankAlbumListRequest);
            Console.WriteLine(ibankAlbumListResponse.toReturn);

            ///本接口实现获取当前用户相册内图片列表
            IbankImageListRequest ibankImageListRequest = new IbankImageListRequest();
            ibankImageListRequest.access_token = accessTokenResponse.accessToken;
            ibankImageListRequest.albumId = 10971051;
            ibankImageListRequest.pageNo = 1;
            ibankImageListRequest.pageSize = 50;
            IbankImageListResponse ibankImageListResponse = defaultAliClient.Execute(ibankImageListRequest);
            Console.WriteLine(ibankImageListResponse.toReturn);

            ///根据叶子类目ID获取类目发布属性信息 offerPostFeatures.get -- version: 1
            OfferPostFeaturesGetRequest offerPostFeaturesGetRequest = new OfferPostFeaturesGetRequest();
            offerPostFeaturesGetRequest.categoryID = 1031910;
            OfferPostFeaturesGetResponse OfferPostFeaturesGetResponse = defaultAliClient.Execute(offerPostFeaturesGetRequest);
            Console.WriteLine(OfferPostFeaturesGetResponse);

            //根据类目ID获取商品发布类目信息 category.getPostCatList -- version: 1
            CategoryGetPostCatListRequest categoryGetPostCatListRequest = new CategoryGetPostCatListRequest();
            categoryGetPostCatListRequest.catIDs = "1031910,10166";
            CategoryGetPostCatListResponse categoryGetPostCatListResponse = defaultAliClient.Execute(categoryGetPostCatListRequest);
            Console.WriteLine(categoryGetPostCatListResponse);

            ///本接口实现阿里巴巴中文站登录会员,根据交易信息获取当前卖家的会员信息
            AcrmCustomerTradeGetRequest acrmCustomerTradeGetRequest = new AcrmCustomerTradeGetRequest();
            acrmCustomerTradeGetRequest.memberId = "testfree";
            acrmCustomerTradeGetRequest.access_token = accessTokenResponse.accessToken;
            AcrmCustomerTradeGetResponse acrmCustomerTradeGetResponse = defaultAliClient.Execute(acrmCustomerTradeGetRequest);
            Console.WriteLine(acrmCustomerTradeGetResponse);

            ///查询某个memberId下面所有的分组标签
            AcrmGroupsGetRequest acrmGroupsGetRequest = new AcrmGroupsGetRequest();
            acrmGroupsGetRequest.memberId = "testfree";
            acrmGroupsGetRequest.access_token = accessTokenResponse.accessToken;
            AcrmGroupsGetResponse AcrmGroupsGetResponse = defaultAliClient.Execute(acrmGroupsGetRequest);
            Console.WriteLine(AcrmGroupsGetResponse);

            ///本接口实现阿里巴巴中文站登录会员,根据标签获取当前卖家的会员信息
            AcrmCustomerGroupGetRequest acrmCustomerGroupGetRequest = new AcrmCustomerGroupGetRequest();
            acrmCustomerGroupGetRequest.memberId = "testfree";
            acrmCustomerGroupGetRequest.access_token = accessTokenResponse.accessToken;
            acrmCustomerGroupGetRequest.groupId = 8416600;
            acrmCustomerGroupGetRequest.pageNum = 1;
            acrmCustomerGroupGetRequest.pageSize = 20;
            AcrmCustomerGroupGetResponse acrmCustomerGroupGetResponse = defaultAliClient.Execute(acrmCustomerGroupGetRequest);
            Console.WriteLine(acrmCustomerGroupGetResponse);

            ///本接口实现阿里巴巴中文站登录会员,根据等级获取当前卖家的会员信息
            AcrmCustomerRelationGetRequest AcrmCustomerRelationGetRequest = new AcrmCustomerRelationGetRequest();
            AcrmCustomerRelationGetRequest.memberId = "testfree";
            AcrmCustomerRelationGetRequest.access_token = accessTokenResponse.accessToken;
            AcrmCustomerRelationGetRequest.level = 1;
            AcrmCustomerRelationGetRequest.pageNum = 1;
            AcrmCustomerRelationGetRequest.pageSize = 20;
            AcrmCustomerRelationGetResponse AcrmCustomerRelationGetResponse = defaultAliClient.Execute(AcrmCustomerRelationGetRequest);
            Console.WriteLine(AcrmCustomerRelationGetResponse);

            ///新接口查询当前会话会员的交易订单列表
            OrderListInfoRequest orderListInfoRequest = new OrderListInfoRequest();
            orderListInfoRequest.access_token = accessTokenResponse.accessToken;
            orderListInfoRequest.sellerMemberId = "testfree";
            orderListInfoRequest.pageSize = 20;
            orderListInfoRequest.page = 1;
            OrderListInfoResponse OrderListInfoResponse = defaultAliClient.Execute(orderListInfoRequest);
            Console.WriteLine(OrderListInfoResponse);

            ///新本接口查询当前会话会员的交易订单详情
            NewTradeOrderDetailGetRequest newTradeOrderDetailGetRequest = new NewTradeOrderDetailGetRequest();
            newTradeOrderDetailGetRequest.access_token = accessTokenResponse.accessToken;
            newTradeOrderDetailGetRequest.id = 440136255012834;
            NewTradeOrderDetailGetResponse newtradeOrderDetailGetResponse = defaultAliClient.Execute(newTradeOrderDetailGetRequest);
            Console.WriteLine(newtradeOrderDetailGetResponse);

            ///新版查询订单列表,不包含用户的隐私数据;适用于查询卖家和买家的订单列表
            NewTradeOrderListGetRequest newTradeOrderListGetRequest = new NewTradeOrderListGetRequest();
            newTradeOrderListGetRequest.access_token = accessTokenResponse.accessToken;
            newTradeOrderListGetRequest.buyerMemberId = "testfree";
            NewTradeOrderListGetResponse newTradeOrderListGetResponse = defaultAliClient.Execute(newTradeOrderListGetRequest);
            Console.WriteLine(newTradeOrderListGetResponse);

            ///用户在发布offer时候,需要选择对应的发布类目,类目作弊就是用来检测选择的类目跟发布的offer信息是否匹配
            SearchCategoryCheatingRequest searchCategoryCheatingRequest = new SearchCategoryCheatingRequest();
            searchCategoryCheatingRequest.userid = "testfree";
            searchCategoryCheatingRequest.title = "喷泉水景是单价的offer22";
            searchCategoryCheatingRequest.catid = "30";
            SearchCategoryCheatingResponse searchCategoryCheatingResponse = defaultAliClient.Execute(searchCategoryCheatingRequest);
            Console.WriteLine(searchCategoryCheatingResponse.body);

            ///用来判断,用户标题和属性中填写的信息是否一致,是否存在冲突的关键属性
            SearchTitlePropertiesInconsistentRequest searchTitlePropertiesInconsistentRequest = new SearchTitlePropertiesInconsistentRequest();
            searchTitlePropertiesInconsistentRequest.catid = "1046737";
            searchTitlePropertiesInconsistentRequest.title = "喷泉水景是单价的offer22";
            searchTitlePropertiesInconsistentRequest.brief = "产品类别:洗衣液 品牌:Tide/汰渍";
            SearchTitlePropertiesInconsistentResponse searchTitlePropertiesInconsistentResponse = defaultAliClient.Execute(searchTitlePropertiesInconsistentRequest);
            Console.WriteLine(searchTitlePropertiesInconsistentResponse.body);

            ///判断用户填写的属性是否存在滥用,比如属性值多个重复使用,属性值过长,以及属性值无意义等。
            SearchPropertiesAbuseRequest searchPropertiesAbuseRequest = new SearchPropertiesAbuseRequest();
            searchPropertiesAbuseRequest.catid = "1046737";
            searchPropertiesAbuseRequest.brief = "产品类别:洗衣液 品牌:Tide/汰渍 货号:TZ-200 类型:浓缩型 适用范围:所有衣物 香型:自然 净含量:200-350g/ml 产地:中国 箱装数量:30";
            SearchPropertiesAbuseResponse searchPropertiesAbuseResponse = defaultAliClient.Execute(searchPropertiesAbuseRequest);
            Console.WriteLine(searchPropertiesAbuseResponse.body);

            SearchTitleStuffingReqeust searchTitleStuffingReqeust = new SearchTitleStuffingReqeust();
            searchTitleStuffingReqeust.query = "ABB 品牌 品牌ABB口罩 防护口罩";
            SearchTitleStuffingResponse SearchTitleStuffingResponse = defaultAliClient.Execute(searchTitleStuffingReqeust);
            Console.WriteLine(SearchTitleStuffingResponse.body);

            ///阿里巴巴中国网站会员开启或关闭自定义分类功能
            OfferGroupSetRequest offerGroupSetRequest = new OfferGroupSetRequest();
            offerGroupSetRequest.access_token = accessTokenResponse.accessToken;
            offerGroupSetRequest.switchType = "on";
            OfferGroupSetResponse offerGroupSetResponse = defaultAliClient.Execute(offerGroupSetRequest);
            Console.WriteLine(offerGroupSetResponse);

            ///获取指定会员(供应商)的自定义商品分类信息
            CategoryGetSelfCatlistRequest categoryGetSelfCatlistRequest = new CategoryGetSelfCatlistRequest();
            categoryGetSelfCatlistRequest.memberId = "testfree";
            CategoryGetSelfCatlistResponse CategoryGetSelfCatlistResponse = defaultAliClient.Execute(categoryGetSelfCatlistRequest);
            Console.WriteLine(CategoryGetSelfCatlistResponse.body);

            ///阿里巴巴中国网站会员开启或关闭自定义分类功能
            OfferGroupSetRequest offerGroupSetRequest1 = new OfferGroupSetRequest();
            offerGroupSetRequest1.access_token = accessTokenResponse.accessToken;
            offerGroupSetRequest1.switchType = "off";
            OfferGroupSetResponse offerGroupSetResponse1 = defaultAliClient.Execute(offerGroupSetRequest1);
            Console.WriteLine(offerGroupSetResponse1);

            ///获取阿里巴巴中国网站会员是否已经开启自定义分类功能
            OfferGroupHasOpenedRequest offerGroupHasOpenedRequest = new OfferGroupHasOpenedRequest();
            offerGroupHasOpenedRequest.memberId = "testfree";
            OfferGroupHasOpenedResponse offerGroupHasOpenedResponse = defaultAliClient.Execute(offerGroupHasOpenedRequest);
            Console.WriteLine(offerGroupHasOpenedResponse);

            ///批量获取指定产品所属的自定义分类ID
            UserCategoryGetOfferIdsRequest userCategoryGetOfferIdsRequest = new UserCategoryGetOfferIdsRequest();
            userCategoryGetOfferIdsRequest.access_token = accessTokenResponse.accessToken;
            userCategoryGetOfferIdsRequest.offerIds = "37115077409;37953104410";
            UserCategoryGetOfferIdsResponse userCategoryGetOfferIdsResponse = defaultAliClient.Execute(userCategoryGetOfferIdsRequest);
            Console.WriteLine(userCategoryGetOfferIdsResponse.toReturn);

            ///批量添加多个产品到一个自定义分类下
            UserCategoryOffersAddRequest userCategoryOffersAddRequest = new UserCategoryOffersAddRequest();
            userCategoryOffersAddRequest.offerIds = "37115077409";
            userCategoryOffersAddRequest.groupId = 35382752;
            userCategoryOffersAddRequest.access_token = accessTokenResponse.accessToken;
            UserCategoryOffersAddResponse userCategoryOffersAddResponse = defaultAliClient.Execute(userCategoryOffersAddRequest);
            Console.WriteLine(userCategoryOffersAddResponse);

            ///本接口实现通过数据接口的形式,批量移除多个产品的一个自定义分类
            UserCategoryOffersRemoveRequest userCategoryOffersRemoveRequest = new UserCategoryOffersRemoveRequest();
            userCategoryOffersRemoveRequest.offerIds = "37115077409";
            userCategoryOffersRemoveRequest.groupId = 35382752;
            userCategoryOffersRemoveRequest.access_token = accessTokenResponse.accessToken;
            UserCategoryOffersRemoveResponse userCategoryOffersRemoveResponse = defaultAliClient.Execute(userCategoryOffersRemoveRequest);
            Console.WriteLine(userCategoryOffersRemoveResponse);

            ///
            ///ISV获取自己名下的应用最近一个月的订购的订单信息列表。
            ///
            AppOrderGetRequest appOrderGetRequest = new AppOrderGetRequest();
            appOrderGetRequest.appKey = "1002071";
            appOrderGetRequest.gmtCreate = DateTime.Now.AddDays(-500);
            AppOrderGetResponse appOrderGetResponse = defaultAliClient.Execute(appOrderGetRequest);
            appOrderGetResponse = appOrderGetResponse.format();
            Console.WriteLine(appOrderGetResponse);
        }
Example #12
0
        /// <summary>
        /// 保存CcOrder集合
        /// </summary>
        public void SaveCcOrders(IList <CcOrderContract> orders,
                                 string customerId, string unitId, string userId, string orderType)
        {
            if (userId == null || userId.Trim().Length == 0)
            {
                throw new Exception("用户ID不能为空");
            }
            if (orderType == UploadCcOrderType.CC.ToString())
            {
                if (customerId == null || customerId.Trim().Length == 0)
                {
                    throw new Exception("客户ID不能为空");
                }
                if (orderType == null || orderType.Trim().Length == 0)
                {
                    throw new Exception("单据处理类型不能为空");
                }
            }

            var orderInfoList = new List <cPos.Admin.Model.CCInfo>();

            foreach (var order in orders)
            {
                cPos.Admin.Model.CCInfo orderInfo = new cPos.Admin.Model.CCInfo();
                #region order
                orderInfo.order_id        = order.order_id;
                orderInfo.order_no        = order.order_no;
                orderInfo.order_type_id   = order.order_type_id;
                orderInfo.order_reason_id = order.order_reason_id;
                orderInfo.ref_order_id    = order.ref_order_id;
                orderInfo.ref_order_no    = order.ref_order_no;
                orderInfo.order_date      = order.order_date;
                orderInfo.request_date    = order.request_date;
                orderInfo.complete_date   = order.complete_date;
                orderInfo.unit_id         = order.unit_id;
                orderInfo.pos_id          = order.pos_id;
                orderInfo.warehouse_id    = order.warehouse_id;
                orderInfo.remark          = order.remark;
                orderInfo.status          = order.status;
                orderInfo.create_time     = order.create_time;
                orderInfo.create_user_id  = order.create_user_id;
                orderInfo.modify_time     = order.modify_time;
                orderInfo.modify_user_id  = order.modify_user_id;
                orderInfo.data_from_id    = order.data_from_id;
                orderInfo.send_user_id    = order.send_user_id;
                orderInfo.send_time       = order.send_time;
                orderInfo.approve_user_id = order.approve_user_id;
                orderInfo.approve_time    = order.approve_time;
                orderInfo.accpect_user_id = order.accept_user_id;
                orderInfo.accpect_time    = order.accept_time;
                orderInfo.if_flag         = order.if_flag;
                #endregion

                #region details
                orderInfo.CCDetailInfoList = new List <cPos.Admin.Model.CCDetailInfo>();
                foreach (var detail in order.details)
                {
                    cPos.Admin.Model.CCDetailInfo detailInfo = new cPos.Admin.Model.CCDetailInfo();
                    detailInfo.order_detail_id     = detail.order_detail_id;
                    detailInfo.order_id            = detail.order_id;
                    detailInfo.ref_order_detail_id = detail.ref_order_detail_id;
                    detailInfo.order_no            = detail.order_no;
                    detailInfo.warehouse_id        = detail.warehouse_id;
                    detailInfo.sku_id         = detail.sku_id;
                    detailInfo.end_qty        = Utils.GetDecimalVal(detail.end_qty);
                    detailInfo.order_qty      = Utils.GetDecimalVal(detail.order_qty);
                    detailInfo.remark         = detail.remark;
                    detailInfo.display_index  = Utils.GetIntVal(detail.display_index);
                    detailInfo.create_time    = detail.create_time;
                    detailInfo.create_user_id = detail.create_user_id;
                    detailInfo.modify_time    = detail.modify_time;
                    detailInfo.modify_user_id = detail.modify_user_id;

                    detailInfo.item_code        = detail.item_code;
                    detailInfo.item_name        = detail.item_name;
                    detailInfo.barcode          = detail.barcode;
                    detailInfo.sku_prop_1_name  = detail.sku_prop_1_name;
                    detailInfo.sku_prop_2_name  = detail.sku_prop_2_name;
                    detailInfo.sku_prop_3_name  = detail.sku_prop_3_name;
                    detailInfo.sku_prop_4_name  = detail.sku_prop_4_name;
                    detailInfo.sku_prop_5_name  = detail.sku_prop_5_name;
                    detailInfo.enter_price      = detail.enter_price;
                    detailInfo.sales_price      = detail.sales_price;
                    detailInfo.brand_name       = detail.brand_name;
                    detailInfo.item_category_id = detail.item_category_id;

                    orderInfo.CCDetailInfoList.Add(detailInfo);
                }
                #endregion

                orderInfoList.Add(orderInfo);
            }

            // Save
            var    apWsCCOrderService = new cPos.Dex.WsService.AP.APOrderService();
            string error = string.Empty;
            switch (orderType)
            {
            case "MOBILE":
                cPos.Admin.Model.CCInfo ccInfoObj = new cPos.Admin.Model.CCInfo();
                ccInfoObj.CCInfoList = orderInfoList;

                string content = string.Empty;
                Jayrock.Json.JsonTextWriter writer = new Jayrock.Json.JsonTextWriter();
                Jayrock.Json.Conversion.JsonConvert.Export(ccInfoObj, writer);
                content = writer.ToString();
                error   = apWsCCOrderService.SetCCOrderList(userId, orderType, content);
                break;

            default:
                throw new Exception(string.Format("'{0}'单据处理类型错误", orderType));
            }
        }
Example #13
0
 protected string ToJson(object obj)
 {
     Jayrock.Json.JsonTextWriter writer = new Jayrock.Json.JsonTextWriter();
     Jayrock.Json.Conversion.JsonConvert.Export(obj, writer);
     return writer.ToString();
 }
Example #14
0
 protected void OutPut(bool result, string message)
 {
     Jayrock.Json.JsonTextWriter writer = new Jayrock.Json.JsonTextWriter();
     Jayrock.Json.Conversion.JsonConvert.Export(new JsonResult(result, message), writer);
     OutPut(writer.ToString());
 }