Esempio n. 1
0
        /// <summary>
        /// 组装华东15选记录
        /// </summary>
        /// <param name="data"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        private string AppendHD15X5Result(DataTable data, SCCLottery type)
        {
            List <DFCHD15X5HistoryLotteryViewEntity> res = new List <DFCHD15X5HistoryLotteryViewEntity>();

            if (data.Rows.Count > 0)
            {
                //总共球个数
                int total = type.GetEnumText().TryToInt32();

                for (int j = 0; j < data.Rows.Count; j++)
                {
                    //开奖号集合
                    List <int>    openCodeList    = new List <int>();
                    List <string> openCodeListStr = new List <string>();
                    StringBuilder builder         = new StringBuilder();

                    for (int i = 1; i <= total; i++)
                    {
                        int openCode = data.Rows[j]["OpenCode" + i].TryToInt32();
                        openCodeList.Add(openCode);
                        openCodeListStr.Add(openCode.ToString());
                    }
                    builder.Append(GetOpenCodeTemplate(type, openCodeList));

                    string ac;
                    try
                    {
                        ac = LotteryUtils.GetAC(openCodeListStr.ToArray()).ToString();
                    }
                    catch (Exception)
                    {
                        ac = "";
                    }

                    res.Add(new DFCHD15X5HistoryLotteryViewEntity
                    {
                        Term           = data.Rows[j]["Term"].ToStringEx(),
                        OpenTime       = data.Rows[j]["OpenTime"].TryToDateTimeToString("yyyy-MM-dd"),
                        NormalOpenCode = builder.ToString(),
                        Parity         = LotteryUtils.GetJOString(openCodeList, "双", "单"),
                        TheSum         = LotteryUtils.GetTheSum(openCodeList, GetSizeRatioSplitNumber(type), GetSumNumberCount(type)),
                        Size           = LotteryUtils.GetDXString(openCodeList, 5),
                        ThreeZoneRatio = LotteryUtils.Hd15x5SanQu(openCodeList),
                        SizeRatio      = LotteryUtils.GetProportionOfDX(openCodeList, 6),
                        ParityRatio    = LotteryUtils.GetProportionOfJO(openCodeList),
                        RatioOf012     = LotteryUtils.GetProportionOf012(openCodeList),
                        Span           = LotteryUtils.GetSpan(openCodeList).ToString(),
                        AC             = ac
                    });
                }
            }

            return(res.ToJson());
        }
Esempio n. 2
0
        /// <summary>
        /// 组装公共记录
        /// </summary>
        /// <param name="data"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        private string AppendCommonResult(DataTable data, SCCLottery type)
        {
            List <GPC11X5HistoryLotteryViewEntity> res = new List <GPC11X5HistoryLotteryViewEntity>();

            if (data.Rows.Count > 0)
            {
                //总共球个数
                int total = type.GetEnumText().TryToInt32();

                for (int j = 0; j < data.Rows.Count; j++)
                {
                    //开奖号集合
                    List <int>    openCodeList = new List <int>();
                    StringBuilder builder      = new StringBuilder();

                    for (int i = 1; i <= total; i++)
                    {
                        int openCode = data.Rows[j]["OpenCode" + i].TryToInt32();
                        openCodeList.Add(openCode);
                    }
                    builder.Append(GetOpenCodeTemplate(type, openCodeList));

                    res.Add(new GPC11X5HistoryLotteryViewEntity
                    {
                        Term           = data.Rows[j]["Term"].ToStringEx(),
                        OpenTime       = data.Rows[j]["OpenTime"].TryToDateTimeToString("yyyy-MM-dd HH:mm:ss"),
                        NormalOpenCode = builder.ToString(),
                        Parity         = LotteryUtils.GetJOString(openCodeList, "双", "单"),
                        TheSum         = LotteryUtils.GetTheSum(openCodeList, 30, GetSumNumberCount(type)),
                        Size           = LotteryUtils.GetDXString(openCodeList, 5),
                        SizeRatio      = LotteryUtils.GetProportionOfDX(openCodeList, 6),
                        ParityRatio    = LotteryUtils.GetProportionOfJO(openCodeList),
                        RatioOf012     = LotteryUtils.GetProportionOf012(openCodeList),
                        Span           = LotteryUtils.GetSpan(openCodeList).ToString(),
                    });
                }
            }

            return(res.ToJson());
        }