SWS2 GetSiteRentalData Method
Retrieves rental data for an account or site. This also returns any soft or hard reservations as they are set up with rental IDs. The data is returned as a DataTable.
Parameters
Name | Data Type | Is Required |
---|---|---|
AccountID | Long | Optional |
Description | The account’s ID number. This is returned when you use the CreateNewAccount method or can be retrieved with the SearchBy method. | |
SiteID | Long | Required |
Description | The site’s ID number. This can be found using the GetSiteList method. |
Returned Parameters
Name | Data Type |
---|---|
CONTACT_ID | Long |
Description | The rental contact’s ID number. This is returned when using the CreateNewAccount or AddNewContact methods or you can search for it using the SearchBy method. |
ACCT_ID | Long |
Description | The account’s ID number. This is returned when you use the CreateNewAccount method or can be retrieved with the SearchBy method. |
RENTAL_ID | Long |
Description | The rental item’s ID number. This is returned when using the MakeReservation method or can be searched for using the SearchBy method. |
RSTAT_RAW | Integer |
Description | The numeric rental status of the rental. This indicates if the rental is current or delinquent. |
RENTAL_STATUS | String |
Description | The textual rental status of the rental. This indicates if the customer is current or delinquent. |
START_DATE | DateTime |
Description | The date the rental was initially created. |
END_DATE | DateTime |
Description | If the rental has been terminated, this will be the date of termination. It will be null if it is still rented. |
OBJECT_ID | Long |
Description | The unit’s ID number. This is maintained through rentals. |
SITE_ID | Long |
Description | The site’s ID number. This can be found using the GetSiteList method. |
SITE_NAME | String |
Description | The site’s name as it appears in the Store application. |
UNIT_NUMBER | String |
Description | The unit’s number as assigned by the organization. This is not the UnitID. |
UNIT_ID | Long |
Description | The unit’s ID number. This is maintained through rentals. |
ACCT_NAME | String |
Description | The name on the account. This may differ from the primary contact’s name in some instances, such as a business account or a guardianship account. |
ORG_ID | Long |
Description | The organization’s ID number. |
PTD | DateTime |
Description | The paid thru date of the rental. |
ADDRESS | String |
Description | The full address of the primary contact. This includes the three possible address lines, city, state/province and ZIP/postal code. |
PHONE | String |
Description | The primary contact’s primary phone number. |
PHONE_TYPE | String |
Description | The type of phone number applicable to the primary contact’s phone. |
DUE_DATE | DateTime |
Description | The date that the next payment is due for the rental. This will be a past date if they are delinquent. |
AMOUNT_DUE | Decimal |
Description | The current amount due for the rental. |
UNIT_NUM_SORT | String |
Description | The value used to sort the units in the item finder within the application. |
GATE_CODE | String |
Description | The code the customer uses to access the gate system. If the site doesn’t have gates this will be null. |
String | |
Description | The email address for the primary contact. This is used as the username if the site supports eStore/eCommerce. |
ADDR_1 | String |
Description | The first line of the contact’s address. |
ADDR_2 | String |
Description | The second line of the contact’s address. |
CITY | String |
Description | The address of the contact’s address. |
STATE | String |
Description | The state for the primary contact’s address. |
POSTAL_CODE | String |
Description | The ZIP/Postal code for the primary contact’s address. |
FIRST_NAME | String |
Description | The primary contact’s first name. |
LAST_NAME | String |
Description | The primary contact’s last name. |
HOME_PHONE | String |
Description | The primary contact’s home phone number. This is indicated when the phone record is created. |
WORK_PHONE | String |
Description | The primary contact’s work phone number. This is indicated when the phone record is created. |
CELL_PHONE | String |
Description | The primary contact’s cell phone number. This is indicated when the phone record is created. |
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 GetSiteRentalData_Request request object. You will also need to pass in credentials. We can define and create those like this:
// Create a request and response objects
StoreServiceClient client = new StoreServiceClient();
GetSiteRentalData_Request request = new GetSiteRentalData_Request();
As with every method we need to pass in credentials. We also set up the parameters for our request.
//Cancel reservation setup
client.ChannelFactory.Credentials.UserName.UserName = "user";
client.ChannelFactory.Credentials.UserName.Password = "pass";
client.ChannelFactory.Credentials.SupportInteractive = true;
request.SiteID = 123456;
request.AccountID = 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
object resp;
resp = client.GetSiteRentalData(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.