private void AddJammer(JammerGateway jammerGateway, Dictionary<string, Player> playerMap, Jam jam, ScoreModel scoreModel, bool passedStar, bool receivedStar) { if (scoreModel != null && !string.IsNullOrWhiteSpace(scoreModel.PlayerNumber)) { jammerGateway.AddJammer(jam.ID, playerMap[scoreModel.PlayerNumber].ID, scoreModel.JamTotal, scoreModel.Lost, scoreModel.Lead, scoreModel.Called, scoreModel.Injury, scoreModel.NoPass, passedStar, receivedStar); } }
private ScoreModel CreateScoreModel(ExcelRange scores, int currentRow) { var scorer = scores.SubRange(currentRow, 2).Value; if(scorer == null || string.IsNullOrEmpty(scorer.ToString())) { return null; } ScoreModel model = new ScoreModel(); model.PlayerNumber = scorer.ToString(); model.JamTotal = Convert.ToInt32(scores.SubRange(currentRow, 17).Value); model.Lost = !string.IsNullOrWhiteSpace((string)scores.SubRange(currentRow, 3).Value); model.Lead = !string.IsNullOrWhiteSpace((string)scores.SubRange(currentRow, 4).Value); model.Called = !string.IsNullOrWhiteSpace((string)scores.SubRange(currentRow, 5).Value); model.NoPass = !string.IsNullOrWhiteSpace((string)scores.SubRange(currentRow, 7).Value); model.Injury = !string.IsNullOrWhiteSpace((string)scores.SubRange(currentRow, 6).Value); return model; }