TradeMe.Api.Client.SearchMethods.SearchCommercialSaleProperties C# (CSharp) Méthode

SearchCommercialSaleProperties() public méthode

Performs the search method: Search Commercial Property. Creates a query string using the parameters provided - parameters can be null if they are not required for the request.

DOES NOT REQUIRE AUTHENTICATION.
public SearchCommercialSaleProperties ( string searchString, PropertySortOrder sortOrder, int page, int rows, int region, int district, int suburb, System.DateTime dateFrom, int priceMin, int priceMax, int bathroomsMin, int bathroomsMax, int bedroomsMin, int bedroomsMax, int areaMax, int areaMin, int landAreaMin, int landAreaMax, bool adjacentSuburbs, PropertyUsage usage ) : global::Properties
searchString string One or more keywords to use in a search query.
sortOrder PropertySortOrder Sort the returned record-set by a single specified sort order.
page int Page number.
rows int Number of rows per page.
region int Specifies the search region ID.
district int Specifies the search district ID.
suburb int Specifies the search suburb ID.
dateFrom System.DateTime Specifies minimum start date for returned listings.
priceMin int Minimum property price.
priceMax int Maximum property price.
bathroomsMin int Minimum number of bathrooms.
bathroomsMax int Maximum number of bathrooms.
bedroomsMin int Minimum number of bedrooms.
bedroomsMax int Maximum number of bedrooms.
areaMax int Maximum floor area in square meters.
areaMin int Minimum floor area in square meters.
landAreaMin int Minimum land area in square meters.
landAreaMax int Maximum land area in square meters.
adjacentSuburbs bool Indicates whether the search should include listings in adjacent suburbs.
usage PropertyUsage The usage of the property.
Résultat global::Properties
        public global::Properties SearchCommercialSaleProperties(
            string searchString,
            PropertySortOrder sortOrder,
            int? page,
            int? rows,
            int? region,
            int? district,
            int? suburb,
            DateTime dateFrom,
            int? priceMin,
            int? priceMax,
            int? bathroomsMin,
            int? bathroomsMax,
            int? bedroomsMin,
            int? bedroomsMax,
            int? areaMax,
            int? areaMin,
            int? landAreaMin,
            int? landAreaMax,
            bool? adjacentSuburbs,
            PropertyUsage usage)
        {
            var url = String.Format(Constants.Culture, "{0}{1}/{2}/CommercialSale{3}", _connection.BaseUrl, Constants.SEARCH, Constants.PROPERTY, Constants.XML);
            _addAnd = false;
            var conditions = "?";

            // create the parameters for the query string
            conditions += this.PropertyHelper(searchString, sortOrder.ToString(), page, rows, region, district, suburb, dateFrom, priceMin, priceMax, landAreaMin, landAreaMax);
            conditions += ResidentialPropertyHelper(bathroomsMin, bathroomsMax, bedroomsMax, bedroomsMin, areaMax, areaMin, null, adjacentSuburbs);
            conditions += SearchMethods.ConstructQueryHelper(Constants.USAGE, usage.ToString(), _addAnd);

            // add the parameters to the query string if there are any
            if (conditions.Equals("?"))
            {
                url += conditions;
            }

            // perform the request
            return this.PropertyConnectionHelper(url);
        }