From 0fa1534827bd21d763216550d11006fc1441c6cb Mon Sep 17 00:00:00 2001 From: tzy <hxb@hdlchina.com.cn> Date: 星期五, 14 五月 2021 17:08:45 +0800 Subject: [PATCH] 门锁初始上传 --- HDL_ON/DAL/Server/HttpServerRequest.cs | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 58 insertions(+), 0 deletions(-) diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs index ae86846..1da652c 100644 --- a/HDL_ON/DAL/Server/HttpServerRequest.cs +++ b/HDL_ON/DAL/Server/HttpServerRequest.cs @@ -2245,5 +2245,63 @@ 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 } } \ No newline at end of file -- Gitblit v1.8.0