Esempio n. 1
0
        /// <summary>
        /// 修改彩票订单
        /// </summary>
        /// <param name="data">数据库连接</param>
        /// <param name="ttLotteryOrder">彩票订单</param>
        public virtual void Edit(DataAccess data, TTLotteryOrder ttLotteryOrder)
        {
            string strSQL = "update TTLotteryOrder set agentId=@agentId,siteId=@siteId,terminalId=@terminalId,clientId=@clientId,clientName=@clientName,cardId=@cardId,gameId=@gameId,lotteryType=@lotteryType,period=@period,userBetCodes=@userBetCodes,centerBetCodes=@centerBetCodes,multiple=@multiple,betFee=@betFee,betTime=@betTime,isChase=@isChase,chaseOrderId=@chaseOrderId,orderStatus=@orderStatus,orderTime=@orderTime,awardResult=@awardResult,awardMoney=@awardMoney,awardTime=@awardTime,settleStatus=@settleStatus,settleTime=@settleTime,createTime=To_date(@createTime,'yyyy-mm-dd hh24:mi:ss'),srcType=@srcType where orderId=@orderId";
            Param  param  = new Param();

            param.Clear();
            param.Add("@agentId", ttLotteryOrder.agentId);               //代理商编号
            param.Add("@siteId", ttLotteryOrder.siteId);                 //门店编号
            param.Add("@terminalId", ttLotteryOrder.terminalId);         //终端编号
            param.Add("@clientId", ttLotteryOrder.clientId);             //客户编号
            param.Add("@clientName", ttLotteryOrder.clientName);         //客户名称
            param.Add("@cardId", ttLotteryOrder.cardId);                 //卡号
            param.Add("@gameId", ttLotteryOrder.gameId);                 //游戏编号
            param.Add("@lotteryType", ttLotteryOrder.lotteryType);       //彩种
            param.Add("@period", ttLotteryOrder.period);                 //期次
            param.Add("@userBetCodes", ttLotteryOrder.userBetCodes);     //用户投注串
            param.Add("@centerBetCodes", ttLotteryOrder.centerBetCodes); //中心投注串
            param.Add("@multiple", ttLotteryOrder.multiple);             //倍数
            param.Add("@betFee", ttLotteryOrder.betFee);                 //投注金额
            param.Add("@betTime", ttLotteryOrder.betTime);               //投注时间
            param.Add("@isChase", ttLotteryOrder.isChase);               //是否追号
            param.Add("@chaseOrderId", ttLotteryOrder.chaseOrderId);     //追号订单编号
            param.Add("@orderStatus", ttLotteryOrder.orderStatus);       //订单状态
            param.Add("@orderTime", ttLotteryOrder.orderTime);           //出票/撤销时间
            param.Add("@awardResult", ttLotteryOrder.awardResult);       //中奖状态
            param.Add("@awardMoney", ttLotteryOrder.awardMoney);         //中奖金额
            param.Add("@awardTime", ttLotteryOrder.awardTime);           //返奖时间
            param.Add("@settleStatus", ttLotteryOrder.settleStatus);     //结算状态
            param.Add("@settleTime", ttLotteryOrder.settleTime);         //结算时间
            param.Add("@createTime", ttLotteryOrder.createTime);         //创建时间
            param.Add("@srcType", ttLotteryOrder.srcType);               //数据来源方式
            param.Add("@orderId", ttLotteryOrder.orderId);               //订单号
            data.ExecuteNonQuery(CommandType.Text, strSQL, param);
        }
Esempio n. 2
0
        /// <summary>
        /// 获取彩票订单
        /// </summary>
        /// <param name="orderId">订单号</param>
        /// <returns>彩票订单对象</returns>
        public virtual TTLotteryOrder Get(string orderId)
        {
            TTLotteryOrder ttLotteryOrder = null;

            try
            {
                string strSQL = "select * from TTLotteryOrder where orderId=@orderId";
                Param  param  = new Param();
                param.Clear();
                param.Add("@orderId", orderId);
                db.Open();
                ComDataReader dr = db.ExecuteReader(CommandType.Text, strSQL, param);
                if (dr.Read())
                {
                    ttLotteryOrder = ReadData(dr);
                }
                dr.Close();
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                db.Close();
            }
            return(ttLotteryOrder);
        }
