Last active
          December 21, 2015 05:39 
        
      - 
      
 - 
        
Save ktabori/6258112 to your computer and use it in GitHub Desktop.  
    /base API SUM
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | $(document).ready(function(){ | |
| $("input[id$='getSum']").click(function(){ | |
| if ($("input[id$='number1']").val() != ''){ | |
| var number1 = $("input[id$='number1']").val(); | |
| } | |
| else{ | |
| var number1 = 0; | |
| } | |
| if ($("input[id$='number2']").val() != ''){ | |
| var number2 = $("input[id$='number2']").val(); | |
| } | |
| else{ | |
| var number2 = 0; | |
| } | |
| $.ajax({ | |
| type: "GET", | |
| url: "http://jobtest1.teasolutions.dk.web01.teasolutions.dk/base/Get/Sum/"+number1+"/"+number2+ .aspx", | |
| dataType: "xml", | |
| success: function(xml) { | |
| $(xml).find('value').each(function(){ | |
| var value = $(this).text(); | |
| alert(number1 + " + " + number2 + " = " + value); | |
| }); | |
| } | |
| }); | |
| }); | |
| }); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using umbraco.presentation.umbracobase; | |
| namespace Base | |
| { | |
| [RestExtension("Get")] | |
| public class BaseClass | |
| { | |
| [RestExtensionMethod] | |
| public static int Sum(int number1, int number2) | |
| { | |
| int[] array = { number1, number2 }; | |
| int sum = array.Sum(); | |
| return sum; | |
| } | |
| } | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment