Ejemplo n.º 1
0
        private static LeagueName GetLeagueName(int league)
        {
            LeagueName toReturn = 0;

            switch (league)
            {
            case 1:
                toReturn = LeagueName.A;
                break;

            case 2:
                toReturn = LeagueName.B;
                break;

            case 3:
                toReturn = LeagueName.C;
                break;

            case 4:
                toReturn = LeagueName.D;
                break;

            case 5:
                toReturn = LeagueName.E;
                break;

            case 6:
                toReturn = LeagueName.Unknow;
                break;
            }
            return(toReturn);
        }
Ejemplo n.º 2
0
        private static int GetLeagueNum(LeagueName league)
        {
            var toReturn = 0;

            switch (league)
            {
            case LeagueName.A:
                toReturn = 1;
                break;

            case LeagueName.B:
                toReturn = 2;
                break;

            case LeagueName.C:
                toReturn = 3;
                break;

            case LeagueName.D:
                toReturn = 4;
                break;

            case LeagueName.E:
                toReturn = 5;
                break;

            case LeagueName.Unknow:
                toReturn = 6;
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(league), league, null);
            }
            return(toReturn);
        }
Ejemplo n.º 3
0
        public void EditUserLeagueName(int id, LeagueName newLeagueName)
        {
            try
            {
                var league = new Database.LinqToSql.LeagueName
                {
                    League_Value = GetLeagueNum(newLeagueName)
                };

                _userDataControler.EditUserLeagueName(id, league);
            }
            catch (Exception)
            {
                return;
            }
        }