Esempio n. 1
0
 public string UpdateIPList(string strjson)
 {
     try
     {
         if (string.IsNullOrEmpty(strjson))
         {
             return(Json.Write(-1, "参数JSON格式错误"));
         }
         Dictionary <string, string> dic = MyJson.JsonToDictionary(strjson);
         if (dic.Count == 0)
         {
             return(Json.Write(-1, "参数JSON格式错误"));
         }
         string equipmentname = string.Empty;
         string iplist        = string.Empty;
         if (dic.TryGetValue("equipmentname", out equipmentname) == false)
         {
             return(Json.Write(-1, "设备名称无法识别"));
         }
         if (dic.TryGetValue("iplist", out iplist) == false)
         {
             return(Json.Write(-1, "IP列表无法识别"));
         }
         ReturnValue retVal = equLogic.UpdateIPList(new EquipmentInfo()
         {
             IPList = iplist, EIName = equipmentname
         });
         return(Json.Write(retVal.RetCode, retVal.RetMsg));
     }
     catch (Exception ex)
     {
         return(Json.Write(-1, Consts.EXP_Info));
     }
 }