private async void ApproalSave(bool type) { try { if (ReplyContent == null || (ReplyContent != null && string.IsNullOrEmpty(ReplyContent.Trim()))) { _commonFun.AlertLongText("请填写审核意见"); return; } NeedApproalParams dto = new NeedApproalParams() { NoticeReaderId = NoticeReaderId , PassYN = type , ReplyContent = ReplyContent , UserId = Convert.ToInt32(CommonContext.Account.UserId) }; _commonFun.ShowLoading("保存中..."); var result = await _notifiMngService.NoticeApprovalS(dto); if (result != null) { if (result.ResultCode == ResultType.Success) { MessagingCenter.Send <string>("", MessageConst.NOTICE_APPROALDATA_GET); MessagingCenter.Send <string>("", MessageConst.NOTICE_READERLIST_REFRESH); await Navigation.PopAsync(true); _commonFun.AlertLongText("保存成功"); } else { _commonFun.AlertLongText(result.Msg); } } else { _commonFun.AlertLongText("保存时服务出现错误,,请重试"); } } catch (OperationCanceledException) { _commonFun.HideLoading(); _commonFun.AlertLongText("请求超时,请重试"); } catch (Exception) { _commonFun.HideLoading(); _commonFun.AlertLongText("保存异常,请重试"); } finally { _commonFun.HideLoading(); } }
public async Task <APIResult> NoticeApprovalS(NeedApproalParams param) { { string spName = @"up_RMMT_NOT_NoticeApproval_C"; DynamicParameters dp = new DynamicParameters(); dp.Add("@NoticeReaderId", param.NoticeReaderId, DbType.Int32); dp.Add("@PassYN", param.PassYN, DbType.Boolean); dp.Add("@ReplyContent", param.ReplyContent, DbType.String); dp.Add("@InUserId", param.UserId, DbType.Int32); using (var conn = new SqlConnection(DapperContext.Current.SqlConnection)) { conn.Open(); using (var tran = conn.BeginTransaction(System.Data.IsolationLevel.ReadCommitted)) { try { await conn.ExecuteAsync(spName, dp, tran, null, CommandType.StoredProcedure); tran.Commit(); } catch (Exception ex) { tran.Rollback(); return(new APIResult { Body = "", ResultCode = ResultType.Success, Msg = ex.Message }); } finally { tran.Dispose(); } } return(new APIResult { Body = "", ResultCode = ResultType.Success, Msg = "" }); } } }
//通知审核 public async Task <APIResult> NoticeApprovalS(NeedApproalParams dto) { APIResult info = await _commonHelper.HttpPOST <APIResult>(baseUrl, _config.Get <string>($"{Config.Config.Endpoints_Paths}.NoticeApprovalS"), dto); return(info); }
public Task <APIResult> NoticeApprovalS([FromBody] NeedApproalParams param) { return(_notifiApprovalService.NoticeApprovalS(param)); }