Exemple #1
0
        /// <summary>
        /// 获取开奖公告
        /// <param name="flowId">流水号</param>
        /// </summary>
        /// <returns>开奖公告对象</returns>
        public TBNumNotice Get(string flowId)
        {
            TBNumNotice tbNumNotice = null;

            try
            {
                string strSQL = "select * from TBNumNotice where flowId=:flowId";
                Param  param  = new Param();
                param.Clear();
                param.Add(":flowId", flowId);
                db.Open();
                ComDataReader dr = db.ExecuteReader(CommandType.Text, strSQL, param);
                if (dr.Read())
                {
                    tbNumNotice = ReadData(dr);
                }
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                db.Close();
            }
            return(tbNumNotice);
        }
Exemple #2
0
        /// <summary>
        /// 读取开奖公告信息
        /// <param name="dr">记录指针</param>
        /// </summary>
        /// <returns>开奖公告对象</returns>
        private TBNumNotice ReadData(ComDataReader dr)
        {
            TBNumNotice tbNumNotice = new TBNumNotice();

            tbNumNotice.flowId      = dr["flowId"].ToString();      //流水号
            tbNumNotice.lotteryType = dr["lotteryType"].ToString(); //彩种
            tbNumNotice.period      = dr["period"].ToString();      //期次
            tbNumNotice.startTime   = dr["startTime"].ToString();   //开售时间
            tbNumNotice.endTime     = dr["endTime"].ToString();     //截止时间
            tbNumNotice.publishTime = dr["publishTime"].ToString(); //开奖时间
            tbNumNotice.numbers     = dr["numbers"].ToString();     //开奖号码
            return(tbNumNotice);
        }
Exemple #3
0
        /// <summary>
        /// 修改开奖公告
        /// <param name="data">数据库连接</param>
        /// <param name="tbNumNotice">开奖公告</param>
        /// </summary>
        public void Edit(DataAccess data, TBNumNotice tbNumNotice)
        {
            string strSQL = "update TBNumNotice set lotteryType=:lotteryType,period=:period,startTime=:startTime,endTime=:endTime,publishTime=:publishTime,numbers=:numbers where flowId=:flowId";
            Param  param  = new Param();

            param.Clear();
            param.Add(":lotteryType", tbNumNotice.lotteryType); //彩种
            param.Add(":period", tbNumNotice.period);           //期次
            param.Add(":startTime", tbNumNotice.startTime);     //开售时间
            param.Add(":endTime", tbNumNotice.endTime);         //截止时间
            param.Add(":publishTime", tbNumNotice.publishTime); //开奖时间
            param.Add(":numbers", tbNumNotice.numbers);         //开奖号码
            param.Add(":flowId", tbNumNotice.flowId);           //流水号
            data.ExecuteNonQuery(CommandType.Text, strSQL, param);
        }
Exemple #4
0
        private DataAccess db = new DataAccess(DataAccess.DBConn);//数据库连接

        #region 代码生成器自动生成


        /// <summary>
        /// 增加开奖公告
        /// <param name="data">数据库连接</param>
        /// <param name="tbNumNotice">开奖公告</param>
        /// </summary>
        public void Add(DataAccess data, TBNumNotice tbNumNotice)
        {
            string strSQL = "insert into TBNumNotice (flowId,lotteryType,period,startTime,endTime,publishTime,numbers) values (:flowId,:lotteryType,:period,:startTime,:endTime,:publishTime,:numbers)";
            Param  param  = new Param();

            param.Clear();
            param.Add(":flowId", tbNumNotice.flowId);           //流水号
            param.Add(":lotteryType", tbNumNotice.lotteryType); //彩种
            param.Add(":period", tbNumNotice.period);           //期次
            param.Add(":startTime", tbNumNotice.startTime);     //开售时间
            param.Add(":endTime", tbNumNotice.endTime);         //截止时间
            param.Add(":publishTime", tbNumNotice.publishTime); //开奖时间
            param.Add(":numbers", tbNumNotice.numbers);         //开奖号码
            data.ExecuteNonQuery(CommandType.Text, strSQL, param);
        }
Exemple #5
0
 /// <summary>
 /// 修改开奖公告
 /// <param name="tbNumNotice">开奖公告</param>
 /// </summary>
 public void Edit(TBNumNotice tbNumNotice)
 {
     try
     {
         db.Open();
         Edit(db, tbNumNotice);
     }
     catch (Exception e)
     {
         throw e;
     }
     finally
     {
         db.Close();
     }
 }
Exemple #6
0
        /// <summary>
        /// 修改开奖公告
        /// </summary>
        /// <param name="data">数据库连接</param>
        /// <param name="tbNumNotice">开奖公告</param>
        public virtual void Edit(DataAccess data, TBNumNotice tbNumNotice)
        {
            string strSQL = "update TBNumNotice set lotteryType=@lotteryType,period=@period,startTime=@startTime,endTime=@endTime,publishTime=@publishTime,numbers=@numbers where flowId=@flowId and gameId=@gameId";
            Param  param  = new Param();

            param.Clear();
            param.Add("@lotteryType", tbNumNotice.lotteryType); //彩种
            param.Add("@period", tbNumNotice.period);           //期次
            param.Add("@startTime", tbNumNotice.startTime);     //开售时间
            param.Add("@endTime", tbNumNotice.endTime);         //截止时间
            param.Add("@publishTime", tbNumNotice.publishTime); //开奖时间
            param.Add("@numbers", tbNumNotice.numbers);         //开奖号码
            param.Add("@flowId", tbNumNotice.flowId);           //流水号
            param.Add("@gameId", tbNumNotice.gameId);           //游戏编号
            data.ExecuteNonQuery(CommandType.Text, strSQL, param);
        }
Exemple #7
0
 /// <summary>
 /// 增加开奖公告
 /// </summary>
 /// <param name="tbNumNotice">开奖公告</param>
 public virtual void Add(TBNumNotice tbNumNotice)
 {
     try
     {
         db.Open();
         Add(db, tbNumNotice);
     }
     catch (Exception e)
     {
         throw e;
     }
     finally
     {
         db.Close();
     }
 }
Exemple #8
0
        protected DataAccess db = new DataAccess(DataAccess.DBConn);//数据库连接

        #region 代码生成器自动生成


        /// <summary>
        /// 增加开奖公告
        /// </summary>
        /// <param name="data">数据库连接</param>
        /// <param name="tbNumNotice">开奖公告</param>
        public virtual void Add(DataAccess data, TBNumNotice tbNumNotice)
        {
            string strSQL = "insert into TBNumNotice (flowId,gameId,lotteryType,period,startTime,endTime,publishTime,numbers) values (@flowId,@gameId,@lotteryType,@period,@startTime,@endTime,@publishTime,@numbers)";
            Param  param  = new Param();

            param.Clear();
            param.Add("@flowId", tbNumNotice.flowId);           //流水号
            param.Add("@gameId", tbNumNotice.gameId);           //游戏编号
            param.Add("@lotteryType", tbNumNotice.lotteryType); //彩种
            param.Add("@period", tbNumNotice.period);           //期次
            param.Add("@startTime", tbNumNotice.startTime);     //开售时间
            param.Add("@endTime", tbNumNotice.endTime);         //截止时间
            param.Add("@publishTime", tbNumNotice.publishTime); //开奖时间
            param.Add("@numbers", tbNumNotice.numbers);         //开奖号码
            data.ExecuteNonQuery(CommandType.Text, strSQL, param);
        }