Beispiel #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));
        }
    private void LoadPhoneTypes()
    {
        cmbTypes.Items.Clear();
        PhoneTypes phoneTypes = new PhoneTypes(UserSession.LoginUser);

        phoneTypes.LoadByOrganizationID(UserSession.LoginUser.OrganizationID);
        foreach (PhoneType phoneType in phoneTypes)
        {
            cmbTypes.Items.Add(new RadComboBoxItem(phoneType.Name, phoneType.PhoneTypeID.ToString()));
        }
    }
        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");
            }
        }