public IEnumerable <FileWrapper> GetMessageFiles(int messageid) { var messageEngine = EngineFactory.MessageEngine; var message = messageEngine.GetByID(messageid).NotFoundIfNull(); ProjectSecurity.DemandReadFiles(message.Project); return(messageEngine.GetFiles(message).Select(x => new FileWrapper(x))); }
public IEnumerable <FileWrapper> GetTaskFiles(int taskid) { var taskEngine = EngineFactory.TaskEngine; var task = taskEngine.GetByID(taskid).NotFoundIfNull(); ProjectSecurity.DemandReadFiles(task.Project); return(taskEngine.GetFiles(task).Select(FileWrapperSelector)); }
public IEnumerable <FileWrapper> GetTaskFiles(int taskid) { var taskEngine = EngineFactory.GetTaskEngine(); var task = taskEngine.GetByID(taskid).NotFoundIfNull(); ProjectSecurity.DemandReadFiles(task.Project); return(taskEngine.GetFiles(task).Select(x => new FileWrapper(x)).ToSmartList()); }
public MessageWrapper DetachFileFromMessage(int messageid, int fileid) { var messageEngine = EngineFactory.GetMessageEngine(); var fileEngine = EngineFactory.GetFileEngine(); var discussion = messageEngine.GetByID(messageid).NotFoundIfNull(); ProjectSecurity.DemandReadFiles(discussion.Project); fileEngine.GetFile(fileid, 1).NotFoundIfNull(); messageEngine.DetachFile(discussion, fileid); return(new MessageWrapper(discussion)); }
public TaskWrapper DetachFileFromTask(int taskid, int fileid) { var fileEngine = EngineFactory.GetFileEngine(); var taskEngine = EngineFactory.GetTaskEngine(); var task = taskEngine.GetByID(taskid).NotFoundIfNull(); ProjectSecurity.DemandReadFiles(task.Project); fileEngine.GetFile(fileid, 1).NotFoundIfNull(); taskEngine.DetachFile(task, fileid); return(new TaskWrapper(task)); }
public MessageWrapper DetachFileFromMessage(int messageid, int fileid) { var messageEngine = EngineFactory.MessageEngine; var discussion = messageEngine.GetByID(messageid).NotFoundIfNull(); ProjectSecurity.DemandReadFiles(discussion.Project); var file = EngineFactory.FileEngine.GetFile(fileid).NotFoundIfNull(); messageEngine.DetachFile(discussion, fileid); MessageService.Send(Request, MessageAction.DiscussionDetachedFile, discussion.Project.Title, discussion.Title, file.Title); return(new MessageWrapper(discussion)); }
public TaskWrapper DetachFileFromTask(int taskid, int fileid) { var fileEngine = EngineFactory.FileEngine; var taskEngine = EngineFactory.TaskEngine; var task = taskEngine.GetByID(taskid).NotFoundIfNull(); ProjectSecurity.DemandReadFiles(task.Project); var file = fileEngine.GetFile(fileid).NotFoundIfNull(); taskEngine.DetachFile(task, fileid); MessageService.Send(Request, MessageAction.TaskDetachedFile, MessageTarget.Create(task.ID), task.Project.Title, task.Title, file.Title); return(TaskWrapperSelector(task)); }
public TaskWrapper DetachFileFromTask(int taskid, int fileid) { var fileEngine = EngineFactory.GetFileEngine(); var taskEngine = EngineFactory.GetTaskEngine(); var task = taskEngine.GetByID(taskid).NotFoundIfNull(); ProjectSecurity.DemandReadFiles(task.Project); var file = fileEngine.GetFile(fileid, 1).NotFoundIfNull(); taskEngine.DetachFile(task, fileid); MessageService.Send(_context, MessageAction.TaskDetachedFile, task.Project.Title, task.Title, file.Title); return(new TaskWrapper(task)); }
public MessageWrapper UploadFilesToMessage(int messageid, IEnumerable <int> files) { var messageEngine = EngineFactory.GetMessageEngine(); var fileEngine = EngineFactory.GetFileEngine(); var discussion = messageEngine.GetByID(messageid).NotFoundIfNull(); ProjectSecurity.DemandReadFiles(discussion.Project); foreach (var fileid in files) { var file = fileEngine.GetFile(fileid, 1).NotFoundIfNull(); messageEngine.AttachFile(discussion, file.ID, true); } return(new MessageWrapper(discussion)); }
public TaskWrapper UploadFilesToTask(int taskid, IEnumerable <int> files) { var taskEngine = EngineFactory.GetTaskEngine(); var fileEngine = EngineFactory.GetFileEngine(); var task = taskEngine.GetByID(taskid).NotFoundIfNull(); ProjectSecurity.DemandReadFiles(task.Project); foreach (var fileid in files) { var file = fileEngine.GetFile(fileid, 1).NotFoundIfNull(); taskEngine.AttachFile(task, file.ID, true); } return(new TaskWrapper(task)); }
public MessageWrapper UploadFilesToMessage(int messageid, IEnumerable <int> files) { var messageEngine = EngineFactory.MessageEngine; var fileEngine = EngineFactory.FileEngine; var discussion = messageEngine.GetByID(messageid).NotFoundIfNull(); ProjectSecurity.DemandReadFiles(discussion.Project); var filesList = files.ToList(); var fileNames = new List <string>(); foreach (var fileid in filesList) { var file = fileEngine.GetFile(fileid).NotFoundIfNull(); fileNames.Add(file.Title); messageEngine.AttachFile(discussion, file.ID, true); } MessageService.Send(Request, MessageAction.DiscussionAttachedFiles, discussion.Project.Title, discussion.Title, fileNames); return(new MessageWrapper(discussion)); }
public MessageWrapper DetachFileFromMessage(int messageid, IEnumerable <int> files) { var messageEngine = EngineFactory.MessageEngine; var fileEngine = EngineFactory.FileEngine; var discussion = messageEngine.GetByID(messageid).NotFoundIfNull(); ProjectSecurity.DemandReadFiles(discussion.Project); var filesList = files.ToList(); var attachments = new List <Files.Core.File>(); foreach (var fileid in filesList) { var file = fileEngine.GetFile(fileid).NotFoundIfNull(); attachments.Add(file); messageEngine.DetachFile(discussion, fileid); } MessageService.Send(Request, MessageAction.DiscussionDetachedFile, MessageTarget.Create(discussion.ID), discussion.Project.Title, discussion.Title, attachments.Select(x => x.Title)); return(MessageWrapperSelector(discussion)); }
public TaskWrapper UploadFilesToTask(int taskid, IEnumerable <int> files) { var taskEngine = EngineFactory.TaskEngine; var fileEngine = EngineFactory.FileEngine; var task = taskEngine.GetByID(taskid).NotFoundIfNull(); ProjectSecurity.DemandReadFiles(task.Project); var filesList = files.ToList(); var attachments = new List <Files.Core.File>(); foreach (var fileid in filesList) { var file = fileEngine.GetFile(fileid).NotFoundIfNull(); attachments.Add(file); taskEngine.AttachFile(task, file.ID, true); } MessageService.Send(Request, MessageAction.TaskAttachedFiles, MessageTarget.Create(task.ID), task.Project.Title, task.Title, attachments.Select(x => x.Title)); return(TaskWrapperSelector(task)); }
public TaskWrapper UploadFilesToTask(int taskid, IEnumerable <int> files) { var taskEngine = EngineFactory.GetTaskEngine(); var fileEngine = EngineFactory.GetFileEngine(); var task = taskEngine.GetByID(taskid).NotFoundIfNull(); ProjectSecurity.DemandReadFiles(task.Project); var filesList = files.ToList(); var fileNames = new List <string>(); foreach (var fileid in filesList) { var file = fileEngine.GetFile(fileid, 1).NotFoundIfNull(); fileNames.Add(file.Title); taskEngine.AttachFile(task, file.ID, true); } MessageService.Send(_context, MessageAction.TaskAttachedFiles, task.Project.Title, task.Title, fileNames); return(new TaskWrapper(task)); }