Esempio n. 3
0
        /// <summary>
        /// 修改彩票订单
        /// <param name="data">数据库连接</param>
        /// <param name="ttLotteryOrder">彩票订单</param>
        /// </summary>
        public void Edit(DataAccess data, TTLotteryOrder ttLotteryOrder)
        {
            string strSQL = "update TTLotteryOrder set agentId=:agentId,siteId=:siteId,terminalId=:terminalId,clientId=:clientId,clientName=:clientName,cardId=:cardId,gameId=:gameId,lotteryType=:lotteryType,playType=:playType,period=:period,betCodes=:betCodes,multiple=:multiple,betFee=:betFee,betTime=:betTime,isChase=:isChase,chaseOrderId=:chaseOrderId,orderStatus=:orderStatus,orderTime=:orderTime,awardResult=:awardResult,awardMoney=:awardMoney,awardTime=:awardTime,settleStatus=:settleStatus,settleTime=:settleTime,createTime=To_date(:createTime,'yyyy-mm-dd hh24:mi:ss'),batchId=:batchId where orderId=:orderId";
            Param  param  = new Param();

            param.Clear();
            param.Add(":agentId", ttLotteryOrder.agentId);           //代理商编号
            param.Add(":siteId", ttLotteryOrder.siteId);             //门店编号
            param.Add(":terminalId", ttLotteryOrder.terminalId);     //终端编号
            param.Add(":clientId", ttLotteryOrder.clientId);         //客户编号
            param.Add(":clientName", ttLotteryOrder.clientName);     //客户名称
            param.Add(":cardId", ttLotteryOrder.cardId);             //卡号
            param.Add(":gameId", ttLotteryOrder.gameId);             //游戏编号
            param.Add(":lotteryType", ttLotteryOrder.lotteryType);   //彩种
            param.Add(":playType", ttLotteryOrder.playType);         //玩法
            param.Add(":period", ttLotteryOrder.period);             //期次
            param.Add(":betCodes", ttLotteryOrder.betCodes);         //投注串
            param.Add(":multiple", ttLotteryOrder.multiple);         //倍数
            param.Add(":betFee", ttLotteryOrder.betFee);             //投注金额
            param.Add(":betTime", ttLotteryOrder.betTime);           //投注时间
            param.Add(":isChase", ttLotteryOrder.isChase);           //是否追号
            param.Add(":chaseOrderId", ttLotteryOrder.chaseOrderId); //追号订单编号
            param.Add(":orderStatus", ttLotteryOrder.orderStatus);   //订单状态
            param.Add(":orderTime", ttLotteryOrder.orderTime);       //出票/撤销时间
            param.Add(":awardResult", ttLotteryOrder.awardResult);   //中奖状态
            param.Add(":awardMoney", ttLotteryOrder.awardMoney);     //中奖金额
            param.Add(":awardTime", ttLotteryOrder.awardTime);       //返奖时间
            param.Add(":settleStatus", ttLotteryOrder.settleStatus); //结算状态
            param.Add(":settleTime", ttLotteryOrder.settleTime);     //结算时间
            param.Add(":createTime", ttLotteryOrder.createTime);     //创建时间
            param.Add(":batchId", ttLotteryOrder.batchId);           //批处理编号
            param.Add(":orderId", ttLotteryOrder.orderId);           //订单号
            data.ExecuteNonQuery(CommandType.Text, strSQL, param);
        }
Esempio n. 4
0
 /// <summary>
 /// 加载指定彩票订单
 /// <param name="orderId">订单号</param>
 /// </summary>
 public void Load(string orderId)
 {
     try
     {
         TTLotteryOrder ttLotteryOrder = ttLotteryOrderDAO.Get(orderId);
         ttLotteryOrder.isChase = "1".Equals(ttLotteryOrder.isChase) ? "on" : "off";
         WebJson.ToJson(context, ttLotteryOrder);
     }
     catch (Exception e)
     {
         Message.error(context, e.Message);
     }
 }
Esempio n. 5
0
 /// <summary>
 /// 增加彩票订单
 /// </summary>
 /// <param name="ttLotteryOrder">彩票订单</param>
 public virtual void Add(TTLotteryOrder ttLotteryOrder)
 {
     try
     {
         db.Open();
         Add(db, ttLotteryOrder);
     }
     catch (Exception e)
     {
         throw e;
     }
     finally
     {
         db.Close();
     }
 }
