public IEnumerable <ShooterWithStageAndCompetitionPointsShowModel> GetShooters() => ShooterRepository.GetStageAndCompetitionPoints(stage.ID) .Select(x => new ShooterWithStageAndCompetitionPointsShowModel(x.Id, x.Position, x.Name, x.Surname, x.StagePoints, x.CompetitionPoints));
public string GetBestShooter() { var shooter = ShooterRepository.GetBestShooter(stage.ID); if (shooter is null) { return(null); } return($"{shooter.Name} {shooter.Surname} : {shooter.Points}pkt"); }
public IEnumerable <Shooter> GetAllShooters() => ShooterRepository.GetAllShooters();
public ShowShooterInCompetitionModel(uint shooterId, uint competitionId) { shooter = ShooterRepository.GetShooter(shooterId); competition = CompetitionRepository.GetCompetition(competitionId); }
public Boolean DeleteShooter(UInt32 shooterID) => ShooterRepository.DeleteShooter(shooterID);
public Boolean EditShooter(Shooter shooter, UInt32 id) => ShooterRepository.EditShooter(shooter, id);
public uint GetPositionOnStage() => ShooterRepository.GetPositionOnStage(shooter.ID, stage.ID);
public Boolean AddShooter(Shooter shooter) => ShooterRepository.AddShooter(shooter);
public string GetStagePoints() => $"{ShooterRepository.GetStagePoints(shooter.ID, stage.ID):N3}";
public string GetStageTime() => $"{TimeSpan.FromSeconds(ShooterRepository.GetStageTime(shooter.ID, stage.ID)):g}";
public string GetAvgPosition() => $"{ShooterRepository.GetGeneralAvgPosition(shooter.ID):N2}";
public string GetDeltaAccuracy() => $"{ShooterRepository.GetAccuracy(AccuracyTypeEnum.Delta, shooter.ID, stage.ID):P2}";
public string GetCharlieAccuracy() => $"{ShooterRepository.GetAccuracy(AccuracyTypeEnum.Charlie, shooter.ID, stage.ID):P2}";
public string GetGeneralAccuracy() => $"{ShooterRepository.GetAccuracy(AccuracyTypeEnum.General,shooter.ID, stage.ID):P2}";
public ShowShooterOnStageModel(uint shooterId, uint stageId) { shooter = ShooterRepository.GetShooter(shooterId); stage = StageRepository.GetStage(stageId); }