getService.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. var getService={
  2. methodGet:function(url){
  3. var ret = null;
  4. var functionUrl = url;
  5. ServiceOperation.send(ServiceOperation.MethodGet, ServiceOperation.getFullUrl(functionUrl),"", false, function(data){
  6. if(!data.success){
  7. alert(data.message);
  8. }else{
  9. ret = data.result;
  10. }
  11. }, false, false);
  12. return ret;
  13. },
  14. methodPost:function(url){
  15. var ret = null;
  16. var functionUrl = url;
  17. ServiceOperation.send(ServiceOperation.MethodPost, ServiceOperation.getFullUrl(functionUrl),"", false, function(data){
  18. // if(!data.success){
  19. // DialogOperation.alertDialog(data.message);
  20. // }else{
  21. // ret = data.result;
  22. // }
  23. ret = data
  24. }, false, false);
  25. return ret;
  26. },
  27. methodInsert:function(url,data,callback){
  28. // var functionUrl = "sale/ypffscDelivery/save"
  29. // ServiceOperation.send(ServiceOperation.MethodPost, ServiceOperation.getFullUrl(functionUrl),dictmentitem,true,callback,true,true);
  30. var ret = null;
  31. var functionUrl = url;
  32. ServiceOperation.send(ServiceOperation.MethodPost, ServiceOperation.getFullUrl(functionUrl),data, true, callback, true, true);
  33. return ret;
  34. }
  35. }