Archive

Posts Tagged ‘Unit Admin’

SWS UpdateRentRate Method

Lets you change the rent rate for a unit. Multiple units can be individually processed with a new rate. Letters can also be scheduled when updating the rent rates for active rentals. The letters will only be scheduled as centralized mail using this method.

Parameters

Name DataType Is Required
AcctID 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. Only required when sending a letter.
EffectiveDate DateTime Required
Description The date the future rate will go into effect.
LetterDate DateTime Optional
Description The date the letter is to be sent. Only required when SendLetter is “True”.
NewRate Decimal Required
Description The new rent rate for the rental item.
OrgID Long Required
Description The organization’s ID number.
RentalID Long Optional
Description The rental item’s ID number. This is returned when using the MakeReservation method or can be searched for using the SearchBy method. Only required if SendLetter is ‘True’.
SendLetter Boolean Optional
Description Indicates if the system is to generate a rate change notice letter (“True”) or not (“False”).
SiteID Long Required
Description The site’s ID number. This can be found using the GetSiteList method.
UnitID Long Required
Description The unit’s ID number for the unit where the rate change will apply. This is returned when you use any of the GetSiteUnitData
calls and is maintained through rentals.
UnitVersion Decimal Required
Description The unit’s version number which serves to prevent duplicate use of the unit.

Returned Parameters

Name DataType
ErrorMessage String
Description The message about any problem that occurred during the process, including details to locate errant code.
Succeeded Boolean
Description Indicates if the rate was changed successfully (“True”) or not (“False”).
UnitID Long
Description The unit’s ID number to which the rate change applied. This is maintained through rentals.

Example

As with every method we need to pass in credentials. We do this with the LookupUser request object.

We will assume you have a web reference, let us name it SWS, in your Visual Studio project. At this point we need to define our objects.  We will need the standard service object, an UpdateRentRate request object, and an UpdateRentRate response object. We will also need a RentRateReqData array to pass to the request object. We can define and create those like this:

// Create a request and response objects
SWS.WSSoapClient service = new SWS.WSSoapClient();
SWS.UpdateRentRate_Request request = new SWS.UpdateRentRate_Request();
SWS.UpdateRentRate_Response response;

SWS.RentRateReqData[] reqRentRate = new SWS.RentRateReqData[1];

Here is a sample code of the request object:

// UpdateRentRate Request
reqRentRate[0].OrgID = 123456;
reqRentRate[0].SiteID = 123456;
reqRentRate[0].AcctId = 123456;
reqRentRate[0].UnitID = 123456;
reqRentRate[0].UnitVersion = 23;
reqRentRate[0].RentalId = 123456;
reqRentRate[0].NewRate = 55.25m;
reqRentRate[0].EffectiveDate = new DateTime(2017, 9,1);
reqRentRate[0].SendLetter = true;
reqRentRate[0].LetterDate = new DateTime(2017, 8, 1);

Finally we can call the method and pass across the login object and the request object to retrieve our requested information. It’s a good idea to do this in a Try Catch block.

// Call the method that will load the response object
try
{
  response = service.UpdateRentRate(user_request, request);
}
catch (Exception ex)
{
  MessageBox.Show(ex.Message);
}

Note that if something goes wrong the service will respond with an exception. You will want to capture the message in the exception so it can be debugged.

For a full list of methods see SWS Methods.

SWS UpdateUnitStatusExpanded Method

Allows the user to change the status of a rental item if the current status is not “Reserved” or “Rented”. Multiple rental items can be individually processed with a new status. It is an expanded function to the UpdateUnitStatus SWS method because it allows for change to occur on the rental item status to another possible status rather than just available or hold.

Parameters

Name DataType Is Required
OrgID Long Required
Description The organization’s ID number.
SiteID Long Required
Description The site’s ID number. This can be found using the GetSiteList method.
UnitID Long Required
Description The unit’s ID number. This is returned when you use any of the GetSiteUnitData calls and is maintained through rentals.
UnitStatus unitStsVals Required
Description The available statuses to which the unit can be changed. The unit cannot currently be “Reserved” or “Rented”.
Available values:

  • AVAILABLE
  • RESERVED
  • RENTED_NORMAL
  • COMPANY_USE
  • UNAVAILABLE_DAMAGED
  • UNAVAILABLE_PERMANENT
  • VIRTUAL_LINKED_UNITS (Not currently used.)
  • OTHER
  • UNAVAILABLE_PENDING
  • AVAILABLE_HOLD
UnitVersion Decimal Required
Description The unit’s version number which serves to prevent duplicate use of the unit.

Returned Parameters

Name DataType
ErrorMessage String
Description A message about any problem that occurred during the process, including details to locate errant code.
NewUnitVersion Decimal
Description The unit’s new version number which serves to prevent duplicate use of the unit.
Succeeded Boolean
Description Indicates if the unit was updated successfully (“True”) of if the update failed (“False”).
UnitID Long
Description The unit’s ID number. This is maintained through rentals.

Example

As with every method we need to pass in credentials. We do this with the LookupUser request object.

We will assume you have a web reference, let us name it SWS, in your Visual Studio project. At this point we need to define our objects.  We will need the standard service object, an UpdateUnitStatusExpanded request object, and an UpdateUnitStatusExpanded response object. We will also need an UpdateUnitStatusExpanded_RequestData object to pass to the request. We can define and create those like this:

