Exemplo n.º 1
0
        public static string GetUserAssignmentHistoryItem(RestCommand command, int userAssignmentHistoryID)
        {
            UserAssignmentHistoryItem userAssignmentHistoryItem = UserAssignmentHistory.GetUserAssignmentHistoryItem(command.LoginUser, userAssignmentHistoryID);

            if (userAssignmentHistoryItem.OrganizationID != command.Organization.OrganizationID)
            {
                throw new RestException(HttpStatusCode.Unauthorized);
            }
            return(userAssignmentHistoryItem.GetXml("UserAssignmentHistoryItem", true));
        }
Exemplo n.º 2
0
        public static string GetUserAssignmentHistory(RestCommand command)
        {
            UserAssignmentHistory userAssignmentHistory = new UserAssignmentHistory(command.LoginUser);

            userAssignmentHistory.LoadByOrganizationID(command.Organization.OrganizationID);

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