| | |
| | | /// <summary>
|
| | | /// 初始化中部信息
|
| | | /// </summary>
|
| | | private async void InitMiddleData(bool showReload)
|
| | | private void InitMiddleData(bool showReload)
|
| | | {
|
| | | //获取数据
|
| | | var dicData = await this.GetMessageData();
|
| | | var dicData = this.GetMessageData();
|
| | | if (dicData == null)
|
| | | {
|
| | | if (showReload == true)
|
| | |
| | | {
|
| | | //确认删除消息?
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.uDeleteMessageMsg);
|
| | | this.ShowMassage(ShowMsgType.Confirm, msg, async () =>
|
| | | this.ShowMassage(ShowMsgType.Confirm, msg, () =>
|
| | | {
|
| | | await this.DeleteMsg(recordInfo.Id, frameList, rowControl);
|
| | | this.DeleteMsg(recordInfo.Id, frameList, rowControl);
|
| | | });
|
| | | };
|
| | | }
|
| | |
| | | if (sender != null)
|
| | | {
|
| | | //标记已读(不管它成功不成功)
|
| | | await this.SetTickIsRead(recordInfo.Id);
|
| | | this.SetTickIsRead(recordInfo.Id);
|
| | | }
|
| | | };
|
| | | }
|
| | |
| | | /// 标记已读
|
| | | /// </summary>
|
| | | /// <param name="strId"></param>
|
| | | private async Task<bool> SetTickIsRead(string strId)
|
| | | private bool SetTickIsRead(string strId)
|
| | | {
|
| | | var pra = new MessageReadStatuPra();
|
| | | pra.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
|
| | | pra.Id = strId;
|
| | | var result = await UserCenterLogic.GetResultStatuByRequestHttps("MessageCenter/TagMessageMessageCenterItem", true, pra);
|
| | | var result = UserCenterLogic.GetResultStatuByRequestHttps("MessageCenter/TagMessageMessageCenterItem", true, pra);
|
| | | return result;
|
| | | }
|
| | |
|
| | |
| | | //确认标记全部消息为已读?
|
| | | this.ShowMassage(ShowMsgType.Confirm, Language.StringByID(R.MyInternationalizationString.uUnTipAllMessageMsg), () =>
|
| | | {
|
| | | HdlThreadLogic.Current.RunThread(async () =>
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | | //打开进度条
|
| | | this.ShowProgressBar();
|
| | |
| | | var pra = new MessageReadStatuPra();
|
| | | pra.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
|
| | | pra.TagAllOrClearType = 0;
|
| | | var result = await UserCenterLogic.GetResultStatuByRequestHttps("MessageCenter/TagAllOrClearMessageCenter", true, pra);
|
| | | var result = UserCenterLogic.GetResultStatuByRequestHttps("MessageCenter/TagAllOrClearMessageCenter", true, pra);
|
| | | //关闭进度条
|
| | | this.CloseProgressBar();
|
| | | if (result == false)
|
| | |
| | | /// <param name="strId"></param>
|
| | | /// <param name="frameList"></param>
|
| | | /// <param name="rowContr"></param>
|
| | | private async Task<bool> DeleteMsg(string strId, FrameListControl frameList, RowLayoutControl rowContr)
|
| | | private bool DeleteMsg(string strId, FrameListControl frameList, RowLayoutControl rowContr)
|
| | | {
|
| | | var pra = new MessageReadStatuPra();
|
| | | pra.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
|
| | | pra.Id = strId;
|
| | | var result = await UserCenterLogic.GetResultStatuByRequestHttps("MessageCenter/DelMessageCenterItem", true, pra);
|
| | | var result = UserCenterLogic.GetResultStatuByRequestHttps("MessageCenter/DelMessageCenterItem", true, pra);
|
| | | if (result == false)
|
| | | {
|
| | | return false;
|
| | |
| | | //确认删除全部消息?
|
| | | this.ShowMassage(ShowMsgType.Confirm, Language.StringByID(R.MyInternationalizationString.uDeleteAllMessageMsg), () =>
|
| | | {
|
| | | HdlThreadLogic.Current.RunThread(async () =>
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | | //打开进度条
|
| | | this.ShowProgressBar();
|
| | |
| | | var pra = new MessageReadStatuPra();
|
| | | pra.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
|
| | | pra.TagAllOrClearType = 1;
|
| | | var result = await UserCenterLogic.GetResultStatuByRequestHttps("MessageCenter/TagAllOrClearMessageCenter", true, pra);
|
| | | var result = UserCenterLogic.GetResultStatuByRequestHttps("MessageCenter/TagAllOrClearMessageCenter", true, pra);
|
| | | if (result == false)
|
| | | {
|
| | | //关闭进度条
|
| | |
| | | /// 获取消息记录
|
| | | /// </summary>
|
| | | /// <returns></returns>
|
| | | private async Task<Dictionary<string, List<List<MessageRecordInfo>>>> GetMessageData()
|
| | | private Dictionary<string, List<List<MessageRecordInfo>>> GetMessageData()
|
| | | {
|
| | | this.dicAllRow = new Dictionary<string, RowLayoutControl>();
|
| | | var allListData = new List<MessageRecordInfo>();
|
| | |
| | |
|
| | | //传感器上报
|
| | | pra.Topic = "/IASInfoReport";
|
| | | var dataInfo = await this.GetMessageDataFromDb(pra);
|
| | | var dataInfo = this.GetMessageDataFromDb(pra);
|
| | | if (dataInfo == null)
|
| | | {
|
| | | return null;
|
| | |
| | |
|
| | | //门锁上报
|
| | | pra.Topic = "/Alarms/SendAlarmInform";
|
| | | dataInfo = await this.GetMessageDataFromDb(pra);
|
| | | dataInfo = this.GetMessageDataFromDb(pra);
|
| | | if (dataInfo == null)
|
| | | {
|
| | | return null;
|
| | |
| | |
|
| | | //撤防
|
| | | pra.Topic = "/Security/WithdrawMode_Respon";
|
| | | dataInfo = await this.GetMessageDataFromDb(pra);
|
| | | dataInfo = this.GetMessageDataFromDb(pra);
|
| | | if (dataInfo == null)
|
| | | {
|
| | | return null;
|
| | |
| | |
|
| | | //布防
|
| | | pra.Topic = "/Security/EnableMode_Respon";
|
| | | dataInfo = await this.GetMessageDataFromDb(pra);
|
| | | dataInfo = this.GetMessageDataFromDb(pra);
|
| | | if (dataInfo == null)
|
| | | {
|
| | | return null;
|
| | |
| | |
|
| | | //逻辑触发上报
|
| | | pra.Topic = "/Logic/Execute_Respon";
|
| | | dataInfo = await this.GetMessageDataFromDb(pra);
|
| | | dataInfo = this.GetMessageDataFromDb(pra);
|
| | | if (dataInfo == null)
|
| | | {
|
| | | return null;
|
| | |
| | |
|
| | | //场景触发上报
|
| | | pra.Topic = "/Scene/Exec_Respon";
|
| | | dataInfo = await this.GetMessageDataFromDb(pra);
|
| | | dataInfo = this.GetMessageDataFromDb(pra);
|
| | | if (dataInfo == null)
|
| | | {
|
| | | return null;
|
| | |
| | | /// </summary>
|
| | | /// <param name="pra"></param>
|
| | | /// <returns></returns>
|
| | | private async Task<List<MessageRecordInfo>> GetMessageDataFromDb(MessageInfoPra pra)
|
| | | private List<MessageRecordInfo> GetMessageDataFromDb(MessageInfoPra pra)
|
| | | {
|
| | | var result = await UserCenterLogic.GetResponseDataByRequestHttps("MessageCenter/GetMessageCenterPagger", true, pra);
|
| | | if (result == null)
|
| | | var result = UserCenterLogic.GetResponseDataByRequestHttps("MessageCenter/GetMessageCenterPagger", true, pra);
|
| | | if (string.IsNullOrEmpty(result) == true)
|
| | | {
|
| | | return null;
|
| | | }
|