Ejemplo n.º 1
0
        public void Start(JJApiKit jjKit, List <JJOG1K3Result> list, long currentIssueNo)
        {
            OG1K3List = list;
            int    res   = GetPrevBettingResult(lastBetRecord.IssueNo, Type);
            string codes = "";

            if (Type == TouzhuTypeEnum.大小)
            {
                codes = list[0].daxiao;
            }
            else
            {
                codes = list[0].danshuang;
            }
            int rCount   = GetRepeatTimes(codes);
            var valueNum = TurnSelected(codes);

            switch (res)
            {
            case -1:    //未找到
                lastBetRecord = new TouzhuEntity();
                break;

            case 0:    //未投注
            {
                if (rCount == RepeatSum)
                {
                    //去投注
                    BettingDaxiao(jjKit, currentIssueNo, codes, BaseMoney);
                }
            }
            break;

            case 1:    //投注成功
            {
                JJOG1K3Result entity = OG1K3List.Find(o => o.issueNo == lastBetRecord.IssueNo);
                JJ_BetSingleDAL.Instance.UploadResult(lastBetRecord.IssueNo, entity.daxiao);

                ClearFaileRecord();
            }
            break;

            case 2:    //投注失败
            {
                betFaileRecordList.Add(lastBetRecord);
                JJOG1K3Result entity = OG1K3List.Find(o => o.issueNo == lastBetRecord.IssueNo);
                JJ_BetSingleDAL.Instance.UploadResult(lastBetRecord.IssueNo, entity.daxiao);
                int failCount = GetBetFaileNum();
                int money     = BaseMoney * (failCount * 3);
                //去投注
                BettingDaxiao(jjKit, currentIssueNo, codes, money);
            }
            break;

            default:
                break;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 大小投注
        /// </summary>
        /// <param name="failNum">容错次数</param>
        /// <param name="repeatNum">重复次数</param>
        public void BettingDaxiao(JJApiKit jjKit, long currentIssueNo, string valueNum, int money)
        {
            if (currentIssueNo <= lastBetRecord.IssueNo)
            {
                return;
            }
            JJBetEnum codes = valueNum == "大" ? JJBetEnum.大 : JJBetEnum.小;

            #region 调用API投注
            //string html = jjKit.BetSingle(currentIssueNo, money, codes);
            #endregion

            #region 存档
            int isExist = JJ_BetSingleDAL.Instance.GetSingle(currentIssueNo.ToString());
            if (isExist == 0)
            {
                DBParamEntity[] pramsAdd =
                {
                    new DBParamEntity()
                    {
                        FieldName = "issueNo", Value = currentIssueNo
                    },
                    new DBParamEntity()
                    {
                        FieldName = "codes", Value = valueNum
                    },
                    new DBParamEntity()
                    {
                        FieldName = "money", Value = money
                    },
                };
                int res = JJ_BetSingleDAL.Instance.Add(pramsAdd);
                //msg("期数=" + entity.issueNo + ",值=" + item.lotteryOpen);
            }
            #endregion
            lastBetRecord = new TouzhuEntity()
            {
                bs = 1, codes = codes, money = money, IssueNo = currentIssueNo
            };
        }
Ejemplo n.º 3
0
 public void ClearFaileRecord()
 {
     betFaileRecordList = new List <TouzhuEntity>();
     lastBetRecord      = new TouzhuEntity();
 }