public async Task <MessageModel <string> > Delete(int id) { var data = new MessageModel <string>(); var cResult = true; var aResult = true; if (id > 0) { var advisoryInfo = await _partyAdvisoryInfoServices.QueryById(id); if (advisoryInfo != null) { var customInfo = await _customInfoServices.QueryById(advisoryInfo.CustomInfo); if (customInfo != null) { customInfo.IsDelete = true; cResult = await _customInfoServices.Update(customInfo); } advisoryInfo.IsDelete = true; aResult = await _partyAdvisoryInfoServices.Update(advisoryInfo); } data.success = cResult && aResult; if (data.success) { data.msg = "删除成功"; data.response = id.ObjToString(); } } return(data); }
public async Task <MessageModel <string> > Delete(int id) { var data = new MessageModel <string>(); if (id > 0) { var custom = await customInfoServices.QueryById(id); custom.IsDelete = true; data.success = await customInfoServices.Update(custom); if (data.success) { data.response = custom?.Id.ObjToString(); data.msg = "删除成功"; } } return(data); }