public bool DeleteFile(int id) { this.ClearBrokenRuleMessages(); bool result = mgr.DeleteFile(id); this.AddBrokenRuleMessages(mgr.BrokenRuleMessages); return(result); }
public ActionResult DeleteFile(int id) { var res = false; try { _mng.DeleteFile(id); res = true; } catch (Exception ex) { Debug.LogError(ex); } return(Json(new { result = res })); }
public async Task <ResponseMessage> DeleteDocument(string designId, string documentId) { try { var design = await _designService.GetDesign(designId); var document = design.Documents.Find(x => x.Id == documentId); var filePath = Path.Combine(_appSettings.DocumentsStorage, designId, documentId + "_" + document.FileName); var response = FilesManager.DeleteFile(filePath); return(new ResponseMessage { Status = "Ok", Data = response }); } catch (Exception ex) { _logger?.LogError(ex, "Error deleting document."); return(new ResponseMessage { Status = "Error", Message = "Error deleting document." }); } }
public void ThenDeleteFile(string _filename) { FilesManager.DeleteFile(_filename); }