public void ChangeResult(PenaltyResult result) { var currentResult = this.Penalty.Penalty.Result; result.PenaltyMessage = currentResult.PenaltyMessage; result.PenaltyValue = currentResult.PenaltyValue; result.DriverId = this.Driver.Driver.Id; result.CarNumber = this.Driver.Driver.CarNumber; this.Penalty.Penalty.Result = result; this.Penalty.UpdateDrivers(); }
private void OnSelectedResultChanged() { var selected = this.SelectedResult; if (selected == null) { return; } var type = selected.Type; var newResult = PenaltyResult.FromType(type); this.ChangeResult(newResult); }
public DecidePenaltyViewModel(PenaltyContainer penalty, DriverContainer driver) { _penalty = penalty; _driver = driver; _possibleResults = PenaltyResult.AllResults(); _resetResult = penalty.Penalty.Result; if (string.IsNullOrWhiteSpace(penalty.Penalty.Result.PenaltyMessage)) { penalty.Penalty.Result.PenaltyMessage = penalty.Penalty.Reason; } this.Penalty.Penalty.Result.DriverId = driver.Driver.Id; this.Penalty.UpdateDrivers(); }