private async void SetReadStatus(NoticeReadStatusDto readStatusDto) { if (_commonHelper.IsNetWorkConnected() == true) { try { var result = await _notifiMngService.UpdateReaderReadStatus(readStatusDto); if (result.ResultCode == Module.ResultType.Success) { _commonFun.HideLoading(); MessagingCenter.Send <string>("", MessageConst.NOTIFI_SAVEREFRESH_GO); } else { _commonFun.HideLoading(); _commonFun.AlertLongText("保存失败,请重试。 " + result.Msg); } } catch (OperationCanceledException) { _commonFun.HideLoading(); _commonFun.AlertLongText("请求超时。"); } catch (Exception) { _commonFun.HideLoading(); _commonFun.AlertLongText("保存异常,请重试。"); } finally { _commonFun.HideLoading(); } } else { _commonFun.AlertLongText("网络连接异常。"); } }
public async Task <APIResult> UpdateReaderReadStatus(NoticeReadStatusDto paramDto) { string spName = @"up_RMMT_NOT_UpdateReaderReadStatus_U"; DynamicParameters dp = new DynamicParameters(); dp.Add("@NoticeId", paramDto.NoticeId); dp.Add("@DisId", paramDto.DisId); dp.Add("@DepartId", paramDto.DepartId); dp.Add("@InUserId", paramDto.InUserId); using (var conn = new SqlConnection(DapperContext.Current.SqlConnection)) { conn.Open(); using (var tran = conn.BeginTransaction(System.Data.IsolationLevel.ReadCommitted)) { try { await conn.QueryAsync <string>(spName, dp, tran, null, CommandType.StoredProcedure); tran.Commit(); } catch (Exception ex) { tran.Rollback(); return(new APIResult { Body = "", ResultCode = ResultType.Failure, Msg = ex.Message }); } finally { tran.Dispose(); } } return(new APIResult { Body = "", ResultCode = ResultType.Success, Msg = "" }); } }
//将未读变更为已读 public async Task <APIResult> UpdateReaderReadStatus(NoticeReadStatusDto readStatusDto) { APIResult info = await _commonHelper.HttpPOST <APIResult>(baseUrl, _config.Get <string>($"{Config.Config.Endpoints_Paths}.UpdateReaderReadStatus"), readStatusDto); return(info); }
public void Init(string noticeId, int disId = 0, int departId = 0, string noticeStatus = "") { try { MessagingCenter.Send <string>(noticeStatus, MessageConst.NOTICE_MADE_SETCONTROLROLE); IsLoading = false; if (noticeId == "0") { NoticeTitle = string.Empty; NoticeNo = string.Empty; StartNoticeDate = DateTime.Now; EndNoticeDate = DateTime.Now; NoticeReadersSelect = "选择经销商"; NoticeReadersColor = StaticColor.ContentFontColor; DisHasSelect = false; NoticeSelectDep = "选择角色"; NoticeColorDep = StaticColor.ContentFontColor; DepHasSelect = false; MessagingCenter.Send <List <MultiSelectDto> >(new List <MultiSelectDto>(), MessageConst.NOTICE_DISTRIBUTOR_SHOW); MessagingCenter.Send <List <MultiSelectDto> >(new List <MultiSelectDto>(), MessageConst.NOTICE_DEPARTMENT_SHOW); NoticeContent = string.Empty; ReplySelected = 0; oldAttachmentList = new List <AttachDto>(); NotifiAttachmentList = new List <AttachDto>(); LstHeight = 0; NoticeMngPageTitle = "通知拟定"; _noticeId = 0; AllDepItems = new List <MultiSelectDto>(); AllDisItems = new List <MultiSelectDto>(); } else { AllDisItems = new List <MultiSelectDto>(); AllDepItems = new List <MultiSelectDto>(); SetNoticeDetail(noticeId); if ((CommonContext.Account.UserType == "S" || CommonContext.Account.UserType == "D") && noticeStatus == "U") { NoticeReadStatusDto readStatusDto = new NoticeReadStatusDto(); readStatusDto.NoticeId = Convert.ToInt32(noticeId); readStatusDto.DisId = disId; readStatusDto.DepartId = departId; readStatusDto.InUserId = Convert.ToInt32(CommonContext.Account.UserId); SetReadStatus(readStatusDto); } if (noticeStatus == "" || noticeStatus == "T") { NoticeMngPageTitle = "通知拟定"; } else { NoticeMngPageTitle = "通知详细"; } _noticeId = Convert.ToInt32(noticeId); } } catch (Exception) { _commonFun.AlertLongText("操作异常,请重试。-->NotifiMngViewModel"); return; } }
public async Task <APIResult> UpdateReaderReadStatus([FromBody] NoticeReadStatusDto paramDto) { return(await _notifiMngService.UpdateReaderReadStatus(paramDto)); }