| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- /*-------------------------------------------------------------------------
- * 功能描述:RelationshipTools
- * 作者:李勇
- * 创建时间: 2018/10/31 17:59:46
- * 版本号:v1.0
- * -------------------------------------------------------------------------*/
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Newtonsoft.Json.Linq;
- namespace SAGA.GplotRelationComputerManage
- {
- public class RelationshipTools
- {
- /// <summary>
- /// 获取属性值
- /// </summary>
- /// <param name="equip"></param>
- /// <param name="propertyName"></param>
- /// <returns></returns>
- public static string GetValue(JObject equip, string propertyName)
- {
- // equip.GetValue("infos")
- string result = "";
- if (equip != null)
- {
- result = equip["infos"][propertyName] + "";
- //本地名称为空显示设备名称
- if (propertyName == "EquipLocalName" && result == "")
- {
- result = equip["infos"]["EquipName"] + "";
- }
- }
- return result;
- }
- }
- }
|