| | |
| | | /// <returns></returns> |
| | | public string GetAttrState(string key) |
| | | { |
| | | //一级查询keyValue值 |
| | | var attrState = attributes.Find((s) => s.key == key.ToString()); |
| | | if (attrState == null || string.IsNullOrEmpty(attrState.state)) |
| | | if (attrState == null) |
| | | { |
| | | return "0"; |
| | | } |
| | | if (string.IsNullOrEmpty(attrState.state)) |
| | | { |
| | | //二级查询keyValue值 |
| | | return GetOriginalState(key); |
| | | } |
| | | return attrState.state; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取初始状态 |
| | | /// 默认值:0 |
| | | /// </summary> |
| | | /// <param name="key">语雀定义的属性值</param> |
| | | /// <returns></returns> |
| | | public string GetOriginalState(string key) |
| | | { |
| | | var originalState = status.Find((s) => s.key == key.ToString()); |
| | | if (originalState == null || string.IsNullOrEmpty(originalState.value)) |
| | | { |
| | | return "0"; |
| | | } |
| | | return originalState.value; |
| | | } |
| | | /// <summary> |
| | | /// 设置属性状态 |
| | |
| | | SaveFunctionFile(); |
| | | if (pack.Code == StateCode.SUCCESS) |
| | | { |
| | | if (UI.RoomPage.bodyView != null) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | UI.RoomPage.bodyView.ReLoadPage(); |
| | | }); |
| | | } |
| | | } |
| | | else |
| | | { |
| | |
| | | sendDataObj.time_stamp = Utlis.GetTimestamp(); |
| | | var acd = new AlinkDoorlockStatus(); |
| | | acd.sid = sid; |
| | | acd.user_id = userId; |
| | | acd.user_id = extStr; |
| | | acd.ext_str = extStr; |
| | | #if DEBUG |
| | | acd.user_id = "013"; |
| | | acd.ext_str = "999999"; |
| | | #endif |
| | | sendDataObj.objects.Add(acd); |
| | | return sendDataObj; |
| | | } |