Ejemplo n.º 1
0
        public static string GetEmailAction(RestCommand command, int eMailActionID)
        {
            EmailAction emailAction = EmailActions.GetEmailAction(command.LoginUser, eMailActionID);

            if (emailAction.OrganizationID != command.Organization.OrganizationID)
            {
                throw new RestException(HttpStatusCode.Unauthorized);
            }
            return(emailAction.GetXml("EmailAction", true));
        }
Ejemplo n.º 2
0
        public static string GetEmailActions(RestCommand command)
        {
            EmailActions emailActions = new EmailActions(command.LoginUser);

            emailActions.LoadByOrganizationID(command.Organization.OrganizationID);

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