﻿// Class used to encapsulate webservice calls for store related data
function StoreService() {

    this.GetAllStores = function (async, callback) {
        ajaxRequest(baseUrl + "/WebServices/StoreWebService.asmx/GetAllStores", "{}", callback, 0, async);
    }

    this.FindNearestStoresToPostCode = function (postCode, numberOfStoresToReturn, callback) {
        var param = "{postCode:" + postCode + ", numberOfStoresToReturn:" + numberOfStoresToReturn + "}";
        ajaxRequest(baseUrl + "/WebServices/StoreWebService.asmx/FindNearestStoresToPostCode", param, callback, 0);
    }
}
