Пример #1
0
        public static string GetUserTicketStatus(RestCommand command, int userTicketStatusID)
        {
            UserTicketStatus userTicketStatus = UserTicketStatuses.GetUserTicketStatus(command.LoginUser, userTicketStatusID);

            if (userTicketStatus.OrganizationID != command.Organization.OrganizationID)
            {
                throw new RestException(HttpStatusCode.Unauthorized);
            }
            return(userTicketStatus.GetXml("UserTicketStatus", true));
        }
Пример #2
0
        public static string GetUserTicketStatuses(RestCommand command)
        {
            UserTicketStatuses userTicketStatuses = new UserTicketStatuses(command.LoginUser);

            userTicketStatuses.LoadByOrganizationID(command.Organization.OrganizationID);

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