Esempio n. 1
0
 /// <summary>
 /// 拉取黑白名单
 /// </summary>
 public void GetWhiteAndBlack()
 {
     #region 拉取黑白名单
     WhiteEnable = HttpService.GetWhiteState();
     BlackEnable = HttpService.GetBlackState();
     var BlackWhiteList = HttpService.GetBlackWhiteList();
     if (BlackWhiteList != null && BlackWhiteList.dataList != null)
     {
         BlackDY.Clear();
         WhiteDY.Clear();
         foreach (var v in BlackWhiteList.dataList)
         {
             if (v.type == "0")//黑名单
             {
                 if (!BlackDY.ContainsKey(v.companyName))
                 {
                     BlackDY.Add(v.companyName, v);
                 }
                 else
                 {
                     BlackDY[v.companyName] = v;
                 }
             }
             else if (v.type == "1")//白名单
             {
                 if (!WhiteDY.ContainsKey(v.companyName))
                 {
                     WhiteDY.Add(v.companyName, v);
                 }
                 else
                 {
                     WhiteDY[v.companyName] = v;
                 }
             }
         }
     }
     #endregion
 }