Beispiel #1
0
 /// <summary>
 /// 自动获取关注数据
 /// </summary>
 private void GetFocusWare()
 {
     try
     {
         //确定采集模式为批量采集
         SysParams.GatherModel = GatherType.Batch;
         //1、登录京东
         JDKiller.GetInstance().InitProcess = InitProcess;
         JDKiller.GetInstance().EndProcess  = EndProcess;
         JDKiller.GetInstance().ShowStep    = ShowStep;
         JDKiller.GetInstance().ShowMessage = ShowMessage;
         ShowAutoMessage("开始登录");
         JDKiller.GetInstance().InitLogin(SysParams.JDUserName, SysParams.JDUserPass);
         if (JDKiller.GetInstance().Login4JD(""))
         {
             ShowAutoMessage("获取关注商品列表");
             //2、获取关注商品列表
             List <WebSiteModel> weburls = JDKiller.GetInstance().GetWatchList();
             if (weburls != null && weburls.Count > 0)
             {
                 ShowAutoMessage("导入关注数据");
                 //3、导入关注数据
                 WareImport.GetInstance().ShowStep    = null;
                 WareImport.GetInstance().EndProcess  = null;
                 WareImport.GetInstance().ShowMessage = null;
                 WareImport.GetInstance().ImportWareList(weburls);
                 ShowAutoMessage("导入完成");
             }
         }
         else
         {
             ShowAutoMessage("登录失败!");
         }
     }
     catch (Exception ex)
     {
         OtCom.XLogErr(ex.Message);
     }
 }
Beispiel #2
0
 public static WareImport GetInstance()
 {
     return(_inport ?? (_inport = new WareImport()));
 }
Beispiel #3
0
 public static WareImport GetInstance()
 {
     return _inport ?? (_inport = new WareImport());
 }