示例#1
0
        public static string GetTicketTypes(RestCommand command, bool orderByDateCreated = false)
        {
            TicketTypes items = new TicketTypes(command.LoginUser);

            if (orderByDateCreated)
            {
                items.LoadByOrganizationID(command.Organization.OrganizationID, "DateCreated DESC");
            }
            else
            {
                items.LoadByOrganizationID(command.Organization.OrganizationID);
            }
            return(items.GetXml("TicketTypes", "TicketType", true, command.Filters));
        }
示例#2
0
        public static string GetTicketTypes(RestCommand command)
        {
            TicketTypes ticketTypes = new TicketTypes(command.LoginUser);

            ticketTypes.LoadByOrganizationID(command.Organization.OrganizationID);

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