| | |
| | | IsOthreShare = mHome.IsOtherShare, |
| | | accountType = mHome.accountType, |
| | | isRemoteControl = mHome.isRemoteControl, |
| | | isBindGateway = mHome.isBindGateway, |
| | | longitude = mHome.longitude, |
| | | latitude = mHome.latitude, |
| | | deliverstatus = mHome.deliverstatus, |
| | |
| | | Address = mHome.homeAddress, |
| | | isAllowCreateScene = mHome.isAllowCreateScene, |
| | | }; |
| | | UserInfo.Current.regionList.Add(home); |
| | | //if (home.isBindGateway) |
| | | { |
| | | UserInfo.Current.regionList.Add(home); |
| | | } |
| | | } |
| | | if(UserInfo.Current.regionList.Count== 0) |
| | | { |
| | | return "null"; |
| | | } |
| | | //-------如果账号是首次登录 |
| | | if (DB_ResidenceData.Instance.CurrentRegion == null || string.IsNullOrEmpty(DB_ResidenceData.Instance.CurrentRegion.RegionID)) |
| | |
| | | public ResponsePackNew EZGetChildToken() |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | //d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_EZ_GetChildToken, requestJson); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region 可视对讲 |
| | | /// <summary> |
| | | /// 检查住宅是否绑定丰林,并获取门口机列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResponsePackNew CheckFlVideo() |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome( NewAPI.API_POST_FL_Check, requestJson); |
| | | return pack; |
| | | } |
| | | #endregion |
| | | |
| | | #region ■ 门锁历史记录________________________ |
| | | |
| | | /// <summary> |
| | | /// 获取门锁历史记录(按日期降序) |
| | | /// </summary> |
| | | /// <param name="i_device">设备对象</param> |
| | | /// <returns></returns> |
| | | public List<Stan.DoorHistoryLog> GetDoorHistoryLogs(Function i_device) |
| | | { |
| | | //测试 |
| | | var listLog = new List<Stan.DoorHistoryLog>(); |
| | | for (int i = 1; i <= 3; i++) |
| | | { |
| | | var logInfo = new Stan.DoorHistoryLog { StrMsg = "电量低,请更换电池" }; |
| | | logInfo.Time = new DateTime(2000, 5, 6, 10, 45, 23).AddDays(i); |
| | | listLog.Add(logInfo); |
| | | } |
| | | for (int i = 1; i <= 3; i++) |
| | | { |
| | | var logInfo = new Stan.DoorHistoryLog { StrMsg = "电量低,请更换电池" }; |
| | | logInfo.Time = new DateTime(2001, 5, 6, 10, 45, 23).AddDays(i); |
| | | listLog.Add(logInfo); |
| | | } |
| | | for (int i = 1; i <= 3; i++) |
| | | { |
| | | var logInfo = new Stan.DoorHistoryLog { StrMsg = "电量低,请更换电池" }; |
| | | logInfo.Time = new DateTime(2002, 5, 6, 10, 45, 23).AddDays(i); |
| | | listLog.Add(logInfo); |
| | | } |
| | | |
| | | //按时间降序 |
| | | var listSortLog = new List<Stan.DoorHistoryLog>(); |
| | | foreach (var logInfo in listLog) |
| | | { |
| | | bool canAdd = true; |
| | | for (int i = 0; i < listSortLog.Count; i++) |
| | | { |
| | | if (logInfo.Time > listSortLog[i].Time) |
| | | { |
| | | //时间比当前的索引大,则插入到它的前面 |
| | | listSortLog.Insert(i, logInfo); |
| | | canAdd = false; |
| | | break; |
| | | } |
| | | } |
| | | if (canAdd == true) |
| | | { |
| | | //日期最小,则添加到末尾 |
| | | listSortLog.Add(logInfo); |
| | | } |
| | | } |
| | | //提示 |
| | | //IMessageCommon.Current.ShowErrorInfoAlter(responePack.Code); |
| | | return listSortLog; |
| | | } |
| | | |
| | | #endregion |
| | | } |
| | | } |