public ActionResult DeleteFile(string id, int fileId) { var files = AttachService.Find(o => o.Id == fileId && o.SourceClassify == 2); var re = AttachService.Delete(files); return(new JsonNetResult(re)); }
public ActionResult DeleteFile(string Id, int fileId) { var files = AttachService.Find(o => o.Id == fileId && o.SourceClassify == 1); var re = AttachService.Delete(files); #region 操作日志 var msg = LogEngine.CompareModelToLog <Attachment>(LogModule.合同管理, null, files); new LogEngine().WriteDelete(msg, LogModule.合同管理); #endregion return(new JsonNetResult(re)); }
public ResultDto DeleteTrue([FromForm] int id) { var dto = _service.GetEntity(id); string filePath = Path.Combine(_uploadAttachPath, dto.save_name); if (System.IO.File.Exists(filePath)) { System.IO.File.Delete(filePath); } _service.Delete(id); return(ResultDto.Success()); }
public ActionResult DeleteFile(int fileId, string isBack) { var op = new OpResult(); if (isBack == "1")//在转发或恢复中删除 { op.Successed = true; } else { var file = AttachService.Find(o => o.Id == fileId && o.SourceClassify == 3); var re = AttachService.Delete(file); if (re.Successed) { System.IO.File.Delete(System.IO.Path.Combine(Pharos.Sys.SysConstPool.GetRoot, file.SaveUrl)); } } return(new JsonNetResult(op)); }