示例#1
0
        /// <summary>
        /// 读取客户充值信息
        /// </summary>
        /// <param name="dr">记录指针</param>
        /// <returns>客户充值对象</returns>
        protected virtual TTClientRecharge ReadData(ComDataReader dr)
        {
            TTClientRecharge ttClientRecharge = new TTClientRecharge();

            ttClientRecharge.flowId       = long.Parse(dr["flowId"].ToString());        //流水号
            ttClientRecharge.clientId     = long.Parse(dr["clientId"].ToString());      //客户编号
            ttClientRecharge.clientName   = dr["clientName"].ToString();                //客户名称
            ttClientRecharge.agentId      = dr["agentId"].ToString();                   //代理商编号
            ttClientRecharge.siteId       = dr["siteId"].ToString();                    //门店编号
            ttClientRecharge.lastBalance  = double.Parse(dr["lastBalance"].ToString()); //上次余额
            ttClientRecharge.fee          = double.Parse(dr["fee"].ToString());         //发生金额
            ttClientRecharge.balance      = double.Parse(dr["balance"].ToString());     //当前余额
            ttClientRecharge.handleMode   = dr["handleMode"].ToString();                //充值方式
            ttClientRecharge.operatorId   = dr["operatorId"].ToString();                //操作人编号
            ttClientRecharge.operatorName = dr["operatorName"].ToString();              //操作人名称
            if (dr["createTime"] == null)
            {
                ttClientRecharge.createTime = "";//创建时间
            }
            else
            {
                ttClientRecharge.createTime = string.Format("{0:yyyy-MM-dd HH:mm:ss}", dr["createTime"]); //创建时间
            }
            ttClientRecharge.cardId      = dr["cardId"].ToString();                                       //卡号
            ttClientRecharge.sourceType  = dr["sourceType"].ToString();                                   //充值来源
            ttClientRecharge.timeStamp   = dr["timeStamp"].ToString();                                    //时间戳
            ttClientRecharge.description = dr["description"].ToString();                                  //说明
            return(ttClientRecharge);
        }
示例#2
0
        /// <summary>
        /// 获取客户充值
        /// </summary>
        /// <param name="flowId">流水号</param>
        /// <returns>客户充值对象</returns>
        public virtual TTClientRecharge Get(long flowId)
        {
            TTClientRecharge ttClientRecharge = null;

            try
            {
                string strSQL = "select * from TTClientRecharge 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())
                {
                    ttClientRecharge = ReadData(dr);
                }
                dr.Close();
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                db.Close();
            }
            return(ttClientRecharge);
        }
示例#3
0
        /// <summary>
        /// 获取客户充值
        /// <param name="flowId">流水号</param>
        /// </summary>
        /// <returns>客户充值对象</returns>
        public override TTClientRecharge Get(long flowId)
        {
            TTClientRecharge ttClientRecharge = null;

            try
            {
                string strSQL = @"select flowid, clientid,  clientname,  a.agentname agentid,  s.sitename siteid, lastbalance, fee, 
                                   balance,  operatorid, operatorname, createtime, cardid, sourcetype,timeStamp, description,  p.modename handlemode 
                                   from TTClientRecharge c,TBAgent a,TBSite s,TBPaymode p
                                   where c.agentid=a.agentid and c.siteid=s.siteid 
                                   and c.handlemode=p.modeid and 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())
                {
                    ttClientRecharge = ReadData(dr);
                }
                dr.Close();
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                db.Close();
            }
            return(ttClientRecharge);
        }
示例#4
0
 /// <summary>
 /// 加载指定客户充值
 /// <param name="flowId">编号</param>
 /// </summary>
 public void Load(long flowId)
 {
     try
     {
         TTClientRecharge ttClientRecharge = ttClientRechargeDAO.Get(flowId);
         WebJson.ToJson(context, ttClientRecharge);
     }
     catch (Exception e)
     {
         Message.error(context, e.Message);
     }
 }
示例#5
0
 /// <summary>
 /// 增加客户充值
 /// </summary>
 /// <param name="ttClientRecharge">客户充值</param>
 public virtual void Add(TTClientRecharge ttClientRecharge)
 {
     try
     {
         db.Open();
         Add(db, ttClientRecharge);
     }
     catch (Exception e)
     {
         throw e;
     }
     finally
     {
         db.Close();
     }
 }
示例#6
0
 /// <summary>
 /// 修改客户充值
 /// <param name="ttClientRecharge">客户充值</param>
 /// </summary>
 public void Edit(TTClientRecharge ttClientRecharge)
 {
     try
     {
         db.Open();
         Edit(db, ttClientRecharge);
     }
     catch (Exception e)
     {
         throw e;
     }
     finally
     {
         db.Close();
     }
 }
