예제 #1
0
        public bool DeleteFile(int id)
        {
            this.ClearBrokenRuleMessages();
            bool result = mgr.DeleteFile(id);

            this.AddBrokenRuleMessages(mgr.BrokenRuleMessages);
            return(result);
        }
예제 #2
0
        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
            }));
        }
예제 #3
0
        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."
                });
            }
        }
예제 #4
0
 public void ThenDeleteFile(string _filename)
 {
     FilesManager.DeleteFile(_filename);
 }