Example #1
0
        public static Tuple <bool, string> SingleValue_012Item <TEntity>(TEntity entity, int indexStart, int indexEnd) where TEntity : LotteryOpenCode
        {
            if (entity.OpenCode.Contains(-1))
            {
                return(new Tuple <bool, string>(false, "开奖号码错误!"));
            }

            IList <int> list = new List <int>(entity.OpenCode);

            if (-1 != indexEnd)
            {
                for (int i = list.Count - 1; i >= indexEnd; i--)
                {
                    list.RemoveAt(i);
                }
            }

            for (int i = 0; i < indexStart; i++)
            {
                list.RemoveAt(0);
            }

            return(new Tuple <bool, string>(true, LotteryUtils.Get012String(list).ToString()));
        }