Пример #1
0
 //授权开通物流提醒
 public static void OpenLogistics(string sellerNick)
 {
     string               key    = SellersBLL.GetSellerSessionKey(sellerNick);
     ITopClient           client = TBManager.GetClient();
     TmcUserPermitRequest req    = new TmcUserPermitRequest();
     //req.Topics = "taobao_trade_TradeCreate,taobao_refund_RefundCreate"; 不需要设置
     TmcUserPermitResponse rsp = client.Execute(req, key);
     //Console.WriteLine(rsp.Body);
 }
Пример #2
0
 public static void StopNotify()
 {
     if (!RemainderDAL.CheckSellerNofityForUnpay(Users.Nick))
     {
         ITopClient           client = TBManager.GetClient();
         TmcUserCancelRequest req    = new TmcUserCancelRequest();
         req.Nick = Users.Nick;
         TmcUserCancelResponse response = client.Execute(req);
         if (response.IsSuccess)
         {
             AppCusBLL.DeleteSellerNifty(Users.Nick);
         }
     }
 }
Пример #3
0
        /// <summary>
        /// 验证用户是否已经过期
        /// </summary>
        /// <returns></returns>
        public static string VerifyDate()
        {
            UserGetRequest request = new UserGetRequest();

            request.Fields = "user_id";
            request.Nick   = Users.Nick;
            UserGetResponse u = TBManager.GetClient().Execute(request, Users.SessionKey);

            if (u == null || u.User == null || u.User.UserId < 1)
            {
                return("false");
            }
            return("true");
        }
Пример #4
0
 /// <summary>
 /// 查询用户的图片空间使用信息,包括:订购量,已使用容量,免费容量,总的可使用容量,订购有效期,剩余容量
 /// </summary>
 /// <returns></returns>
 public static UserInfo GetPicInfo()
 {
     try
     {
         ITopClient client = TBManager.GetClient();
         PictureUserinfoGetRequest  req      = new PictureUserinfoGetRequest();
         PictureUserinfoGetResponse response = client.Execute(req, Users.SessionKey);
         return(response.UserInfo);
     }
     catch (Exception ex)
     {
         ExceptionReporter.WriteLog(ex, ExceptionPostion.TopApi);
         return(null);
     }
 }
Пример #5
0
 /// <summary>
 /// 获取图片分类信息
 /// </summary>
 /// <returns></returns>
 public static List <PictureCategory> GetPicCatalog()
 {
     try
     {
         ITopClient client = TBManager.GetClient();
         PictureCategoryGetRequest  req      = new PictureCategoryGetRequest();
         PictureCategoryGetResponse response = client.Execute(req, Users.SessionKey);
         return(response.PictureCategories);
     }
     catch (Exception ex)
     {
         ExceptionReporter.WriteLog(ex, ExceptionPostion.TopApi);
         return(null);
     }
 }
Пример #6
0
 /// <summary>
 /// 返回商品在售的总数
 /// </summary>
 /// <param name="sessionKey"></param>
 /// <returns></returns>
 public static string GetAllOnSalePro(string sessionKey)
 {
     try
     {
         ITopClient            client = TBManager.GetClient();
         ItemsOnsaleGetRequest req    = new ItemsOnsaleGetRequest();
         req.Fields = "num_iid";
         ItemsOnsaleGetResponse response = client.Execute(req, sessionKey);
         return(response.TotalResults.ToString());
     }
     catch (Exception ex)
     {
         ExceptionReporter.WriteLog(ex, ExceptionPostion.TopApi);
         return("0");
     }
 }
Пример #7
0
 public static List <LogisticsCompany> GetTBLogistics()
 {
     try
     {
         ITopClient client = TBManager.GetClient();
         LogisticsCompaniesGetRequest req = new LogisticsCompaniesGetRequest();
         req.Fields = "code,name";
         LogisticsCompaniesGetResponse response = client.Execute(req);
         return(response.LogisticsCompanies);
     }
     catch (Exception ex)
     {
         CHENGTUAN.Components.ExceptionReporter.WriteLog(ex, CHENGTUAN.Entity.ExceptionPostion.TopApi);
         return(null);
     }
 }