Esempio n. 6
0
 /// <summary>
 /// 修改彩票订单
 /// <param name="ttLotteryOrder">彩票订单</param>
 /// </summary>
 public void Edit(TTLotteryOrder ttLotteryOrder)
 {
     try
     {
         db.Open();
         Edit(db, ttLotteryOrder);
     }
     catch (Exception e)
     {
         throw e;
     }
     finally
     {
         db.Close();
     }
 }
Esempio n. 7
0
        /// <summary>
        /// 读取彩票订单信息
        /// <param name="dr">记录指针</param>
        /// </summary>
        /// <returns>彩票订单对象</returns>
        protected override TTLotteryOrder ReadData(ComDataReader dr)
        {
            TTLotteryOrder ttLotteryOrder = new TTLotteryOrder();

            ttLotteryOrder.orderId      = dr["orderId"].ToString();                  //订单号
            ttLotteryOrder.agentId      = dr["agentId"].ToString();                  //代理商编号
            ttLotteryOrder.siteId       = dr["siteId"].ToString();                   //门店编号
            ttLotteryOrder.terminalId   = dr["terminalId"].ToString();               //终端编号
            ttLotteryOrder.clientId     = long.Parse(dr["clientId"].ToString());     //客户编号
            ttLotteryOrder.clientName   = dr["clientName"].ToString();               //客户名称
            ttLotteryOrder.cardId       = dr["cardId"].ToString();                   //卡号
            ttLotteryOrder.gameId       = dr["gameName"].ToString();                 //游戏编号
            ttLotteryOrder.lotteryType  = dr["lotteryType"].ToString();              //彩种
            ttLotteryOrder.period       = dr["period"].ToString();                   //期次
            ttLotteryOrder.multiple     = int.Parse(dr["multiple"].ToString());      //倍数
            ttLotteryOrder.betFee       = double.Parse(dr["betFee"].ToString());     //投注金额
            ttLotteryOrder.betTime      = dr["betTime"].ToString();                  //投注时间
            ttLotteryOrder.isChase      = dr["isChase"].ToString();                  //是否追号
            ttLotteryOrder.chaseOrderId = dr["chaseOrderId"].ToString();             //追号订单编号
            ttLotteryOrder.orderStatus  = dr["orderStatus"].ToString();              //订单状态
            ttLotteryOrder.orderTime    = dr["orderTime"].ToString();                //出票/撤销时间
            ttLotteryOrder.awardResult  = dr["awardResult"].ToString();              //中奖状态
            ttLotteryOrder.awardMoney   = double.Parse(dr["awardMoney"].ToString()); //中奖金额
            ttLotteryOrder.awardTime    = dr["awardTime"].ToString();                //返奖时间
            ttLotteryOrder.settleStatus = dr["settleStatus"].ToString();             //结算状态
            ttLotteryOrder.srcType      = dr["srcType"].ToString();                  //数据来源方式
            ttLotteryOrder.settleTime   = dr["settleTime"].ToString();               //结算时间
            bool isChase = false;

            if (ttLotteryOrder.isChase == "1")
            {
                isChase = true;
            }
            ttLotteryOrder.userBetCodes   = BetCodesContext.GetBetCodes(dr["gameId"].ToString(), dr["userBetCodes"].ToString(), isChase);   //用户投注串
            ttLotteryOrder.centerBetCodes = BetCodesContext.GetBetCodes(dr["gameId"].ToString(), dr["centerBetCodes"].ToString(), isChase); //中心投注串

            if (dr["createTime"] == null)
            {
                ttLotteryOrder.createTime = "";//创建时间
            }
            else
            {
                ttLotteryOrder.createTime = string.Format("{0:yyyy-MM-dd HH:mm:ss}", dr["createTime"]);//创建时间
            }
            return(ttLotteryOrder);
        }
