private void client_SetLotteryNumsInfoCompleted(object sender, SetLotteryNumsInfoCompletedEventArgs e)
 {
     Info = e.Result;
     Info.LotteryNums = txtLotteryNums.Text.Trim();
     Info.UpdateUser = "******";
     Info.UpdateTime = System.DateTime.Now;
     client.UpdateLotteryNumsAsync(Info);
 }
Ejemplo n.º 2
0
        static LotteryNumsInfo CreateModel(LotteryNumsInfo info)
        {
            LotteryNumsInfo lni = new LotteryNumsInfo();
            lni.AddTime = System.DateTime.Now;
            lni.AddUser = "******";
            lni.isDistributed = 0;
            lni.LotteryTypeID = info.LotteryTypeID;
            int lotterType = Convert.ToInt32(info.LotteryTypeID);
            lni.LotteryDate = info.LotteryDate;
            lni.IssueNo = info.IssueNo;
            if (lotterType == (int)LotteryType.SSC)
            {
                //期号
                string no = (Convert.ToInt32(lni.IssueNo.Substring(8, 3)) + 1).ToString();
                lni.IssueNo = lni.IssueNo.Substring(0, 8);
                if (no.Length == 1)
                    no = "00" + no;
                if (no.Length == 2)
                    no = "0" + no;
                if (Convert.ToInt32(no) ==121)
                {
                    lni.IssueNo = lni.IssueNo.Substring(0, 4) + "-" + lni.IssueNo.Substring(4, 2) + "-" + lni.IssueNo.Substring(6, 2);
                    lni.IssueNo=Convert.ToDateTime(lni.IssueNo).AddDays(1).ToString("yyyyMMdd");
                    no = "001";
                }
                lni.IssueNo = lni.IssueNo + no;
                //开奖时间,10-22点十分钟一次,22-2点5分钟一次
                if ((lni.LotteryDate.Hour < 22 && lni.LotteryDate.Hour > 2))
                {
                    lni.LotteryDate = lni.LotteryDate.AddMinutes(10);
                }
                else if (lni.LotteryDate.ToString("HH:mm:ss") == "01:55:00")
                    lni.LotteryDate = lni.LotteryDate.AddHours(8).AddMinutes(5);
                else
                    lni.LotteryDate = lni.LotteryDate.AddMinutes(5);

            }
            if (lotterType == (int)LotteryType._3D)
            {
                if (lni.LotteryDate.Month == 12 && lni.LotteryDate.Day == 31)
                {
                    lni.LotteryDate = lni.LotteryDate.AddYears(1).Date.AddHours(20).AddMinutes(30);
                    lni.IssueNo = lni.LotteryDate.AddYears(1).Year.ToString() + "001";
                }
                else
                {
                    lni.LotteryDate = lni.LotteryDate.AddDays(1);
                    string no = (Convert.ToInt32(lni.IssueNo.Substring(4, 3))+1).ToString();
                    lni.IssueNo = lni.IssueNo.Substring(0, 4);
                    if (no.Length == 2)
                        no = "0" + no;
                    if (no.Length == 1)
                        no = "00" + no;
                    lni.IssueNo = lni.IssueNo + no;
                }
            }
            if (lotterType == (int)LotteryType.SSQ)
            {
                if (lni.LotteryDate.Month == 12 && lni.LotteryDate.Day == 31)
                {
                    if(lni.LotteryDate.DayOfWeek==DayOfWeek.Thursday)
                        lni.LotteryDate = lni.LotteryDate.AddYears(1).Date.AddHours(21).AddMinutes(30).AddDays(3);
                    else
                        lni.LotteryDate = lni.LotteryDate.AddYears(1).Date.AddHours(21).AddMinutes(30).AddDays(2);
                    lni.IssueNo = lni.LotteryDate.AddYears(1).Year.ToString() + "001";
                }
                else
                {
                    if (lni.LotteryDate.DayOfWeek == DayOfWeek.Thursday)
                        lni.LotteryDate = lni.LotteryDate.AddDays(3);
                    else
                        lni.LotteryDate = lni.LotteryDate.AddDays(2);
                    string no = (Convert.ToInt32(lni.IssueNo.Substring(4, 3)) + 1).ToString();
                    lni.IssueNo = lni.IssueNo.Substring(0, 4);
                    if (no.Length == 2)
                        no = "0" + no;
                    if (no.Length == 1)
                        no = "00" + no;
                    lni.IssueNo = lni.IssueNo + no;
                }
            }

            return lni;
        }