Пример #8
0
 /// <summary>
 /// 更具图片ID获取图片大小
 /// </summary>
 /// <param name="picID"></param>
 /// <returns></returns>
 public static List <Picture> GetPicsByPicID(long picID)
 {
     try
     {
         ITopClient        client = TBManager.GetClient();
         PictureGetRequest req    = new PictureGetRequest();
         req.PictureId = picID;
         PictureGetResponse response = client.Execute(req, Users.SessionKey);
         return(response.Pictures);
     }
     catch (Exception ex)
     {
         ExceptionReporter.WriteLog(ex, ExceptionPostion.TopApi);
         return(null);
     }
 }
Пример #9
0
 public static Boolean DeleleInvalidPic(string picIDs)
 {
     try
     {
         ITopClient           client = TBManager.GetClient();
         PictureDeleteRequest req    = new PictureDeleteRequest();
         req.PictureIds = picIDs;
         PictureDeleteResponse response = client.Execute(req, Users.SessionKey);
         return(response.Success);
     }
     catch (Exception ex)
     {
         ExceptionReporter.WriteLog(ex, ExceptionPostion.TopApi);
         return(false);
     }
 }
Пример #10
0
 /// <summary>
 /// 查询卖家地址库
 /// </summary>
 /// <param name="strSessionKey"></param>
 /// <param name="buyerNick"></param>
 /// <returns></returns>
 public static List <AddressResult> GetSellerAddress(string strSessionKey)
 {
     try
     {
         ITopClient client = TBManager.GetClient();
         LogisticsAddressSearchRequest req = new LogisticsAddressSearchRequest();
         req.Rdef = "get_def";
         LogisticsAddressSearchResponse rsp = client.Execute(req, strSessionKey);
         return(rsp.Addresses);
     }
     catch (Exception ex)
     {
         ExceptionReporter.WriteLog(ex, ExceptionPostion.TopApi);
         return(null);
     }
 }
Пример #11
0
 /// <summary>
 /// 获取单个商品详细信息
 /// </summary>
 /// <param name="sessionKey"></param>
 /// <param name="itemNo"></param>
 /// <returns></returns>
 public static Item GetItemByID(string sessionKey, string itemNo)
 {
     try
     {
         ITopClient           client = TBManager.GetClient();
         ItemSellerGetRequest req    = new ItemSellerGetRequest();
         req.NumIid = Convert.ToInt64(itemNo);
         req.Fields = "pic_url,detail_url,title, price, sold_quantity";
         ItemSellerGetResponse response = client.Execute(req, sessionKey);
         return(response.Item);
     }
     catch (Exception ex)
     {
         //ExceptionReporter.WriteLog(ex, ExceptionPostion.TopApi);
         return(null);
     }
 }
Пример #12
0
 /// <summary>
 /// 获取前台展示的店铺内卖家自定义商品类目
 /// </summary>
 /// <param name="sessionKey"></param>
 /// <param name="sellerNick"></param>
 /// <returns></returns>
 public static List <ShopCat> GetCatsList(string sessionKey, string sellerNick)
 {
     try
     {
         ITopClient             client = TBManager.GetClient();
         ShopcatsListGetRequest req    = new ShopcatsListGetRequest();
         //req.Nick = sellerNick;
         req.Fields = "cid,name";
         ShopcatsListGetResponse response = client.Execute(req, sessionKey);
         return(response.ShopCats);
     }
     catch (Exception ex)
     {
         //ExceptionReporter.WriteLog(ex, ExceptionPostion.TopApi);
         return(null);
     }
 }
Пример #13
0
 public Trade GetBuyerInfoByTid(long tid)
 {
     try
     {
         ITopClient client           = TBManager.GetClient();
         TradeFullinfoGetRequest req = new TradeFullinfoGetRequest();
         req.Fields = "receiver_name,receiver_mobile,status";
         req.Tid    = tid;
         TradeFullinfoGetResponse response = client.Execute(req, Users.SessionKey);
         return(response.Trade);
     }
     catch (Exception ex)
     {
         CHENGTUAN.Components.ExceptionReporter.WriteLog(ex, CHENGTUAN.Entity.ExceptionPostion.TopApi);
         return(null);
     }
 }
