if (typeof JSON !== "object")document.write(""); var Product = {UpdatePhoto : function(id, photo){ return this.ajax("UpdatePhoto", {id : id, photo : photo} ,this.getCallback(arguments, 2)); },Add : function(model){ return this.ajax("Add", {model : model} ,this.getCallback(arguments, 1)); },GetSystemView : function(id){ return this.ajax("GetSystemView", {id : id} ,this.getCallback(arguments, 1)); },GetRelateProduct : function(productid){ return this.ajax("GetRelateProduct", {productid : productid} ,this.getCallback(arguments, 1)); },GetRelate2 : function(productid){ return this.ajax("GetRelate2", {productid : productid} ,this.getCallback(arguments, 1)); },GetRelate3 : function(productid){ return this.ajax("GetRelate3", {productid : productid} ,this.getCallback(arguments, 1)); },GetRelateCase : function(classid){ return this.ajax("GetRelateCase", {classid : classid} ,this.getCallback(arguments, 1)); },Search : function(classid, pageSize, curPage, keyword){ return this.ajax("Search", {classid : classid, pageSize : pageSize, curPage : curPage, keyword : keyword} ,this.getCallback(arguments, 4)); },SearchLan : function(classid, ver, pageSize, curPage, keyword){ return this.ajax("SearchLan", {classid : classid, ver : ver, pageSize : pageSize, curPage : curPage, keyword : keyword} ,this.getCallback(arguments, 5)); },UpdateField : function(id, field, value){ return this.ajax("UpdateField", {id : id, field : field, value : value} ,this.getCallback(arguments, 3)); },CacheModel : function(model){ return this.ajax("CacheModel", {model : model} ,this.getCallback(arguments, 1)); },CreateAllHtml : function(classid, ver){ return this.ajax("CreateAllHtml", {classid : classid, ver : ver} ,this.getCallback(arguments, 2)); },CreateListHtml : function(classid, ver){ return this.ajax("CreateListHtml", {classid : classid, ver : ver} ,this.getCallback(arguments, 2)); },CreateDetailHtml : function(classid, ver){ return this.ajax("CreateDetailHtml", {classid : classid, ver : ver} ,this.getCallback(arguments, 2)); },CreateSelectHtml : function(classid, ids, ver){ return this.ajax("CreateSelectHtml", {classid : classid, ids : ids, ver : ver} ,this.getCallback(arguments, 3)); },Update : function(model){ return this.ajax("Update", {model : model} ,this.getCallback(arguments, 1)); },Delete : function(Id){ return this.ajax("Delete", {Id : Id} ,this.getCallback(arguments, 1)); },Deletes : function(ids){ return this.ajax("Deletes", {ids : ids} ,this.getCallback(arguments, 1)); },setDate : function (a) { if(a != null && typeof a == 'object') { for (var i in a) a[i] = this.setDate(a[i]) } return a = a instanceof Date ? '"\\/Date(' + a.getTime() + ')\\/"' : a}, getCallback : function(a, b){ return b < a.length ? a[b] : undefined},ajax: function (a, b, c){var j = JSON.stringify(this.setDate(b)); var d = { contentType:'text/plain', beforeSend : function(x){ x.setRequestHeader('method', a) }, async : true, url : this.u, type : 'POST', dataType : 'json', data : j, success:function(e){ typeof c == 'function' && c(e) } }; if(typeof c != 'function'){ d.async = false; return JSON.parse(jQuery.ajax(d).responseText) } else jQuery.ajax(d) }, u: '/ajax/Product.ashx'};