/// <summary> /// 删除新闻 /// </summary> /// <param name="keyValue"></param> /// <returns></returns> public InvokeResult <bool> DeleteForm(string keyValue) { var entyFile = _Respository.GetFeild(u => u.CoverUrl + "," + u.Attachment + "," + u.ResourceUrl, w => w.Id == keyValue); var b = _Respository.Delete(keyValue); if (b) { //删除文件 CoreContextProvider.DeleteFiles(entyFile); } return(RequestResult.Result(b)); }
public InvokeResult <bool> DeleteForm(string keyValue) { //被购买不可删除 var scoreDao = CoreContextProvider.GetService <IMemberScoreRespository>(); if (scoreDao.Any(w => w.KeyId == keyValue)) { return(RequestResult.Failed <bool>("该文库已被购买,不可删除")); } var entyFile = _Respository.GetFeild(u => u.CoverUrl + "," + u.Attachment + "," + u.ResourceUrl, w => w.Id == keyValue); var b = _Respository.Delete(keyValue); if (b) { //删除文件 CoreContextProvider.DeleteFiles(entyFile); } return(RequestResult.Result(b)); }