public ActionResult Results() { var dtos = BracketsDataService.GetChecksHistoryList(); var viewModels = Mapper.Map <IEnumerable <LogDto>, IEnumerable <CheckResultViewModel> >(dtos); return(View(viewModels)); }
protected void Page_Load(object sender, EventArgs e) { var dtos = BracketsDataService.GetChecksHistoryList(); var viewModels = Mapper.Map <IEnumerable <LogDto>, IEnumerable <CheckResultViewModel> >(dtos); ResultsHistoryList.DataSource = viewModels; ResultsHistoryList.DataBind(); }
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; } }
public string CheckFromDatabase(string recordID) { try { if (!new Regex(@"^\d+$").IsMatch(recordID)) { return("Check status: Only numbers allowed!"); } var text = BracketsDataService.GetTextByID(int.Parse(recordID)); return(GetCheckResult(text)); } catch (Exception ex) { return(ex.Message); } }
protected void DatabaseButton_Click(object sender, EventArgs e) { try { if (new Regex(@"^\d+$").IsMatch(RecordID.Text)) { var text = BracketsDataService.GetTextByID(int.Parse(RecordID.Text)); GetCheckResult(text); } else { StatusLabel.Text = "Check status: Only numbers allowed!"; } } catch (Exception ex) { StatusLabel.Text = ex.Message; } }
public string ReadData() { var id = int.Parse(Configuration.GetDataSourceID()); return(BracketsDataService.GetTextByID(id)); }
public void WriteResult(bool result) { BracketsDataService.SaveResultToDatabase(result); }