Пример #14
0
 /// <summary>
 /// 根据条件关闭订单
 /// </summary>
 /// <param name="tid"></param>
 /// <param name="closeReason"></param>
 /// <returns></returns>
 public Trade CloseTradeOrders(long tid, string closeReason)
 {
     try
     {
         ITopClient        client = TBManager.GetClient();
         TradeCloseRequest req    = new TradeCloseRequest();
         req.Tid         = tid;
         req.CloseReason = closeReason;
         TradeCloseResponse response = client.Execute(req, Users.SessionKey);
         return(response.Trade);
     }
     catch (Exception ex)
     {
         ExceptionReporter.WriteLog(ex, ExceptionPostion.TopApi);
         return(null);
     }
 }
Пример #15
0
 /// <summary>
 /// 只能获取到三个月以内的交易信息
 /// TradesSoldGetRequest 获取单笔交易的详细信息
 /// </summary>
 /// <param name="sellerNick">根据买家昵称获取交易信息</param>
 /// <param name="buyerNick"></param>
 /// <returns></returns>
 public List <Trade> GetBuyerTrade(string strSessionKey, string buyerNick)
 {
     try
     {
         ITopClient           client = TBManager.GetClient();
         TradesSoldGetRequest req    = new TradesSoldGetRequest();
         req.Fields    = @"tid,buyer_nick,seller_nick,receiver_name,receiver_state,receiver_city,receiver_district,receiver_address,receiver_mobile,buyer_email";
         req.BuyerNick = buyerNick;
         TradesSoldGetResponse response = client.Execute(req, strSessionKey);
         return(response.Trades);
     }
     catch (Exception ex)
     {
         ExceptionReporter.WriteLog(ex, ExceptionPostion.TopApi);
         return(null);
     }
 }
Пример #16
0
 /// <summary>
 /// 订单关闭
 /// </summary>
 /// <param name="tid"></param>
 /// <param name="reason"></param>
 /// <returns></returns>
 public Trade CloseOrderByTradeID(long tid, string reason)
 {
     try
     {
         ITopClient        client = TBManager.GetClient();
         TradeCloseRequest req    = new TradeCloseRequest();
         req.Tid         = tid;
         req.CloseReason = reason;
         TradeCloseResponse response = client.Execute(req, Users.SessionKey);
         return(response.Trade);
     }
     catch (Exception ex)
     {
         CHENGTUAN.Components.ExceptionReporter.WriteLog(ex, CHENGTUAN.Entity.ExceptionPostion.TopApi);
         return(null);
     }
 }
Пример #17
0
 public static VasSubscribeGetResponse GetSellerSubscrib(string sellerNick, string articleCode)
 {
     try
     {
         ITopClient             client = TBManager.GetClient();
         VasSubscribeGetRequest req    = new VasSubscribeGetRequest();
         req.Nick        = sellerNick;
         req.ArticleCode = articleCode;
         VasSubscribeGetResponse response = client.Execute(req);
         return(response);
     }
     catch (Exception ex)
     {
         ExceptionReporter.WriteLog(ex, ExceptionPostion.TopApi);
         return(null);
     }
 }
Пример #18
0
 public global::Top.Api.Domain.Shop Get(string parameter, int pageIndex, int pageNum, long total)
 {
     try
     {
         ITopClient     client = TBManager.GetClient();
         ShopGetRequest req    = new ShopGetRequest();
         req.Fields = "sid,cid,nick,title,desc,bulletin,pic_path,created,modified,shop_score";
         req.Nick   = Users.Nick;
         ShopGetResponse response = client.Execute(req, Users.SessionKey);
         return(response.Shop);
     }
     catch (Exception ex)
     {
         CHENGTUAN.Components.ExceptionReporter.WriteLog(ex, CHENGTUAN.Entity.ExceptionPostion.TBApply_Components);
         return(null);
     }
 }
Пример #19
0
        public List <ItemProp> Shop(long cid)
        {
            ItempropsGetResponse response = null;

            try
            {
                ITopClient          client = TBManager.GetClient();
                ItempropsGetRequest req    = new ItempropsGetRequest();
                req.Fields = "pid,name,must,multi,prop_values";
                req.Cid    = cid;
                response   = client.Execute(req, Users.SessionKey);
            }
            catch (Exception ex)
            {
                CHENGTUAN.Components.ExceptionReporter.WriteLog(ex, CHENGTUAN.Entity.ExceptionPostion.TBApply_Components);
            }
            return(response.ItemProps);
        }
Пример #20
0
 public static void StartNotify()
 {
     if (!AppCusBLL.CheckAppCusIsExit(Users.Nick))
     {
         ITopClient            client   = TBManager.GetClient();
         TmcUserPermitRequest  req      = new TmcUserPermitRequest();
         TmcUserPermitResponse response = client.Execute(req, Users.SessionKey);
         AppCustomer           appCus   = null;
         if (response.IsSuccess)
         {
             appCus         = new AppCustomer();
             appCus.Status  = "1";
             appCus.Nick    = Users.Nick;
             appCus.Created = DateTime.Now.ToShortDateString();
             AppCusBLL.AddAppCus(appCus);
         }
     }
 }
Пример #21
0
 /// <summary>
 /// 自己联系物流(线下物流)发货
 /// </summary>
 /// <param name="strSessionKey"></param>
 /// <param name="tid"></param>
 /// <param name="outSid"></param>
 /// <param name="companyCode"></param>
 /// <returns></returns>
 public static Boolean LogisticsOfflineSend(string strSessionKey, string tid, string outSid, string companyCode)
 {
     try
     {
         ITopClient client = TBManager.GetClient();
         LogisticsOfflineSendRequest req = new LogisticsOfflineSendRequest();
         req.Tid         = long.Parse(tid);
         req.OutSid      = outSid;
         req.CompanyCode = companyCode;
         LogisticsOfflineSendResponse rsp = client.Execute(req, strSessionKey);
         return(rsp.Shipping.IsSuccess);
     }
     catch (Exception ex)
     {
         ExceptionReporter.WriteLog(ex, ExceptionPostion.TopApi);
         return(false);
     }
 }
Пример #22
0
 /// <summary>
 /// 获取当前会话用户出售中的商品列表
 /// </summary>
 /// <param name="strSessionKey"></param>
 /// <returns></returns>
 public static List <Item> GetItemsOnSale(string strSessionKey, string pageSize, string pageNo)
 {
     try
     {
         ITopClient            client = TBManager.GetClient();
         ItemsOnsaleGetRequest req    = new ItemsOnsaleGetRequest();
         req.Fields   = @"num_iid,outer_id,bar_code,price,seller_cids,pic_url,title";
         req.PageNo   = long.Parse(pageNo);
         req.PageSize = long.Parse("200");
         ItemsOnsaleGetResponse rsp = client.Execute(req, strSessionKey);
         return(rsp.Items);
     }
     catch (Exception ex)
     {
         ExceptionReporter.WriteLog(ex, ExceptionPostion.TopApi);
         return(null);
     }
 }
Пример #23
0
        /// <summary>
        /// 获取单笔交易的详细信息
        /// </summary>
        /// <param name="strSessionKey"></param>
        /// <param name="tid"></param>
        /// <returns></returns>
        public static Trade GetTradeByTid(string strSessionKey, string tid)
        {
            try
            {
                ITopClient client           = TBManager.GetClient();
                TradeFullinfoGetRequest req = new TradeFullinfoGetRequest();
                req.Fields = @"tid,type,buyer_nick,receiver_name,receiver_state,receiver_city,receiver_district,receiver_address,
               receiver_mobile,receiver_phone,receiver_zip,buyer_area,post_fee,created,seller_nick,payment,status,shipping_type,pay_time,modified,
orders.outer_iid,orders.discount_fee,orders.payment,orders.refund_status,orders.status,orders.pic_path,orders.sku_properties_name,orders.adjust_fee,
orders.outer_sku_id,orders.cid,orders.refund_id,orders.item_meal_name,orders.num,orders.title,orders.price,orders.oid,orders.total_fee,orders.num_iid,orders.sku_id,orders.seller_type";
                req.Tid    = long.Parse(tid);
                TradeFullinfoGetResponse rsp = client.Execute(req, strSessionKey);
                return(rsp.Trade);
            }
            catch (Exception ex)
            {
                ExceptionReporter.WriteLog(ex, ExceptionPostion.TopApi);
                return(null);
            }
        }
