Ejemplo n.º 1
0
 private void SubmitClick(object sender, EventArgs e)
 {
     try
     {
         string response = string.Empty;
         if (!_isDev)
         {
             response = _httpRepo.InvokeService(_serviceUrl, "GET", string.Empty, "application/json", null);
         }
         else
         {
             //Modify the path accordingly
             response = System.IO.File.ReadAllText(@"E:\DemoCalculatorClient\DemoCalculatorClient\Result.json");
         }
         if (!string.IsNullOrEmpty(response))
         {
             var opModel = JsonUtil.Deserialize <Operation>(response);
             opModel.Result = _calRepo.Calculate(opModel);
             _logger.AppendLog(opModel.ToString());
         }
     }
     catch (Exception ex)
     {
         _logger.AppendLog(ex.Message);
     }
 }