private async void DeleteCase() { try { CasesDelParamDto delDto = new CasesDelParamDto(); delDto.InUserId = int.Parse(CommonContext.Account.UserId); delDto.IdList = new List <IdParamDto>(); delDto.IdList.Add(new IdParamDto() { Id = Id }); _commonFun.ShowLoading("删除中..."); var result = await _caseService.DeleteCasesInfo(delDto); if (result != null) { if (result.ResultCode == ResultType.Success) { //跳转或刷新CaseIndexViewModel await Navigation.PopAsync(); MessagingCenter.Send <string>("", MessageConst.CASESAVESUCCESS); MessagingCenter.Send <string>("", "CaseSearchResultList"); _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> UpdateMadeNoticeList(CasesDelParamDto paramDto) { string spName = @"up_RMMT_NOT_DELETEMadeNoticeList_D"; string xmlIdList = CommonHelper.Serializer(typeof(List <IdParamDto>), paramDto.IdList); DynamicParameters dp = new DynamicParameters(); dp.Add("@InUserId", paramDto.InUserId); dp.Add("@XmlData", xmlIdList, DbType.Xml); dp.Add("@XmlRootName", "/ArrayOfIdParamDto/IdParamDto"); 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> UpdateCaseInfo([FromBody] CasesDelParamDto paramDto) { return(await _casesInfoService.DeleteCasesInfo(paramDto)); }
public async Task <APIResult> UpdateMadeNoticeList([FromBody] CasesDelParamDto paramDto) { return(await _notifiMngService.UpdateMadeNoticeList(paramDto)); }
public async Task <APIResult> DeleteCasesInfo(CasesDelParamDto delDto) { var info = await _commonHelper.HttpPOST <APIResult>(baseUrl, _config.Get <string>($"{Config.Config.Endpoints_Paths}.CaseDelete"), delDto); return(info); }