Type.registerNamespace('Shopping.Services');
Shopping.Services.CatalogService=function() {
Shopping.Services.CatalogService.initializeBase(this);
this._timeout = 0;
this._userContext = null;
this._succeeded = null;
this._failed = null;
}
Shopping.Services.CatalogService.prototype={
GetProducts:function(startIndex,endIndex,succeededCallback, failedCallback, userContext) {
return this._invoke(Shopping.Services.CatalogService.get_path(), 'GetProducts',false,{startIndex:startIndex,endIndex:endIndex},succeededCallback,failedCallback,userContext); },
GetProductGrouping:function(startIndex,endIndex,bookID,subCategorID,bookName,author,publisher,fromPrice,toPrice,succeededCallback, failedCallback, userContext) {
return this._invoke(Shopping.Services.CatalogService.get_path(), 'GetProductGrouping',false,{startIndex:startIndex,endIndex:endIndex,bookID:bookID,subCategorID:subCategorID,bookName:bookName,author:author,publisher:publisher,fromPrice:fromPrice,toPrice:toPrice},succeededCallback,failedCallback,userContext); },
addProductToBasket:function(bookID,sessionID,succeededCallback, failedCallback, userContext) {
return this._invoke(Shopping.Services.CatalogService.get_path(), 'addProductToBasket',false,{bookID:bookID,sessionID:sessionID},succeededCallback,failedCallback,userContext); },
updateProductToBasket:function(bookID,sessionID,quantity,succeededCallback, failedCallback, userContext) {
return this._invoke(Shopping.Services.CatalogService.get_path(), 'updateProductToBasket',false,{bookID:bookID,sessionID:sessionID,quantity:quantity},succeededCallback,failedCallback,userContext); },
deleteProductFromBasket:function(bookID,sessionID,succeededCallback, failedCallback, userContext) {
return this._invoke(Shopping.Services.CatalogService.get_path(), 'deleteProductFromBasket',false,{bookID:bookID,sessionID:sessionID},succeededCallback,failedCallback,userContext); },
getUserBasketProducts:function(sessionID,succeededCallback, failedCallback, userContext) {
return this._invoke(Shopping.Services.CatalogService.get_path(), 'getUserBasketProducts',false,{sessionID:sessionID},succeededCallback,failedCallback,userContext); },
getBestSellerProduct:function(index,succeededCallback, failedCallback, userContext) {
return this._invoke(Shopping.Services.CatalogService.get_path(), 'getBestSellerProduct',false,{index:index},succeededCallback,failedCallback,userContext); },
getCategories:function(succeededCallback, failedCallback, userContext) {
return this._invoke(Shopping.Services.CatalogService.get_path(), 'getCategories',false,{},succeededCallback,failedCallback,userContext); }}
Shopping.Services.CatalogService.registerClass('Shopping.Services.CatalogService',Sys.Net.WebServiceProxy);
Shopping.Services.CatalogService._staticInstance = new Shopping.Services.CatalogService();
Shopping.Services.CatalogService.set_path = function(value) { 
var e = Function._validateParams(arguments, [{name: 'path', type: String}]); if (e) throw e; Shopping.Services.CatalogService._staticInstance._path = value; }
Shopping.Services.CatalogService.get_path = function() { return Shopping.Services.CatalogService._staticInstance._path; }
Shopping.Services.CatalogService.set_timeout = function(value) { var e = Function._validateParams(arguments, [{name: 'timeout', type: Number}]); if (e) throw e; if (value < 0) { throw Error.argumentOutOfRange('value', value, Sys.Res.invalidTimeout); }
Shopping.Services.CatalogService._staticInstance._timeout = value; }
Shopping.Services.CatalogService.get_timeout = function() { 
return Shopping.Services.CatalogService._staticInstance._timeout; }
Shopping.Services.CatalogService.set_defaultUserContext = function(value) { 
Shopping.Services.CatalogService._staticInstance._userContext = value; }
Shopping.Services.CatalogService.get_defaultUserContext = function() { 
return Shopping.Services.CatalogService._staticInstance._userContext; }
Shopping.Services.CatalogService.set_defaultSucceededCallback = function(value) { 
var e = Function._validateParams(arguments, [{name: 'defaultSucceededCallback', type: Function}]); if (e) throw e; Shopping.Services.CatalogService._staticInstance._succeeded = value; }
Shopping.Services.CatalogService.get_defaultSucceededCallback = function() { 
return Shopping.Services.CatalogService._staticInstance._succeeded; }
Shopping.Services.CatalogService.set_defaultFailedCallback = function(value) { 
var e = Function._validateParams(arguments, [{name: 'defaultFailedCallback', type: Function}]); if (e) throw e; Shopping.Services.CatalogService._staticInstance._failed = value; }
Shopping.Services.CatalogService.get_defaultFailedCallback = function() { 
return Shopping.Services.CatalogService._staticInstance._failed; }
Shopping.Services.CatalogService.set_path("/CatalogService.asmx");
Shopping.Services.CatalogService.GetProducts= function(startIndex,endIndex,onSuccess,onFailed,userContext) {Shopping.Services.CatalogService._staticInstance.GetProducts(startIndex,endIndex,onSuccess,onFailed,userContext); }
Shopping.Services.CatalogService.GetProductGrouping= function(startIndex,endIndex,bookID,subCategorID,bookName,author,publisher,fromPrice,toPrice,onSuccess,onFailed,userContext) {Shopping.Services.CatalogService._staticInstance.GetProductGrouping(startIndex,endIndex,bookID,subCategorID,bookName,author,publisher,fromPrice,toPrice,onSuccess,onFailed,userContext); }
Shopping.Services.CatalogService.addProductToBasket= function(bookID,sessionID,onSuccess,onFailed,userContext) {Shopping.Services.CatalogService._staticInstance.addProductToBasket(bookID,sessionID,onSuccess,onFailed,userContext); }
Shopping.Services.CatalogService.updateProductToBasket= function(bookID,sessionID,quantity,onSuccess,onFailed,userContext) {Shopping.Services.CatalogService._staticInstance.updateProductToBasket(bookID,sessionID,quantity,onSuccess,onFailed,userContext); }
Shopping.Services.CatalogService.deleteProductFromBasket= function(bookID,sessionID,onSuccess,onFailed,userContext) {Shopping.Services.CatalogService._staticInstance.deleteProductFromBasket(bookID,sessionID,onSuccess,onFailed,userContext); }
Shopping.Services.CatalogService.getUserBasketProducts= function(sessionID,onSuccess,onFailed,userContext) {Shopping.Services.CatalogService._staticInstance.getUserBasketProducts(sessionID,onSuccess,onFailed,userContext); }
Shopping.Services.CatalogService.getBestSellerProduct= function(index,onSuccess,onFailed,userContext) {Shopping.Services.CatalogService._staticInstance.getBestSellerProduct(index,onSuccess,onFailed,userContext); }
Shopping.Services.CatalogService.getCategories= function(onSuccess,onFailed,userContext) {Shopping.Services.CatalogService._staticInstance.getCategories(onSuccess,onFailed,userContext); }
var gtc = Sys.Net.WebServiceProxy._generateTypedConstructor;
if (typeof(Product) === 'undefined') {
var Product=gtc("Product");
Product.registerClass('Product');
}
if (typeof(ProductGrouping) === 'undefined') {
var ProductGrouping=gtc("ProductGrouping");
ProductGrouping.registerClass('ProductGrouping');
}
if (typeof(categories) === 'undefined') {
var categories=gtc("categories");
categories.registerClass('categories');
}
