Ejemplo n.º 1
0
        /// <summary>
        ///     将此彩种指定期号和开奖号码保存至数据库
        /// </summary>
        /// <param name="QiHao">期号</param>
        /// <param name="OpenCode">开奖号码(形如01,02,03,04,05)</param>
        /// <param name="IsYesterdayRecord">是否是保存昨天的记录</param>
        /// <returns></returns>
        private bool SaveRecord(string QiHao, string OpenCode, bool IsYesterdayRecord)
        {
            if (!string.IsNullOrWhiteSpace(QiHao) && !string.IsNullOrWhiteSpace(OpenCode))
            {
                var model = new OpenCode8Model();
                model.Term = Convert.ToInt64(QiHao);
                var haoMaArray = OpenCode.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]);
                if (IsYesterdayRecord)
                {
                    model.OpenTime = CommonHelper.GenerateYesterdayOpenTime(Config, QiHao);
                }
                else
                {
                    model.OpenTime = CommonHelper.GenerateTodayOpenTime(Config, QiHao);
                }
                return(services.AddOpen8Code(currentLottery, model));
            }

            return(false);
        }
Ejemplo n.º 2
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 <OpenCode8Model>(ds.Tables[0]);
                OpenCode8Model 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);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 新增彩种开奖数据
        /// </summary>
        /// <param name="lottery">彩种名称</param>
        /// <param name="model">开奖数据模型</param>
        /// <returns></returns>
        public bool AddOpen8Code(SCCLottery lottery, OpenCode8Model 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("@OpenTime", model.OpenTime),
                new SqlParameter("@ID", Guid.NewGuid().ToString().Replace("-", ""))
            };
            var result = SqlHelper.ExecuteNonQuery(CommandType.Text, sqlString, param);

            return(result > 0);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 新增彩种开奖数据
        /// </summary>
        /// <param name="lottery">彩种名称</param>
        /// <param name="model">开奖数据模型</param>
        /// <returns></returns>
        public bool AddOpen8Code(SCCLottery lottery, OpenCode8Model model)
        {
            var TableName = lottery.GetSCCLotteryTableName();
            var sqlString = string.Format(AddItemSql, TableName);

            DbParameter[] param = new DbParameter[] {
                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("@OpenTime", model.OpenTime),
                new SqlParameter("@ID", Guid.NewGuid().ToString().Replace("-", ""))
            };
            var result = this.BaseRepository(DatabaseLinksEnum.LotteryNumber).ExecuteBySql(sqlString, param);

            return(result > 0);
        }
Ejemplo n.º 5
0
        /// <summary>
        ///     将此彩种指定期号和开奖号码保存至数据库
        /// </summary>
        /// <param name="QiHao">期号</param>
        /// <param name="OpenCode">开奖号码(形如01,02,03)</param>
        /// <param name="IsYesterdayRecord">是否是保存昨天的记录</param>
        /// <returns></returns>
        private bool SaveRecord(ShanXiXiAnKL10FEntity data)
        {
            var model = new OpenCode8Model();

            model.Term = Convert.ToInt64(data.Id); //期号
            var haoMaArray = data.OpenCode.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.OpenTime  = data.OpenTime;
            if (services.AddOpen8Code(currentLottery, model))
            {
                GetMaxPeriodNum((int)model.Term); //添加成功存放期数
                return(true);
            }

            return(false);
        }
Ejemplo n.º 6
0
 /// <summary>
 /// 新增彩种开奖数据
 /// </summary>
 /// <param name="lottery">彩种名称</param>
 /// <param name="model">开奖数据模型</param>
 /// <returns></returns>
 public bool AddOpen8Code(SCCLottery lottery, OpenCode8Model model)
 {
     return(iOpen8Code.AddOpen8Code(lottery, model));
 }