예제 #1
0
 public IActionResult DeleteInterpretation(string code)
 {
     try
     {
         int         result = InterpretationHelper.DeleteInterpretation(code);
         APIResponse apiResponse;
         if (result > 0)
         {
             apiResponse = new APIResponse()
             {
                 status = APIStatus.PASS.ToString(), response = result
             };
         }
         else
         {
             apiResponse = new APIResponse()
             {
                 status = APIStatus.FAIL.ToString(), response = "Deletion Failed."
             };
         }
         return(Ok(apiResponse));
     }
     catch (Exception ex)
     {
         return(Ok(new APIResponse()
         {
             status = APIStatus.FAIL.ToString(), response = ex.Message
         }));
     }
 }
예제 #2
0
 public static List <Interpretation> GetInterpretationList()
 {
     try
     {
         return(InterpretationHelper.GetInterpretationList());
     }
     catch { throw; }
 }
예제 #3
0
 public IActionResult GetInterpretationList()
 {
     try
     {
         var     interpretationList = InterpretationHelper.GetInterpretationList();
         dynamic expdoObj           = new ExpandoObject();
         expdoObj.interpretationList = interpretationList;
         return(Ok(new APIResponse {
             status = APIStatus.PASS.ToString(), response = expdoObj
         }));
     }
     catch (Exception ex)
     {
         return(Ok(new APIResponse()
         {
             status = APIStatus.FAIL.ToString(), response = ex.Message
         }));
     }
 }
예제 #4
0
        public IActionResult UpdateInterpretation([FromBody] Interpretation interpretation)
        {
            try
            {
                if (interpretation == null)
                {
                    return(Ok(new APIResponse()
                    {
                        status = APIStatus.FAIL.ToString(), response = "Request cannot be null"
                    }));
                }

                int         rs = InterpretationHelper.UpdateInterpretation(interpretation);
                APIResponse apiResponse;
                if (rs > 0)
                {
                    apiResponse = new APIResponse()
                    {
                        status = APIStatus.PASS.ToString(), response = rs
                    };
                }
                else
                {
                    apiResponse = new APIResponse()
                    {
                        status = APIStatus.FAIL.ToString(), response = "Updation Failed."
                    };
                }
                return(Ok(apiResponse));
            }
            catch (Exception ex)
            {
                return(Ok(new APIResponse()
                {
                    status = APIStatus.FAIL.ToString(), response = ex.Message
                }));
            }
        }
예제 #5
0
 public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 => InterpretationHelper.IsNontrivial(value);
 public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 => InterpretationHelper.IsNontrivial(value) ? Visibility.Visible : Visibility.Collapsed;