예제 #1
0
 // Tries to save received/decrypted JSON to database.
 // Returns true, if successful.
 private static Boolean processPost(HttpRequestBase request)
 {
     try
     {
         // Decrypts the JSON received from the request.
         string encryptedJSON = readRequestBody(request);
         string jsonString    = Decrypt.DecryptString(encryptedJSON);
         // Saves JSON to database.
         JSONEntriesController.Create(jsonString);
         return(true);
     }
     catch
     {
         return(false);
     }
 }
예제 #2
0
 // Main view - shows list of all received JSON strings.
 public ActionResult Index()
 {
     return(View(JSONEntriesController.Get()));
 }