Ejemplo n.º 1
0
 /// <summary>
 /// 调用API获取会员数据
 /// </summary>
 /// <param name="currentPage"></param>
 /// <param name="pagesize"></param>
 /// <param name="total"></param>
 /// <returns></returns>
 public List <CrmMember> GetBuyer(string strSessionKey, Int64 currentPage, Int64 pagesize, ref Int64 total)
 {
     try
     {
         if (currentPage == 0)
         {
             currentPage = 1L;
         }
         if (pagesize == 0)
         {
             pagesize = 100;
         }
         ITopClient client           = TBManager.GetClient();
         CrmMembersSearchRequest req = new CrmMembersSearchRequest();
         //req.MaxLastTradeTime = DateTime.Now.AddMonths(-3);
         req.CurrentPage = currentPage;
         req.PageSize    = pagesize;
         CrmMembersSearchResponse response = client.Execute(req, strSessionKey);
         if (response.IsError)
         {
             ExceptionReporter.WriteLog(response.SubErrMsg, ExceptionPostion.TopApi, ExceptionRank.important);
         }
         total = response.TotalResult;
         return(response.Members);
     }
     catch (Exception ex)
     {
         ExceptionReporter.WriteLog(ex, ExceptionPostion.TopApi);
         return(null);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 调用API获取会员数据
 /// </summary>
 /// <param name="currentPage"></param>
 /// <param name="pagesize"></param>
 /// <returns></returns>
 public List <CrmMember> GetBuyer(string strSessionKey, Int64 currentPage, Int64 pagesize)
 {
     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;
         CrmMembersSearchResponse response = client.Execute(req, strSessionKey);
         if (response.IsError)
         {
             ExceptionReporter.WriteLog("GetBuyer:" + response.SubErrCode + ":" + response.SubErrMsg, null, ExceptionPostion.TopApi, ExceptionRank.important);
         }
         return(response.Members);
     }
     catch (Exception ex)
     {
         ExceptionReporter.WriteLog(ex, ExceptionPostion.TopApi);
         return(null);
     }
 }
Ejemplo n.º 3
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);
     }
 }