Exemplo n.º 1
0
        public static string GetAttachmentDownload(RestCommand command, int attachmentDownloadID)
        {
            AttachmentDownload attachmentDownload = AttachmentDownloads.GetAttachmentDownload(command.LoginUser, attachmentDownloadID);

            if (attachmentDownload.OrganizationID != command.Organization.OrganizationID)
            {
                throw new RestException(HttpStatusCode.Unauthorized);
            }
            return(attachmentDownload.GetXml("AttachmentDownload", true));
        }
Exemplo n.º 2
0
        public static string GetAttachmentDownloads(RestCommand command)
        {
            AttachmentDownloads attachmentDownloads = new AttachmentDownloads(command.LoginUser);

            attachmentDownloads.LoadByOrganizationID(command.Organization.OrganizationID);

            if (command.Format == RestFormat.XML)
            {
                return(attachmentDownloads.GetXml("AttachmentDownloads", "AttachmentDownload", true, command.Filters));
            }
            else
            {
                throw new RestException(HttpStatusCode.BadRequest, "Invalid data format");
            }
        }