Ejemplo n.º 3
0
        static void timerSSQ_Elapsed(object sender, ElapsedEventArgs e)
        {
            try
            {
                lock (obj_lockSSQ)
                {
                    StringBuilder sb = new StringBuilder();
                    sb.AppendLine("SSQ===>" + System.DateTime.Now.ToString() + ",开始采集");
                    string data = GetSSQNums(SSQInfo.IssueNo);
                    if (data != string.Empty)
                    {
                        SSQInfo.LotteryNums = data;
                        SSQInfo.UpdateUser = "******";
                        SSQInfo.UpdateTime = System.DateTime.Now;
                        s.UpdateLotteryNums(SSQInfo);
                        LotteryNumsInfo l = CreateModel(SSQInfo);
                        LotteryNumsInfo current = s.GetCurrenIssuNo((int)LotteryType.SSQ);
                        if (current == null || Convert.ToInt64(current.IssueNo) < Convert.ToInt64(l.IssueNo))
                        {
                            int result = s.InsertLotteryNums(l);
                            if (result > 0)
                                ThreadPool.QueueUserWorkItem(new WaitCallback(SSQPaiJiang));
                        }
                        sb.AppendLine("SSQ===>" + System.DateTime.Now.ToString() + ",期号:" + SSCInfo.IssueNo);
                        sb.AppendLine("SSQ===>" + System.DateTime.Now.ToString() + ",开奖号码:" + SSCInfo.LotteryNums);
                        SSQInfo = SetLotteryNumsInfo((int)LotteryType.SSQ);
                        TimeSpan ts = SSQInfo.LotteryDate.AddMinutes(5) - System.DateTime.Now;

                        if (ts.TotalSeconds > 0)
                        {
                            timer3D.Stop();
                            sb.AppendLine("SSQ===>" + System.DateTime.Now.ToString() + ",暂停采集(分):" + ts.Milliseconds.ToString("F2"));
                            Console.WriteLine(sb.ToString());
                            Thread.Sleep(Convert.ToInt32(ts.TotalMilliseconds));
                            timer3D.Start();
                        }

                    }
                    else
                    {
                        TimeSpan ts = SSQInfo.LotteryDate.AddMinutes(5) - System.DateTime.Now;
                        if (ts.TotalSeconds > 0)
                        {
                            timerSSQ.Stop();
                            sb.AppendLine("SSQ===>" + System.DateTime.Now.ToString() + ",暂停采集(分):" + ts.TotalMinutes.ToString("F2"));
                            Console.WriteLine(sb.ToString());
                            SSQInfo = s.GetCurrenIssuNo((int)LotteryType.SSQ);
                            Thread.Sleep(Convert.ToInt32(ts.TotalMilliseconds));
                            timerSSQ.Start();
                        }
                        else
                        {
                            sb.AppendLine("SSQ===>" + System.DateTime.Now.ToString() + ",未采集到数据");
                            Console.WriteLine(sb.ToString());
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("SSQ Exception:" + ex.Message);
            }
        }
Ejemplo n.º 4
0
 static void ThSSQ_Fun(Object stateInfo)
 {
     SSQInfo = SetLotteryNumsInfo((int)LotteryType.SSQ);
     timerSSQ_Elapsed(null, null);
     timerSSQ.Start();
 }
Ejemplo n.º 5
0
 static void Th3D_Fun(Object stateInfo)
 {
     _3DInfo = SetLotteryNumsInfo((int)LotteryType._3D);
     timer3D_Elapsed(null, null);
     timer3D.Start();
 }
Ejemplo n.º 6
0
        private BetRecord JudgeWin(BetRecord record, LotteryNumsInfo ltyNum)
        {
            record.UpdateTime = DateTime.Now;
            record.WinMoney = 0;
            int winCount = 0;
            string winNum = string.Empty;
            string[] betNums ;
            string[] arr_winNum;
            string[] arr_odd=null;
            switch ((PlayType)record.PlayTypeID)
            {
                case PlayType._3xZhix  ://SSC三星直选
                    #region
                    if (ltyNum.LotteryNums.Length != 5)
                        break;
                    if (record.PlayTypeRadioID == 1 || record.PlayTypeRadioID == 2)//后三直选
                        winNum = ltyNum.LotteryNums.Substring(2, 3);
                    else//前三直选
                        winNum = ltyNum.LotteryNums.Substring(0, 3);
                    betNums = record.BetNums.Split('$');
                    foreach (string num in betNums)
                    {
                        string[] nums = num.Split(',');
                        if (nums.Length != 3&&nums.Length==1)
                        {
                            if (nums[0] == winNum)
                            {
                                winCount++;
                            }
                            continue;
                        }
                        if (!nums[0].Contains(winNum.First()))
                        {
                            continue;
                        }
                        if (!nums[1].Contains(winNum.Substring(1,1)))
                        {
                            continue;
                        }
                        if (!nums[2].Contains(winNum.Last()))
                        {
                            continue;
                        }
                        winCount += 1;
                    }
                    break;
                #endregion
                case PlayType._3xZux   ://SSC三星组选
                    #region
                    if (ltyNum.LotteryNums.Length != 5)
                        break;
                     if (record.PlayTypeRadioID == 5
                         || record.PlayTypeRadioID == 6
                         ||record.PlayTypeRadioID==7)//后三组选
                     {
                         winNum = ltyNum.LotteryNums.Substring(2, 3);
                     }
                     else//前三组选
                     {
                         winNum = ltyNum.LotteryNums.Substring(0, 3);
                     }
                    betNums = record.BetNums.Split('$');
                    if (record.PlayTypeRadioID == 6 || record.PlayTypeRadioID == 9)//买组3
                    {
                        if (JudgeNumsType(winNum) != NumType.Zu3)//开组6或者豹子
                            break;

                    }
                    else if (record.PlayTypeRadioID == 5 || record.PlayTypeRadioID == 8)//买组6
                    {
                        if (JudgeNumsType(winNum) != NumType.Zu6)//开组3或者豹子
                            break;
                    }
                    else//组选混合
                    {
                        foreach (string num in betNums)
                        {
                            if (JudgeNumsType(winNum) != JudgeNumsType(num))//组选混合时形态不一致则未中奖
                                continue;
                            if (num.Contains(winNum.First())
                                && num.Contains(winNum.Substring(1, 1))
                                && num.Contains(winNum.Last()))
                                winCount += 1;
                        }
                        break;
                    }
                    foreach (string num in betNums)
                    {
                        if (num.Contains(winNum.First())
                            && num.Contains(winNum.Substring(1, 1))
                            && num.Contains(winNum.Last()))
                            winCount += 1;
                    }
                    break;
                    #endregion
                case PlayType._2xZhix  ://SSC二星直选
                    #region
                    if (ltyNum.LotteryNums.Length != 5)
                        break;
                    if (record.PlayTypeRadioID == 11 || record.PlayTypeRadioID == 12)//后二直选
                        winNum = ltyNum.LotteryNums.Substring(3, 2);
                    else//前二直选
                        winNum = ltyNum.LotteryNums.Substring(0, 2);
                    betNums = record.BetNums.Split('$');
                    foreach (string num in betNums)
                    {
                        string[] nums = num.Split(',');
                        if (nums.Length==1)
                        {
                            if (nums[0] == winNum)
                            {
                                winCount++;
                            }
                            continue;
                        }
                        if (!nums[0].Contains(winNum.First()))
                        {
                            continue;
                        }
                        if (!nums[1].Contains(winNum.Last()))
                        {
                            continue;
                        }
                        winCount += 1;
                    }
                    break;
                #endregion
                case PlayType._2xZux   ://SSC二星组选
                    #region
                    if (ltyNum.LotteryNums.Length != 5)
                        break;
                     if (record.PlayTypeRadioID == 15
                         || record.PlayTypeRadioID == 16)//后二组选
                     {
                         winNum = ltyNum.LotteryNums.Substring(3, 2);
                     }
                     else//前二组选
                     {
                         winNum = ltyNum.LotteryNums.Substring(0, 2);
                     }
                    betNums = record.BetNums.Split('$');
                    if (record.PlayTypeRadioID == 15 || record.PlayTypeRadioID == 17)//买组二(不包含组3形态即2个号码相同)
                    {
                        if (winNum.Last() == winNum.First())
                            break;
                    }
                    else//组选二混合
                    {
                        foreach (string num in betNums)
                        {
                            if (JudgeNumsType(num) != JudgeNumsType(winNum))//组选二混合时形态不一直则未中奖
                                continue;
                            if (num.Contains(winNum.First())
                                && num.Contains(winNum.Last()))
                                winCount += 1;
                        }
                        break;
                    }
                    foreach (string num in betNums)
                    {
                        if (num.Contains(winNum.First())
                            && num.Contains(winNum.Last()))
                            winCount += 1;
                    }
                    break;
                    #endregion
                case PlayType._H1Zhix:
                    #region
                    if (ltyNum.LotteryNums.Length != 5)
                        break;
                    winNum = ltyNum.LotteryNums.Substring(4, 1);//后一直选
                    betNums = record.BetNums.Split('$');
                    foreach (string num in betNums)
                    {
                        if(num.Contains(winNum))
                            winCount += 1;
                    }
                    break;
                    #endregion
                case PlayType._Bddw    :
                    #region
                    if (ltyNum.LotteryNums.Length != 5)
                        break;
                    winNum = ltyNum.LotteryNums;
                    if (record.PlayTypeRadioID == 20)
                        winNum = winNum.Substring(2, 3);
                    if (record.PlayTypeRadioID == 21)
                        winNum = winNum.Substring(0, 3);
                    betNums = record.BetNums.Split('$');
                    foreach (string num in betNums)
                    {
                        for (int i = 0; i < num.Length; i++)
                        {
                            if (winNum.Contains(num.Substring(i, 1)))
                                winCount++;
                        }
                    }
                    break;
                    #endregion
                case PlayType._Ddw     :
                    #region
                    if (ltyNum.LotteryNums.Length != 5)
                        break;
                    winNum = ltyNum.LotteryNums;
                    betNums = record.BetNums.Split('$');
                    foreach (string num in betNums)
                    {
                        if (num.Trim() == string.Empty)
                            continue;
                        string[] nums = num.Split(',');
                        for (int i = 0; i < winNum.Length; i++)
                        {
                            if (nums[i].Contains(winNum.Substring(i, 1)))
                                winCount++;
                        }
                    }
                    break;
                    #endregion
                case PlayType._R3Zhix://RX三星直选
                    #region
                    if (ltyNum.LotteryNums.Length != 5)
                        break;
                    betNums = record.BetNums.Split('$');
                    foreach (string num in betNums)
                    {
                        bool isMatch = true;
                        string[] _nums = num.Split(',');
                        for (int i = 0; i < 5; i++)
                        {
                            if (_nums[i].Trim() == string.Empty)
                                continue;
                            else
                            {
                                if (!_nums[i].Contains(ltyNum.LotteryNums.Substring(i, 1)))
                                {
                                    isMatch = false;
                                    break;
                                }
                            }
                        }
                        if(isMatch)
                            winCount++;
                    }
                    break;
                    #endregion
                case PlayType._R3Zux://RX三星组选
                    #region
                    if (ltyNum.LotteryNums.Length != 5)
                        break;
                    string str = record.PlayTypeDirection.Substring(record.PlayTypeDirection.IndexOf("(")+1,
                        record.PlayTypeDirection.IndexOf(")") - record.PlayTypeDirection.IndexOf("(")-2);
                    string[] checkboxs = str.Split(',');
                    foreach (string cb in checkboxs)
                    {
                        switch (cb.ToLower())
                        {
                            case "万":
                                winNum = winNum + ltyNum.LotteryNums.Substring(0, 1);
                                break;
                            case "千":
                                winNum = winNum + ltyNum.LotteryNums.Substring(1, 1);
                                break;
                            case "百":
                                winNum = winNum + ltyNum.LotteryNums.Substring(2, 1);
                                break;
                            case "十":
                                winNum = winNum + ltyNum.LotteryNums.Substring(3, 1);
                                break;
                            case "个":
                                winNum = winNum + ltyNum.LotteryNums.Substring(4, 1);
                                break;
                        }
                    }
                     betNums = record.BetNums.Split('$');
                    if (record.PlayTypeRadioID == 49)//买组3
                    {
                        if (JudgeNumsType(winNum) != NumType.Zu3)//开组6或者豹子
                            break;

                    }
                    else if (record.PlayTypeRadioID == 50)//买组6
                    {
                        if (JudgeNumsType(winNum) != NumType.Zu6)//开组3或者豹子
                            break;
                    }
                    else//组选混合
                    {
                        foreach (string num in betNums)
                        {
                            if (JudgeNumsType(winNum) != JudgeNumsType(num))//组选混合时形态不一致则未中奖
                                continue;
                            if (num.Contains(winNum.First())
                                && num.Contains(winNum.Substring(1, 1))
                                && num.Contains(winNum.Last()))
                                winCount += 1;
                        }
                        break;
                    }
                    foreach (string num in betNums)
                    {
                        if (num.Contains(winNum.First())
                            && num.Contains(winNum.Substring(1, 1))
                            && num.Contains(winNum.Last()))
                            winCount += 1;
                    }
                    break;
                    #endregion
                case PlayType._R2Zhix://RX二星直选
                    #region
                    if (ltyNum.LotteryNums.Length != 5)
                        break;
                     betNums = record.BetNums.Split('$');
                    foreach (string num in betNums)
                    {
                        bool isMatch = true;
                        string[] _nums = num.Split(',');
                        for (int i = 0; i < 5; i++)
                        {
                            if (_nums[i].Trim() == string.Empty)
                                continue;
                            else
                            {
                                if (!_nums[i].Contains(ltyNum.LotteryNums.Substring(i, 1)))
                                {
                                    isMatch = false;
                                    break;
                                }
                            }
                        }
                       if(isMatch)
                            winCount++;
                    }
                    break;
                    #endregion
                case PlayType._R2Zux://RX二星组选
                    #region
                    if (ltyNum.LotteryNums.Length != 5)
                        break;
                    string str2 = record.PlayTypeDirection.Substring(record.PlayTypeDirection.IndexOf("(")+1,
                        record.PlayTypeDirection.IndexOf(")") - record.PlayTypeDirection.IndexOf("(")-2);
                    string[] checkboxs2 = str2.Split(',');
                    foreach (string cb in checkboxs2)
                    {
                        switch (cb.ToLower())
                        {
                            case "万":
                                winNum = winNum + ltyNum.LotteryNums.Substring(0, 1);
                                break;
                            case "千":
                                winNum = winNum + ltyNum.LotteryNums.Substring(1, 1);
                                break;
                            case "百":
                                winNum = winNum + ltyNum.LotteryNums.Substring(2, 1);
                                break;
                            case "十":
                                winNum = winNum + ltyNum.LotteryNums.Substring(3, 1);
                                break;
                            case "个":
                                winNum = winNum + ltyNum.LotteryNums.Substring(4, 1);
                                break;
                        }
                    }
                     betNums = record.BetNums.Split('$');
                    foreach (string num in betNums)
                    {
                        if (JudgeNumsType(winNum) != JudgeNumsType(num))//组选混合时形态不一致则未中奖
                            continue;
                        if (num.Contains(winNum.First())
                            && num.Contains(winNum.Substring(1, 1))
                            && num.Contains(winNum.Last()))
                            winCount += 1;
                    }
                    break;
                    #endregion
                case PlayType._Rbdw://RX任不定位
                    #region
                    if (ltyNum.LotteryNums.Length != 5)
                        break;
                    winNum = ltyNum.LotteryNums;
                    if (record.PlayTypeRadioID == 56)
                        winNum = winNum.Substring(2, 3);
                    if (record.PlayTypeRadioID == 57)
                        winNum = winNum.Substring(0, 3);
                    betNums = record.BetNums.Split('$');
                    foreach (string num in betNums)
                    {
                        for (int i = 0; i < num.Length; i++)
                        {
                            if (winNum.Contains(num.Substring(i, 1)))
                                winCount++;
                        }
                    }
                    break;
                    #endregion
                case PlayType._Rydw://RX任意定位
                    #region
                    if (ltyNum.LotteryNums.Length != 5)
                        break;
                    winNum = ltyNum.LotteryNums;
                    betNums = record.BetNums.Split('$');
                    foreach (string num in betNums)
                    {
                        string[] nums = num.Split(',');
                        for (int i = 0; i < winNum.Length; i++)
                        {
                            if (nums[i].Contains(winNum.Substring(i, 1)))
                                winCount++;
                        }
                    }
                    break;
                    #endregion

                case PlayType._3DZhix  :
                    #region
                    if (ltyNum.LotteryNums.Length != 3)
                        break;
                    winNum = ltyNum.LotteryNums;
                    betNums = record.BetNums.Split('$');
                    foreach (string num in betNums)
                    {
                        string[] nums = num.Split(',');
                        if (nums.Length != 3&&nums.Length==1)
                        {
                            if (nums[0] == winNum)
                            {
                                winCount++;
                            }
                            continue;
                        }
                        if (!nums[0].Contains(winNum.First()))
                        {
                            continue;
                        }
                        if (!nums[1].Contains(winNum.Substring(1,1)))
                        {
                            continue;
                        }
                        if (!nums[2].Contains(winNum.Last()))
                        {
                            continue;
                        }
                        winCount += 1;
                    }
                    break;
                #endregion
                case PlayType._3DZux   :
                    #region
                    if (ltyNum.LotteryNums.Length != 3)
                        break;
                    winNum = ltyNum.LotteryNums;
                    betNums = record.BetNums.Split('$');
                    if (record.PlayTypeRadioID == 27)//买组3
                    {
                        if (JudgeNumsType(winNum) != NumType.Zu3)//开组6或者豹子
                            break;

                    }
                    else if (record.PlayTypeRadioID == 26)//买组6
                    {
                        if (JudgeNumsType(winNum) != NumType.Zu6)//开组3或者豹子
                            break;
                    }
                    else//组选混合
                    {
                        foreach (string num in betNums)
                        {
                            if (JudgeNumsType(winNum) != JudgeNumsType(num))//组选混合时形态不一致则未中奖
                                continue;
                            if (num.Contains(winNum.First())
                                && num.Contains(winNum.Substring(1, 1))
                                && num.Contains(winNum.Last()))
                                winCount += 1;
                        }
                        break;
                    }
                    foreach (string num in betNums)
                    {
                        if (num.Contains(winNum.First())
                            && num.Contains(winNum.Substring(1, 1))
                            && num.Contains(winNum.Last()))
                            winCount += 1;
                    }
                    break;
                    #endregion
                case PlayType._3D2xZhix:
                    #region
                    if (ltyNum.LotteryNums.Length != 3)
                        break;
                    winNum = ltyNum.LotteryNums.Substring(1, 2);
                    betNums = record.BetNums.Split('$');
                    foreach (string num in betNums)
                    {
                        string[] nums = num.Split(',');
                        if (nums.Length==1)
                        {
                            if (nums[0] == winNum)
                            {
                                winCount++;
                            }
                            continue;
                        }
                        if (!nums[0].Contains(winNum.First()))
                        {
                            continue;
                        }
                        if (!nums[1].Contains(winNum.Last()))
                        {
                            continue;
                        }
                        winCount += 1;
                    }
                    break;
                #endregion
                case PlayType._3D2xZux :
                    #region
                    if (ltyNum.LotteryNums.Length != 3)
                        break;
                    winNum = ltyNum.LotteryNums.Substring(1, 2);
                    betNums = record.BetNums.Split('$');
                    if (record.PlayTypeRadioID == 31)//买组二(不包含组3形态即2个号码相同)
                    {
                        if (winNum.Last() == winNum.First())
                            break;
                    }
                    else//组选二混合
                    {
                        foreach (string num in betNums)
                        {
                            if (JudgeNumsType(num) != JudgeNumsType(winNum))//组选二混合时形态不一直则未中奖
                                continue;
                            if (num.Contains(winNum.First())
                                && num.Contains(winNum.Last()))
                                winCount += 1;
                        }
                    }
                    foreach (string num in betNums)
                    {
                        if (num.Contains(winNum.First())
                            && num.Contains(winNum.Last()))
                            winCount += 1;
                    }
                    break;
                    #endregion
                case PlayType._3DH1Zhix:
                    #region
                    if (ltyNum.LotteryNums.Length != 3)
                        break;
                    winNum = ltyNum.LotteryNums.Substring(2, 1);//后一直选
                    betNums = record.BetNums.Split('$');
                    foreach (string num in betNums)
                    {
                        if(num.Contains(winNum))
                            winCount += 1;
                    }
                    break;
                    #endregion
                case PlayType._3DBddw  :
                    #region
                    if (ltyNum.LotteryNums.Length != 3)
                        break;
                    winNum = ltyNum.LotteryNums;
                    betNums = record.BetNums.Split('$');
                    foreach (string num in betNums)
                    {
                        for (int i = 0; i < num.Length; i++)
                        {
                            if (winNum.Contains(num.Substring(i, 1)))
                                winCount++;
                        }
                    }
                    break;
                    #endregion
                case PlayType._3DDdw   :
                    #region
                    if (ltyNum.LotteryNums.Length != 3)
                        break;
                    winNum = ltyNum.LotteryNums;
                    betNums = record.BetNums.Split('$');
                    foreach (string num in betNums)
                    {
                        string[] nums = num.Split(',');
                        for (int i = 0; i < winNum.Length; i++)
                        {
                            if (nums[i].Contains(winNum.Substring(i, 1)))
                                winCount++;
                        }
                    }
                    break;
                    #endregion
                case PlayType._SSQBlue:
                    #region
                    if (ltyNum.LotteryNums.Split(',').Length!=7)
                        break;
                    arr_winNum = ltyNum.LotteryNums.Split(',');
                    winNum = arr_winNum[6];
                    betNums = record.BetNums.Split('$');
                    foreach (string num in betNums)
                    {
                        string[] nums = num.Split(',');
                        if (nums.Contains(winNum))
                            winCount++;
                    }
                    break;
                    #endregion
                case PlayType._SSQRed  :
                    #region
                    if (ltyNum.LotteryNums.Split(',').Length!=7)
                        break;
                    winNum = ltyNum.LotteryNums.Substring(0, ltyNum.LotteryNums.Length - 3);
                    arr_winNum=winNum.Split(',');
                    betNums = record.BetNums.Split('$');
                    foreach (string num in betNums)
                    {
                        string[] nums = num.Split(',');
                        foreach (string _num in arr_winNum)
                        {
                            if (nums.Contains(_num))
                                winCount++;
                        }
                    }
                    break;
                    #endregion
                case PlayType.NSSCBdw  :
                    #region
                    if (ltyNum.LotteryNums.Length != 5)
                        break;
                    winNum = ltyNum.LotteryNums;
                    if (record.PlayTypeRadioID == 38)
                        winNum = winNum.Substring(4, 1);
                    if (record.PlayTypeRadioID == 39)
                        winNum = winNum.Substring(3, 2);
                    if (record.PlayTypeRadioID == 40)
                        winNum = winNum.Substring(2, 3);
                    if(!winNum.Contains(record.BetNums))
                    {
                        winCount++;
                        record.WinMoney = record.BetMoney * 2;
                    }
                    break;
                    #endregion
                case PlayType.N3DBdw   :
                    #region
                    if (ltyNum.LotteryNums.Length != 3)
                        break;
                    winNum = ltyNum.LotteryNums;
                    if (record.PlayTypeRadioID == 42)
                        winNum = winNum.Substring(2, 1);
                    if (record.PlayTypeRadioID == 43)
                        winNum = winNum.Substring(1, 2);
                    if (!winNum.Contains(record.BetNums))
                    {
                        winCount++;
                        record.WinMoney = record.BetMoney * 2;
                    }
                    break;
                    #endregion
                case PlayType.NSSQBlue :
                    #region
                    if (ltyNum.LotteryNums.Split(',').Length!=7)
                        break;
                    arr_winNum = ltyNum.LotteryNums.Split(',');
                    winNum = arr_winNum[6];
                    if (!winNum.Contains(record.BetNums))
                    {
                        winCount++;
                        record.WinMoney = record.BetMoney * 2;
                    }
                    break;
                    #endregion
                case PlayType.NSSQRed  :
                    #region
                    if (ltyNum.LotteryNums.Split(',').Length!=7)
                        break;
                    winNum = ltyNum.LotteryNums.Substring(0, ltyNum.LotteryNums.Length - 3);
                    if (!winNum.Contains(record.BetNums))
                    {
                        winCount++;
                        record.WinMoney = record.BetMoney * 2;
                    }
                    break;
                    #endregion
            }
            record.IsWin = winCount == 0 ? 0 : 1;
            record.WinCount = winCount;
            if ((PlayType)record.PlayTypeID != PlayType.N3DBdw
                && (PlayType)record.PlayTypeID != PlayType.NSSCBdw
                && (PlayType)record.PlayTypeID != PlayType.NSSQBlue
                && (PlayType)record.PlayTypeID != PlayType.NSSQRed)
            {
                arr_odd = record.OddBonus.Split('/');
                record.WinMoney = Math.Round(Convert.ToDouble(arr_odd[0]) * record.BetMultiple*record.WinCount, 2);
            }
            return record;
        }