示例#7
0
        /// <summary>
        /// 修改客户充值
        /// </summary>
        /// <param name="data">数据库连接</param>
        /// <param name="ttClientRecharge">客户充值</param>
        public virtual void Edit(DataAccess data, TTClientRecharge ttClientRecharge)
        {
            string strSQL = "update TTClientRecharge set clientId=@clientId,clientName=@clientName,agentId=@agentId,siteId=@siteId,lastBalance=@lastBalance,fee=@fee,balance=@balance,handleMode=@handleMode,operatorId=@operatorId,operatorName=@operatorName,createTime=To_date(@createTime,'yyyy-mm-dd hh24:mi:ss'),cardId=@cardId,sourceType=@sourceType,timeStamp=@timeStamp,description=@description where flowId=@flowId";
            Param  param  = new Param();

            param.Clear();
            param.Add("@clientId", ttClientRecharge.clientId);         //客户编号
            param.Add("@clientName", ttClientRecharge.clientName);     //客户名称
            param.Add("@agentId", ttClientRecharge.agentId);           //代理商编号
            param.Add("@siteId", ttClientRecharge.siteId);             //门店编号
            param.Add("@lastBalance", ttClientRecharge.lastBalance);   //上次余额
            param.Add("@fee", ttClientRecharge.fee);                   //发生金额
            param.Add("@balance", ttClientRecharge.balance);           //当前余额
            param.Add("@handleMode", ttClientRecharge.handleMode);     //充值方式
            param.Add("@operatorId", ttClientRecharge.operatorId);     //操作人编号
            param.Add("@operatorName", ttClientRecharge.operatorName); //操作人名称
            param.Add("@createTime", ttClientRecharge.createTime);     //创建时间
            param.Add("@cardId", ttClientRecharge.cardId);             //卡号
            param.Add("@sourceType", ttClientRecharge.sourceType);     //充值来源
            param.Add("@timeStamp", ttClientRecharge.timeStamp);       //时间戳
            param.Add("@description", ttClientRecharge.description);   //说明
            param.Add("@flowId", ttClientRecharge.flowId);             //流水号
            data.ExecuteNonQuery(CommandType.Text, strSQL, param);
        }
示例#8
0
        /// <summary>
        /// 增加客户充值
        /// <param name="data">数据库连接</param>
        /// <param name="ttClientRecharge">客户充值</param>
        /// </summary>
        public void Add(DataAccess data, TTClientRecharge ttClientRecharge)
        {
            string strSQL = "insert into TTClientRecharge (flowId,clientId,clientName,agentId,siteId,lastBalance,fee,balance,handleMode,operatorId,operatorName,createTime,cardId,sourceType,timeStamp,description) values (:flowId,:clientId,:clientName,:agentId,:siteId,:lastBalance,:fee,:balance,:handleMode,:operatorId,:operatorName,To_date(:createTime,'yyyy-mm-dd hh24:mi:ss'),:cardId,:sourceType,:timeStamp,:description)";
            Param  param  = new Param();

            param.Clear();
            param.Add(":flowId", ttClientRecharge.flowId);             //流水号
            param.Add(":clientId", ttClientRecharge.clientId);         //客户编号
            param.Add(":clientName", ttClientRecharge.clientName);     //客户名称
            param.Add(":agentId", ttClientRecharge.agentId);           //代理商编号
            param.Add(":siteId", ttClientRecharge.siteId);             //门店编号
            param.Add(":lastBalance", ttClientRecharge.lastBalance);   //上次余额
            param.Add(":fee", ttClientRecharge.fee);                   //发生金额
            param.Add(":balance", ttClientRecharge.balance);           //当前余额
            param.Add(":handleMode", ttClientRecharge.handleMode);     //充值方式
            param.Add(":operatorId", ttClientRecharge.operatorId);     //操作人编号
            param.Add(":operatorName", ttClientRecharge.operatorName); //操作人名称
            param.Add(":createTime", ttClientRecharge.createTime);     //创建时间
            param.Add(":cardId", ttClientRecharge.cardId);             //卡号
            param.Add(":sourceType", ttClientRecharge.sourceType);     //充值来源
            param.Add(":timeStamp", ttClientRecharge.timeStamp);       //时间戳
            param.Add(":description", ttClientRecharge.description);   //说明
            data.ExecuteNonQuery(CommandType.Text, strSQL, param);
        }