private void ManagePhasesButtons() { btnLoadPhases.IsEnabled = true; btnOpen32th.IsEnabled = false; //for nnow is always disabled btnOpen16th.IsEnabled = SqlDal_Pools.CountPhasesMatchs(_tournamentId, _disciplineId, PhasesManager.Decode(PhasesType.Finals_16)) == 0 ? false : true; btnOpen8th.IsEnabled = SqlDal_Pools.CountPhasesMatchs(_tournamentId, _disciplineId, PhasesManager.Decode(PhasesType.Finals_8)) == 0 ? false : true; btnOpen4th.IsEnabled = SqlDal_Pools.CountPhasesMatchs(_tournamentId, _disciplineId, PhasesManager.Decode(PhasesType.Finals_4)) == 0 ? false : true; btnOpenSemifinal.IsEnabled = SqlDal_Pools.CountPhasesMatchs(_tournamentId, _disciplineId, PhasesManager.Decode(PhasesType.SemiFinals)) == 0 ? false : true; btnOpenFinal.IsEnabled = SqlDal_Pools.CountPhasesMatchs(_tournamentId, _disciplineId, PhasesManager.Decode(PhasesType.Finals)) == 0 ? false : true; }