﻿// ----------------------------------------------
// File:		StoreLocationsDataService.js
// Author:		Nathan Derksen
// Description:	A class that holds the available service methods, along with response handlers.
// ----------------------------------------------

// ----------------------------------------------
// Function:	StoreLocationsDataService
// Author:		Nathan Derksen
// Description:	Base class
// Inputs:		<none>
// Returns:		<nothing>
// ----------------------------------------------
function StoreLocationsDataService()
{
}

// ----------------------------------------------
// Function:	SearchValidationService.isSearchEmpty
// Author:		Nathan Derksen
// Description:	Calls the service to find if the given search is an empty search or not
// Inputs:		<Object> searchCriteria - An object of properties to search on
//				<Number> startIndex - The zero-based index of which row to start at in the total results
//				<Number> maxResults - The maximum number of results to return
// Returns:		<nothing>
// ----------------------------------------------
StoreLocationsDataService.prototype.getLocations = function(getExpandedData)
{
	try
	{
		if (isAjaxEnabled() == true)
		{
			if (getExpandedData == true)
			{
				PageMethods.GetAllStoreLocationsForMapping(this.onResult, this.onError);
			}
			else
			{
				PageMethods.GetStoreLocationsForLookup(this.onResult, this.onError);
			}
		}
	}
	catch (err)
	{
		Debug.error(err);
	}
};

StoreLocationsDataService.prototype.onResult = function(response)
{
	generateEvent("onStoreDataLoaded", response);
}

StoreLocationsDataService.prototype.onError = function(response)
{
}

