public async Task <MessageModel <string> > Put([FromBody] PartyAdvisoryViewModel Infos) { var data = new MessageModel <string>(); try { var customInfo = _mapper.Map <CustomInfo>(Infos); var advisoryInfo = _mapper.Map <PartyAdvisoryInfo>(Infos); var cResult = await _customInfoServices.Update(customInfo); var aResult = true; if (advisoryInfo.Id > 0) { aResult = await _partyAdvisoryInfoServices.Update(advisoryInfo); } if (cResult && aResult) { data.success = cResult; } if (data.success) { data.msg = "修改成功"; data.response = advisoryInfo?.Id.ObjToString(); } return(data); } catch (Exception ex) { return(data); } }
public async Task <MessageModel <string> > Put([FromBody] CustomInfo custom) { var data = new MessageModel <string>(); if (custom != null && custom.Id > 0) { data.success = await customInfoServices.Update(custom); if (data.success) { data.response = custom?.Id.ObjToString(); data.msg = "修改成功"; } } return(data); }