public static t_shooternumberconfig UpdateEntity(this t_shooternumberconfig entity, ShooterNumberConfig shooterNumberConfig) { entity.ShooterNumberIncrement = shooterNumberConfig.ShooterNumberIncrement; entity.LastGivenShooterNumber = shooterNumberConfig.LastGivenShooterNumber; return(entity); }
public void Update(ShooterNumberConfig shooterNumberConfig) { t_shooternumberconfig entity = _sqlRepository.Find(_ => _.ShooterNumberConfigId == shooterNumberConfig.ShooterNumberConfigId).Single(); entity.UpdateEntity(shooterNumberConfig); _sqlRepository.Commit(); }
public int GetShooterNumber() { ShooterNumberConfig config = _shooterNumberConfigDataStore.FindById(ConfigId); int nextShooterNumber = config.LastGivenShooterNumber + config.ShooterNumberIncrement; config.LastGivenShooterNumber = nextShooterNumber; _shooterNumberConfigDataStore.Update(config); return(nextShooterNumber); }
public void Configure(IShooterDataStore shooterDataStore) { IEnumerable <Shooter> shooters = shooterDataStore.GetAll().ToArray(); if (shooters.Any()) { int highestShooterNumber = shooters.Max(_ => _.ShooterNumber); ShooterNumberConfig config = _shooterNumberConfigDataStore.FindById(ConfigId); config.LastGivenShooterNumber = highestShooterNumber; _shooterNumberConfigDataStore.Update(config); } }
public void Delete(ShooterNumberConfig entity) { throw new NotImplementedException(); }