public GetScoringMapResponse GetScoringMap() { _isAnonymousAuthentication = true; ScoringEngine scoringEngine = CreateScoringEngineWithRequestValidation(); GetScoringMapResponse scoringMap = scoringEngine.GetScoringMap(); return(scoringMap); }
private ScoringEngine CreateScoringEngine() { var args = new ConstructorArgument[] { new ConstructorArgument("userConnection", UserConnection) }; ScoringEngine scoringEngine = ClassFactory.Get <ScoringEngine>(args); return(scoringEngine); }
public IActionResult Score(string rawChecklist) { try { _logger.LogInformation("Calling External Score() with a raw Checklist XML data"); return(Ok(ScoringEngine.ScoreChecklistString(rawChecklist))); } catch (Exception ex) { _logger.LogError(ex, "Score() Error creating External Score for XML string passed in"); return(BadRequest()); } }
private ScoringEngine CreateScoringEngineWithRequestValidation() { HttpRequest request = HttpContext.Current.Request; ScoringEngine scoringEngine = CreateScoringEngine(); string validationExceptionMessage = scoringEngine.ValidateAuthKey(request); if (!string.IsNullOrEmpty(validationExceptionMessage)) { throw new WebFaultException <string>(validationExceptionMessage, System.Net.HttpStatusCode.Forbidden); } return(scoringEngine); }
public ActionResult ScoreMe() { List <Frame> frames = ScoringEngine.SetupFrames(); var model = new BowlingViewModel(); model.NineFrames = frames; model.LastFrame = new TenthFrame { FirstScore = "0", SecondScore = "0", ThirdScore = "0" }; //return View(frames); return(View(model)); }
public GetSynchronizationDataResponse GetSynchronizationData(string schemaName, string lastSynchronizationDate, Guid lastSynchronizationId, List <string> columns, int limit) { _isAnonymousAuthentication = true; GetSynchronizationDataResponse response = new GetSynchronizationDataResponse(); response.Columns = columns; ScoringEngine scoringEngine = CreateScoringEngineWithRequestValidation(); response.Data = scoringEngine.GetSynchronizationRecords(schemaName, lastSynchronizationDate, lastSynchronizationId, columns, limit); return(response); }
public void SaveScoredData(string schemaName, string schemaColumnName, Dictionary <string, object> scoredData) { HttpRequest request = HttpContext.Current.Request; if (request.HttpMethod == WebRequestMethods.Http.Head) { return; } if (request.HttpMethod != WebRequestMethods.Http.Post) { throw new HttpException(HttpStatusCode.MethodNotAllowed, "Method not allowed"); } _isAnonymousAuthentication = true; ScoringEngine scoringEngine = CreateScoringEngineWithRequestValidation(); scoringEngine.SaveScoredResults(schemaName, schemaColumnName, scoredData); }
public ActionResult ScoreMe(BowlingViewModel viewModel) { ScoringEngine.CalculateScore(viewModel.NineFrames, viewModel.LastFrame); TempData["frames"] = viewModel.NineFrames; return(RedirectToAction("Index")); }