コード例 #1
0
        public static string GetPhoneTypes(RestCommand command, bool orderByDateCreated = false)
        {
            PhoneTypes items = new PhoneTypes(command.LoginUser);

            if (orderByDateCreated)
            {
                items.LoadByOrganizationID(command.Organization.OrganizationID, "DateCreated DESC");
            }
            else
            {
                items.LoadByOrganizationID(command.Organization.OrganizationID);
            }
            return(items.GetXml("PhoneTypes", "PhoneType", true, command.Filters));
        }
コード例 #2
0
        public static string GetPhoneTypes(RestCommand command)
        {
            PhoneTypes phoneTypes = new PhoneTypes(command.LoginUser);

            phoneTypes.LoadByOrganizationID(command.Organization.OrganizationID);

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