private string GetCheckResult(string text) { try { var isCorrect = CheckExpression.IsCorrect(text); BracketsDataService.SaveResultToDatabase(isCorrect); return($"Result of checking: { isCorrect }"); } catch (Exception ex) { throw new Exception(ex.Message); } }
private void GetCheckResult(string text) { try { var isCorrect = CheckExpression.IsCorrect(text); BracketsDataService.SaveResultToDatabase(isCorrect); StatusLabel.Text = $"Result of checking: {isCorrect}"; } catch (Exception ex) { StatusLabel.Text = "The following error occured: " + ex.Message; } }