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)); }
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"); } }