SWS2 GetSiteUnitData Method
Retrieves a list of available unit types including one unit of each type.
Parameters
Name | Data Type | Is Required |
---|---|---|
Access | Integer (or an array of integers) | Optional |
Description | The numeric value for the “Access” custom look up as defined by the site. See eUnitAccessType for the available values. | |
Attribute01 | Integer (or an array of integers) | Optional |
Description | The numeric value for the “Attribute01” custom look up as defined by the site. See eUnitAttr01 for the available values. | |
Attribute02 | Integer (or an array of integers) | Optional |
Description | The numeric value for the “Attribute02” custom look up as defined by the site. See eUnitAttr02 for the available values. | |
Channel | Integer | Optional |
Description | Indicates from what application the unit will be reserved. | |
Climate | Integer (or an array of integers) | Optional |
Description | The numeric value for the “Climate” custom look up as defined by the site. See eUnitClimate for the available values. | |
Depth | Decimal | Optional |
Description | The depth measurement of the unit. | |
Door | Integer (or an array of integers) | Optional |
Description | The numeric value for the “Door” custom look up as defined by the site. See eUnitDoor for the available values. | |
Feature | Integer (or an array of integers) | Optional |
Description | The numeric value for the “Features” custom look up as defined by the site. See eUnitFeatures for the available values. | |
Height | Decimal | Optional |
Description | The height measurement of the unit. | |
MaxRentRate | Decimal | Optional |
Description | The maximum rent rate of the unit. | |
MinRentRate | Decimal | Optional |
Description | The minimum rent rate of the unit. | |
ObjectGroup | Integer | Not Used |
Description | Not currently used. | |
PromoDataType | String | |
Description | ||
SiteID | Long | Required |
Description | The site’s ID number. This can be found using the GetSiteList method. | |
Status | Integer (or an array of integers) | Optional |
Description | The numeric value for the “Status” custom look up as defined by the site. See eUnitStatus for the available values. | |
Width | Decimal | Optional |
Description | The width measurement of the unit. |
Returned Parameters
Name | Data Type |
---|---|
SITE_ID | Long |
Description | The site’s ID number. |
CLASS_DESC | String |
Description | The textual value of the revenue class to which the unit belongs. |
SITE_CLASS_ID | Long |
Description | The revenue classes ID number. |
OBJECT_GROUP | Integer |
Description | Not currently used. |
UNIT_ID | Long |
Description | The unit’s ID number. This is maintained through rentals. |
VERSION | Integer |
Description | The unit’s version number which serves to prevent duplicate use of the unit. |
RENT_RATE | Decimal |
Description | The current rate at which the unit should be rented. |
PUSH_RATE | Decimal |
Description | The lowest rate that is available for the unit. Usually this rate has restrictions, set up by the site, on when it can be used. |
STREET_RATE | Decimal |
Description | The default rate of the unit. This is usually the rate at which a unit will be rented when the current tenant moves out. |
RACK_RATE | Decimal |
Description | The highest rate available on a unit. This usually has restrictions, set up by the site, on when it can be used. |
FUTURE_RATE | Decimal |
Description | If a rate change has been scheduled for the unit, this will be the rate to which it will change. |
PROFORMA_RATE | Decimal |
Description | This is used as a goal or base rate. |
MIN_RENT_RATE | Decimal |
Description | The minimum rate, set by the site, for a which a unit can be rented. |
MAX_RENT_RATE | Decimal |
Description | The maximum rate, set by the site, for which a unit can be rented. |
STATUS | Integer |
Description | The numeric value for the “Status” custom look up as defined by the site. See eUnitStatus for the available values. |
WIDTH | Decimal |
Description | The width measurment of the unit. |
DEPTH | Decimal |
Description | The depth measurement of the unit. |
HEIGHT | Decimal |
Description | The height measurement of the unit. |
SQUARE_FEET | Decimal |
Description | The area of the unit. This is calculated by multiplying the WIDTH times the DEPTH. |
VOLUME | Decimal |
Description | The volume of the unit. This is calculated by multiplying the WIDTH, DEPTH and HEIGHT. |
TOTAL_AVAILABLE | Integer |
Description | The number of available units of this type. |
TOTAL_UNITS | Integer |
Description | The total number of units of this type. |
ATTRIBUTE01 | Integer |
Description | The numeric value for the “Attribute01” custom look up as defined by the site. |
ATTRIBUTE01_VAL | String |
Description | The textual value for the “Attribute01” custom look up as defined by the site. |
ATTRIBUTE02 | Integer |
Description | The numeric value for the “Attribute02” custom look up as defined by the site. |
ATTRIBUTE02_VAL | String |
Description | The textual value for the “Attribute02” custom lookup as defined by the site. |
CLIMATE | Integer |
Description | The numeric value for the “Climate” custom look up as defined by the site. |
CLIMATE_VAL | String |
Description | The textual value for the “Climate” custom lookup as defined by the site. |
DOOR | Integer |
Description | The numeric value for the “Door” custom look up as defined by the site. |
DOOR_VAL | String |
Description | The textual value for the “Door” custom lookup as defined by the site. |
ACCESS_TYPE | Integer |
Description | The numeric value for the “AccessType” custom look up as defined by the site. |
ACCESS_TYPE_VAL | String |
Description | The textual value for the “AccessType” custom lookup as defined by the site. |
FEATURES | Integer |
Description | The numeric value for the “Features” custom look up as defined by the site. |
FEATURES_VAL | String |
Description | The textual value for the “Features” custom lookup as defined by the site. |
RESERVATION_DEPOSIT | Decimal |
Description | The amount required to hold a reservation. |
PROMOCOLLECTION | CollectionOfPCD |
Description | The collection of data applicable to the available promotions/discounts for the unit. |
Example
We’ll assume you’ve got a web reference, let’s name it Store, in your Visual Studio project. At this point we need to reference our objects. We’ll need the standard service object, a GetSiteUnitData_Request request object. We can define and create those like this:
// Create a request and response objects
StoreServiceClient client = new StoreServiceClient();
GetSiteUnitData_Request request = new GetSiteUnitData_Request();
As with every method we need to pass in credentials. We also set up the parameters for our request.
client.ChannelFactory.Credentials.UserName.UserName = "user"; client.ChannelFactory.Credentials.UserName.Password = "pass"; client.ChannelFactory.Credentials.SupportInteractive = true; request.SiteID = 123456;
Finally we can call the method and pass across the login object and the request object to retrieve the data. It’s a good idea to do this in a Try Catch block.
try
{
// Call the method that will load the response object
UnitType[] resp;
resp = client.GetSiteUnitData(request);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
Note that if something goes wrong the service will respond with an exception. You’ll want to take a look at that message returned in that exception so it can be debugged.
For a full list of methods see SWS2 Methods.