Пример #24
0
 public static Boolean orderBatchSending(string tid, string yundanID, string companyCode)
 {
     try
     {
         ITopClient client = TBManager.GetClient();
         LogisticsOfflineSendRequest req = new LogisticsOfflineSendRequest();
         req.Tid = Convert.ToInt64(tid);
         //req.SubTid = "1,2,3";
         //req.IsSplit = 0L;
         req.OutSid      = yundanID;
         req.CompanyCode = companyCode;
         LogisticsOfflineSendResponse response = client.Execute(req, Users.SessionKey);
         return(response.Shipping.IsSuccess);
     }
     catch (Exception ex)
     {
         CHENGTUAN.Components.ExceptionReporter.WriteLog(ex, CHENGTUAN.Entity.ExceptionPostion.TopApi);
         return(false);
     }
 }
Пример #25
0
 /// <summary>
 /// 查询买家的信誉等级
 /// </summary>
 /// <param name="buyerNick"></param>
 /// <returns></returns>
 public User GetBuyerDetailInfo(string strSessionKey, string buyerNick)
 {
     try
     {
         ITopClient     client = TBManager.GetClient();
         UserGetRequest req    = new UserGetRequest();
         req.Fields = "buyer_credit";
         req.Nick   = buyerNick;
         UserGetResponse response = client.Execute(req, strSessionKey);
         if (response.IsError)
         {
             ExceptionReporter.WriteLog("GetBuyerDetailInfo:" + response.SubErrCode + ":" + response.SubErrMsg, null, ExceptionPostion.TopApi, ExceptionRank.important);
             return(null);
         }
         return(response.User);
     }
     catch (Exception ex)
     {
         ExceptionReporter.WriteLog(ex, ExceptionPostion.TopApi);
         return(null);
     }
 }
Пример #26
0
 /// <summary>
 ///  可生成店铺宝贝、店铺首页、活动链接等3种可呼起手机淘宝APP的短链。
 /// </summary>
 /// <returns></returns>
 public static string SetShortLink(string shortLinkName, string linkType, string shortLinkData, ref string msg)
 {
     try
     {
         ITopClient client = TBManager.GetClient();
         CrmServiceChannelShortlinkCreateRequest req = new CrmServiceChannelShortlinkCreateRequest();
         req.ShortLinkName = shortLinkName;
         req.LinkType      = linkType;
         if (!linkType.Equals("LT_SHOP"))
         {
             req.ShortLinkData = shortLinkData;
         }
         CrmServiceChannelShortlinkCreateResponse response = client.Execute(req, Users.SessionKey);
         msg = response.SubErrCode;
         return(response.ShortLink);
     }
     catch (Exception ex)
     {
         ExceptionReporter.WriteLog(ex, ExceptionPostion.TopApi);
         return("0");
     }
 }
Пример #27
0
 /// <summary>
 /// 调用API进行批量评价
 /// </summary>
 /// <param name="currentPage"></param>
 /// <param name="pagesize"></param>
 /// <param name="total"></param>
 /// <returns></returns>
 public TradeRate BuyerTradeRate(RateConfig rateObj, ref string content)
 {
     try
     {
         ITopClient client           = TBManager.GetClient();
         TraderateListAddRequest req = new TraderateListAddRequest();
         req.Tid    = rateObj.Tid;
         req.Result = rateObj.Result;
         req.Role   = "seller";
         string[] strs = { rateObj.Content1, rateObj.Content2, rateObj.Content3 };//随机选择评价内容
         Random   rand = new Random(System.Guid.NewGuid().GetHashCode());
         req.Content = strs[rand.Next(0, strs.Length)];
         content     = req.Content;
         TraderateListAddResponse response = client.Execute(req, Users.SessionKey);
         return(response.TradeRate);
     }
     catch (Exception ex)
     {
         ExceptionReporter.WriteLog(ex, ExceptionPostion.TopApi);
         return(null);
     }
 }