// Create a request and response objects
SWS.WSSoapClient service = new SWS.WSSoapClient();
SWS.UpdateUnitStatusExpanded_Request request 
                       = new SWS.UpdateUnitStatusExpanded_Request();
SWS.UpdateUnitStatusExpanded_Response response;

SWS.UpdateUnitStatusExpanded_RequestData reqUnitData 
                       = new SWS.UpdateUnitStatusExpanded_RequestData();

Here is a sample code of the request object:

// UpdateUnitStatusExpanded Request
 With objReq
reqUnitData.OrgID = 123456;
reqUnitData.SiteID = 123456;
reqUnitData.UnitID = 123456;
reqUnitData.UnitVersion = 12;
reqUnitData.UnitStatus = SWS.unitStsVals.AVAILABLE_HOLD;

request.UnitStatusUpdateData[0] = reqUnitData;

Finally we can call the method and pass across the login object and the request object to retrieve our requested information. It’s a good idea to do this in a Try Catch block.

// Call the method that will load the response object
try
{
  response = service.UpdateUnitStatusExpanded(user_request, request);
}
catch (Exception ex)
{
  MessageBox.Show(ex.Message);
}

Note that if something goes wrong the service will respond with an exception. You will want to capture the message in the exception so it can be debugged.

For a full list of methods see SWS Methods.

SWS UpdateUnitStatus Method

May 25, 2011 1 comment

Allows the user to place a hold on a rental item to ensure its availability during the set up process to avoid duplicate use of the item. It also allows the ability to remove a hold on a rental item.

Parameters

Name DataType Is Required
PutOnHold Boolean Required
Description Indicates if the unit should be put on hold (“True”) or if it should be removed from hold (“False”).
SiteID Long Required
Description The site’s ID number. This can be found using the GetSiteList method.
UnitID Long Required
Description The unit’s ID number. This is returned when you use any of the GetSiteUnitData calls and is maintained through rentals.
Version Decimal Required
Description The unit’s version number which serves to prevent duplicate use of the unit.

Returned Parameters

Name DataType
NewVersion Decimal
Description The unit’s new version number which serves to prevent duplicate use of the unit.

Example

As with every method we need to pass in credentials. We do this with the LookupUser request object.

We will assume you have a web reference, let us name it SWS, in your Visual Studio project. At this point we need to define our objects.  We will need the standard service object, an UpdateUnitStatus request object, and an UpdateUnitStatus response object. We can define and create those like this:

// Create a request and response objects
SWS.WSSoapClient service = new SWS.WSSoapClient();
SWS.UpdateUnitStatus_Request request = new SWS.UpdateUnitStatus_Request();
SWS.UpdateUnitStatus_Response response;

Here is a sample code of the request object:

// UpdateUnitStatus Request
request.SiteID = 123456;
request.UnitID = 123456;
request.Version = 12;
request.PutOnHold = true;

Finally we can call the method and pass across the login object and the request object to retrieve our requested information. It’s a good idea to do this in a Try Catch block.

// Call the method that will load the response object
try
{
  response = service.UpdateUnitStatus(user_request, request);
}
catch (Exception ex)
{
  MessageBox.Show(ex.Message);
}

Note that if something goes wrong the service will respond with an exception. You will want to capture the message in the exception so it can be debugged.

For a full list of methods see SWS Methods.

SWS eUnitClass Method

Returns the site’s available rental revenue classes for a given site along with each unit type in that class.

Parameters

Name DataType Is Required
SiteID Long Required
Description The site’s ID number. This can be found using the GetSiteList method.

Returned Parameters

Name DataType
ACCT_CATEGORY String
Description The site’s revenue class category.
APPL_RENTAL_
OBJECTS_DETAIL_NonOccupiable
APPL_RENTAL_OBJECTS_DETAIL
Description The object details of a non-occupiable rental unit. (I.E., mailboxes.)
APPL_RENTAL_
OBJECTS_DETAIL_Occupiable
APPL_RENTAL_OBJECTS_DETAIL
Description The object details of an occupiable rental unit.
CLASS_DESC String
Description The textual description of the site’s revenue class.
CLASS_TYPE Integer
Description The numeric value for the site’s revenue class type.
ICON String
Description The URL for the site revenue class icon that displays in the Store application.
SITE_CLASS_ID Long
Description The site’s revenue class ID number that describes the general rules for the site.
SITE_ID Long
Description The site’s ID number.

Example

We will assume you have a web reference, let us name it SWS, in your Visual Studio project. At this point we need to define our objects.  We will need the standard service object and a eUnitClass response object. We can define and create those like this:Example

// Create request and response objects
SWS.WSSoapClient service = new SWS.WSSoapClient();
SWS.SITE_CLASSES[] response;

Finally we can call the method and pass in the site ID to retrieve our requested information. It’s a good idea to do this in a Try Catch block.

// Call the method that will load the response object
try
{
  response = service.eUnitClass(123456);
}
catch (Exception ex)
{
  MessageBox.Show(ex.Message);
}

Note that if something goes wrong the service will respond with an exception. You will want to capture the message in the exception so it can be debugged.

For a full list of methods see SWS Methods.