Esempio n. 8
0
        /// <summary>
        /// 获取订单
        /// <param name="orderId">订单号</param>
        /// </summary>
        /// <returns>订单对象</returns>
        public override TTLotteryOrder Get(string orderId)
        {
            TTLotteryOrder ttLotteryOrder = null;

            try
            {
                string strSQL = @"select t.orderid,a.agentname agentid,s.sitename siteid, t.terminalid, t.clientid, t.clientname, t.cardid, g.gamename, g.gameid,
                                   l.lotterytypename lotterytype,t.period, t.userBetCodes,t.centerBetCodes, t.multiple, t.betfee, t.bettime, t.ischase, t.chaseorderid,
                                   case t.orderstatus when '0' then '未出票' when '1' then '已出票' when '2' then '已撤单' else  '出票失败' end orderstatus ,
                                   t.ordertime,
                                   case t.awardresult when '0' then '未开奖' when '1' then '未中奖' when '2' then '小奖' when '3' then '大奖' end awardresult,
                                   t.awardmoney,t.awardtime,
                                   case t.settlestatus when '0' then '未结' when '1' then '已结' end settlestatus,
                                   case t.srcType when '0' then '游戏终端' when '1' then '手机APP' end srcType,
                                   t.settletime, t.createtime
                                   from TTLotteryOrder t,TBGame g,TBLottery l,TBAgent a,TBSite s
                                   where t.gameid=g.gameid
                                   and t.lotterytype=l.lotterytype
                                   and t.agentid=a.agentid
                                   and t.siteid=s.siteid and t.orderId=@orderId";
                Param  param  = new Param();
                param.Clear();
                param.Add("@orderId", orderId);
                db.Open();
                ComDataReader dr = db.ExecuteReader(CommandType.Text, strSQL, param);
                if (dr.Read())
                {
                    ttLotteryOrder = ReadData(dr);
                }
                dr.Close();
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                db.Close();
            }
            return(ttLotteryOrder);
        }
Esempio n. 9
0
        /// <summary>
        /// 读取彩票订单信息
        /// <param name="dr">记录指针</param>
        /// </summary>
        /// <returns>彩票订单对象</returns>
        private TTLotteryOrder ReadData(ComDataReader dr)
        {
            TTLotteryOrder ttLotteryOrder = new TTLotteryOrder();

            ttLotteryOrder.orderId      = dr["orderId"].ToString();                  //订单号
            ttLotteryOrder.agentId      = dr["agentId"].ToString();                  //代理商编号
            ttLotteryOrder.siteId       = dr["siteId"].ToString();                   //门店编号
            ttLotteryOrder.terminalId   = dr["terminalId"].ToString();               //终端编号
            ttLotteryOrder.clientId     = long.Parse(dr["clientId"].ToString());     //客户编号
            ttLotteryOrder.clientName   = dr["clientName"].ToString();               //客户名称
            ttLotteryOrder.cardId       = dr["cardId"].ToString();                   //卡号
            ttLotteryOrder.gameId       = dr["gameId"].ToString();                   //游戏编号
            ttLotteryOrder.lotteryType  = dr["lotteryType"].ToString();              //彩种
            ttLotteryOrder.playType     = dr["playType"].ToString();                 //玩法
            ttLotteryOrder.period       = dr["period"].ToString();                   //期次
            ttLotteryOrder.betCodes     = dr["betCodes"].ToString();                 //投注串
            ttLotteryOrder.multiple     = int.Parse(dr["multiple"].ToString());      //倍数
            ttLotteryOrder.betFee       = double.Parse(dr["betFee"].ToString());     //投注金额
            ttLotteryOrder.betTime      = dr["betTime"].ToString();                  //投注时间
            ttLotteryOrder.isChase      = dr["isChase"].ToString();                  //是否追号
            ttLotteryOrder.chaseOrderId = dr["chaseOrderId"].ToString();             //追号订单编号
            ttLotteryOrder.orderStatus  = dr["orderStatus"].ToString();              //订单状态
            ttLotteryOrder.orderTime    = dr["orderTime"].ToString();                //出票/撤销时间
            ttLotteryOrder.awardResult  = dr["awardResult"].ToString();              //中奖状态
            ttLotteryOrder.awardMoney   = double.Parse(dr["awardMoney"].ToString()); //中奖金额
            ttLotteryOrder.awardTime    = dr["awardTime"].ToString();                //返奖时间
            ttLotteryOrder.settleStatus = dr["settleStatus"].ToString();             //结算状态
            ttLotteryOrder.settleTime   = dr["settleTime"].ToString();               //结算时间
            if (dr["createTime"] == null)
            {
                ttLotteryOrder.createTime = "";//创建时间
            }
            else
            {
                ttLotteryOrder.createTime = string.Format("{0:yyyy-MM-dd HH:mm:ss}", dr["createTime"]); //创建时间
            }
            ttLotteryOrder.batchId = dr["batchId"].ToString();                                          //批处理编号
            return(ttLotteryOrder);
        }