Пример #28
0
 /// <summary>
 /// 搜索评价信息:只能获取距今180天内的评价记录(只支持查询卖家给出或得到的评价)
 /// </summary>
 /// <param name="rateObj"></param>
 /// <returns></returns>
 public List <TradeRate> GetTradeRate(Int64 currentPage, Int64 pagesize, string getStartDate, string getEndDate, ref Int64 total)
 {
     try
     {
         if (currentPage == 0)
         {
             currentPage = 1L;
         }
         if (pagesize == 0)
         {
             pagesize = 100;
         }
         ITopClient           client = TBManager.GetClient();
         TraderatesGetRequest req    = new TraderatesGetRequest();
         req.Fields   = "tid,nick,result,created,item_title,content";
         req.RateType = "get";
         //req.Role = "seller";
         req.Role = "buyer";
         //req.Result = "good";
         req.PageNo   = currentPage;
         req.PageSize = pagesize;
         if (!string.IsNullOrEmpty(getStartDate))
         {
             req.StartDate = Convert.ToDateTime(getStartDate);
         }
         if (!string.IsNullOrEmpty(getEndDate))
         {
             req.EndDate = Convert.ToDateTime(getEndDate);
         }
         TraderatesGetResponse response = client.Execute(req, Users.SessionKey);
         total = response.TotalResults;
         return(response.TradeRates);
     }
     catch (Exception ex)
     {
         ExceptionReporter.WriteLog(ex, ExceptionPostion.TopApi);
         return(null);
     }
 }
Пример #29
0
 public List <CrmMember> GetBuyer(string strSessionKey, Int64 currentPage, Int64 pagesize, string getMemberStartDate, string getMemberEndDate)
 {
     try
     {
         if (currentPage == 0)
         {
             currentPage = 1L;
         }
         if (pagesize == 0)
         {
             pagesize = 100;
         }
         ITopClient client           = TBManager.GetClient();
         CrmMembersSearchRequest req = new CrmMembersSearchRequest();
         req.CurrentPage = currentPage;
         req.PageSize    = pagesize;
         if (!string.IsNullOrEmpty(getMemberStartDate))
         {
             req.MinLastTradeTime = Convert.ToDateTime(getMemberStartDate);
         }
         if (!string.IsNullOrEmpty(getMemberEndDate))
         {
             req.MaxLastTradeTime = Convert.ToDateTime(getMemberEndDate);
         }
         CrmMembersSearchResponse response = client.Execute(req, strSessionKey);
         if (response.IsError)
         {
             ExceptionReporter.WriteLog(response.SubErrMsg, ExceptionPostion.TopApi, ExceptionRank.important);
             throw new Exception();
         }
         return(response.Members);
     }
     catch (Exception ex)
     {
         ExceptionReporter.WriteLog(ex, ExceptionPostion.TopApi);
         return(null);
     }
 }
Пример #30
0
 /// <summary>
 /// 优化为一次性读取卖家最近3个月的交易数据
 /// </summary>
 /// <param name="strSessionKey"></param>
 /// <param name="pageNum"></param>
 /// <param name="hasNext"></param>
 /// <returns></returns>
 public List <Trade> GetBuyerTrades(string strSessionKey, Int64 pageNum, ref bool hasNext)
 {
     try
     {
         ITopClient           client = TBManager.GetClient();
         TradesSoldGetRequest req    = new TradesSoldGetRequest();
         req.Fields       = @"tid,buyer_nick,seller_nick,receiver_name,receiver_state,receiver_city,receiver_district,receiver_address,receiver_mobile,buyer_email";
         req.PageNo       = pageNum;
         req.StartCreated = Convert.ToDateTime(DateTime.Now.AddMonths(-3));
         req.EndCreated   = Convert.ToDateTime(DateTime.Now);
         req.UseHasNext   = true;
         req.PageSize     = 100L;
         TradesSoldGetResponse response = client.Execute(req, strSessionKey);
         hasNext = response.HasNext; //是否有下一页
         return(response.Trades);    //返回信息数组,数组对象的属性为fields的参数
     }
     catch (Exception ex)
     {
         File.WriteAllText(@"D:\log\" + strSessionKey + ".txt", ex.Message, Encoding.Default);
         ExceptionReporter.WriteLog(ex, ExceptionPostion.TopApi);
         return(null);
     }
 }