Пример #1
0
        /// <summary>
        /// 获取前一天失败列表
        /// 期号格式形如YYMMDDQQ
        /// </summary>
        /// <param name="lottery">彩种名称</param>
        /// <param name="TotalQNum">当前彩种每天总期数</param>
        /// <returns></returns>
        public List <string> GetYesterdayFailQQList(SCCLottery lottery, int TotalQNum)
        {
            List <string> result    = new List <string>();
            var           TableName = EnumHelper.GetSCCLotteryTableName(lottery);
            var           sqlString = string.Format(YesterdayListSql, TableName, CommonHelper.SCCSysDateTime.AddDays(-1).ToString("yyyyMMdd"));
            var           ds        = SqlHelper.ExecuteDataset(CommandType.Text, sqlString);
            long          tempQiHao = 0;

            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                var            data = LoadDataList <OpenCode9Model>(ds.Tables[0]);
                OpenCode9Model item = null;
                for (var i = 1; i <= TotalQNum; i++)
                {
                    tempQiHao = Convert.ToInt64(CommonHelper.GenerateYesterdayQiHaoYYMMDDQQ(i));
                    item      = data.Where(R => R.Term == tempQiHao).FirstOrDefault();
                    if (item == null)
                    {
                        result.Add(tempQiHao.ToString());
                    }
                }
            }
            else
            {
                for (var i = 1; i <= TotalQNum; i++)
                {
                    tempQiHao = Convert.ToInt64(CommonHelper.GenerateYesterdayQiHaoYYMMDDQQ(i));
                    result.Add(tempQiHao.ToString());
                }
            }
            return(result);
        }
Пример #2
0
        /// <summary>
        ///     将此彩种指定期号和开奖号码保存至数据库
        /// </summary>
        /// <param name="QiHao">期号</param>
        /// <param name="OpenCode">开奖号码(形如01,02,03)</param>
        /// <param name="IsYesterdayRecord">是否是保存昨天的记录</param>
        /// <returns></returns>
        private bool SaveRecord(BeiJingKZCEnitity data)
        {
            if (data == null)
            {
                return(false);
            }

            var model = new OpenCode9Model();

            model.Term = Convert.ToInt64(data.QiHao); //期号
            var haoMaArray = data.KaiJiangHao.Split(',');

            model.OpenCode1 = Convert.ToInt32(haoMaArray[0]);
            model.OpenCode2 = Convert.ToInt32(haoMaArray[1]);
            model.OpenCode3 = Convert.ToInt32(haoMaArray[2]);
            model.OpenCode4 = Convert.ToInt32(haoMaArray[3]);
            model.OpenCode5 = Convert.ToInt32(haoMaArray[4]);
            model.OpenCode6 = Convert.ToInt32(haoMaArray[5]);
            model.OpenCode7 = Convert.ToInt32(haoMaArray[6]);
            model.OpenCode8 = Convert.ToInt32(haoMaArray[7]);
            model.OpenCode9 = Convert.ToInt32(haoMaArray[8]);
            model.OpenTime  = data.OpenTime;
            if (services.AddOpen9Code(currentLottery, model))
            {
                GetMaxPeriodNum((int)model.Term);  //添加成功存放期数
                return(true);
            }

            return(false);
        }
Пример #3
0
        /// <summary>
        /// 新增彩种开奖数据
        /// </summary>
        /// <param name="lottery">彩种名称</param>
        /// <param name="model">开奖数据模型</param>
        /// <returns></returns>
        public bool AddOpen9Code(SCCLottery lottery, OpenCode9Model model)
        {
            var TableName = EnumHelper.GetSCCLotteryTableName(lottery);
            var sqlString = string.Format(AddItemSql, TableName);
            var param     = new SqlParameter[] {
                new SqlParameter("@Term", model.Term),
                new SqlParameter("@OpenCode1", model.OpenCode1),
                new SqlParameter("@OpenCode2", model.OpenCode2),
                new SqlParameter("@OpenCode3", model.OpenCode3),
                new SqlParameter("@OpenCode4", model.OpenCode4),
                new SqlParameter("@OpenCode5", model.OpenCode5),
                new SqlParameter("@OpenCode6", model.OpenCode6),
                new SqlParameter("@OpenCode7", model.OpenCode7),
                new SqlParameter("@OpenCode8", model.OpenCode8),
                new SqlParameter("@OpenCode9", model.OpenCode9),
                new SqlParameter("@OpenTime", model.OpenTime),
                new SqlParameter("@ID", Guid.NewGuid().ToString().Replace("-", ""))
            };
            var result = SqlHelper.ExecuteNonQuery(CommandType.Text, sqlString, param);

            return(result > 0);
        }