Exemple #1
0
        /// <summary>
        /// 获取代理商充值预审
        /// </summary>
        /// <param name="flowId">流水号</param>
        /// <returns>代理商充值预审对象</returns>
        public virtual TTAgentPreRechg Get(long flowId)
        {
            TTAgentPreRechg ttAgentPreRechg = null;

            try
            {
                string strSQL = "select * from TTAgentPreRechg 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())
                {
                    ttAgentPreRechg = ReadData(dr);
                }
                dr.Close();
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                db.Close();
            }
            return(ttAgentPreRechg);
        }
Exemple #2
0
        /// <summary>
        /// 读取代理商充值预审信息
        /// </summary>
        /// <param name="dr">记录指针</param>
        /// <returns>代理商充值预审对象</returns>
        protected virtual TTAgentPreRechg ReadData(ComDataReader dr)
        {
            TTAgentPreRechg ttAgentPreRechg = new TTAgentPreRechg();

            ttAgentPreRechg.flowId       = long.Parse(dr["flowId"].ToString()); //流水号
            ttAgentPreRechg.agentId      = dr["agentId"].ToString();            //代理商编号
            ttAgentPreRechg.agentName    = dr["agentName"].ToString();          //代理商名称
            ttAgentPreRechg.fee          = double.Parse(dr["fee"].ToString());  //发生金额
            ttAgentPreRechg.operatorId   = dr["operatorId"].ToString();         //操作人编号
            ttAgentPreRechg.operatorName = dr["operatorName"].ToString();       //操作人名称
            if (dr["createTime"] == null)
            {
                ttAgentPreRechg.createTime = "";//创建时间
            }
            else
            {
                ttAgentPreRechg.createTime = string.Format("{0:yyyy-MM-dd HH:mm:ss}", dr["createTime"]); //创建时间
            }
            ttAgentPreRechg.handleMode    = dr["handleMode"].ToString();                                 //充值方式
            ttAgentPreRechg.bankAccountId = dr["bankAccountId"].ToString();                              //银行账号
            ttAgentPreRechg.bankFlowId    = dr["bankFlowId"].ToString();                                 //银行流水号
            ttAgentPreRechg.description   = dr["description"].ToString();                                //说明
            ttAgentPreRechg.auditStatus   = dr["auditStatus"].ToString();                                //审核状态
            return(ttAgentPreRechg);
        }
Exemple #3
0
        /// <summary>
        /// 修改代理商充值预审
        /// </summary>
        /// <param name="data">数据库连接</param>
        /// <param name="ttAgentPreRechg">代理商充值预审</param>
        public override void Edit(DataAccess data, TTAgentPreRechg ttAgentPreRechg)
        {
            string strSQL = "update TTAgentPreRechg set auditStatus=@auditStatus where flowId=@flowId";
            Param  param  = new Param();

            param.Clear();
            param.Add("@auditStatus", ttAgentPreRechg.auditStatus); //审核状态
            param.Add("@flowId", ttAgentPreRechg.flowId);           //流水号
            data.ExecuteNonQuery(CommandType.Text, strSQL, param);
        }
Exemple #4
0
 /// <summary>
 /// 加载指定代理商充值预审
 /// </summary>
 /// <param name="flowId">流水号</param>
 public void Load(long flowId)
 {
     try
     {
         TTAgentPreRechg ttAgentPreRechg = ttAgentPreRechgDAO.Get(flowId);
         WebJson.ToJson(context, ttAgentPreRechg);
     }
     catch (Exception e)
     {
         Message.error(context, e.Message);
     }
 }
Exemple #5
0
        /// <summary>
        /// 获取指定代理商充值预审信息
        /// <param name="flowId">流水号</param>
        /// </summary>
        public TTAgentPreRechg Get(long flowId)
        {
            TTAgentPreRechg tbAgentPreRechg = new TTAgentPreRechg();

            try
            {
                tbAgentPreRechg = ttAgentPreRechgDAO.Get(flowId);
            }
            catch (Exception e)
            {
                Message.error(context, e.Message);
            }
            return(tbAgentPreRechg);
        }
Exemple #6
0
 /// <summary>
 /// 修改代理商充值预审
 /// </summary>
 /// <param name="ttAgentPreRechg">代理商充值预审</param>
 public void Edit(TTAgentPreRechg ttAgentPreRechg)
 {
     try
     {
         ttAgentPreRechgDAO.Edit(ttAgentPreRechg);
         Message.success(context, "审批成功");
         loginUser.Log(ttAgentPreRechg.agentName + "代理商充值预审成功");
     }
     catch (Exception e)
     {
         Message.error(context, "代理商充值预审修改失败");
         loginUser.Log(e.Message);
     }
 }
Exemple #7
0
        /// <summary>
        /// 增加代理商充值
        /// <param name="ttAgentRecharge">代理商充值</param>
        /// </summary>
        public void Add(TTAgentRecharge ttAgentRecharge, TTAgentPreRechg ttAgentPreRechg)
        {
            ComTransaction trans = null;

            try
            {
                db.Open();
                trans = db.BeginTransaction();

                TBAgentDAO tbAgentDAO = new TBAgentDAO();


                TBAgent tbAgent = new TBAgent();
                tbAgent = tbAgentDAO.Get(db, ttAgentRecharge.agentId);//获取代理商信息
                //修改代理商信息表的当前余额
                tbAgent.sumRecharge  = tbAgent.sumRecharge + ttAgentRecharge.fee;
                tbAgent.balanceValue = tbAgent.balanceValue + ttAgentRecharge.fee;
                new TBAgentDAO().EditBalance(db, tbAgent);


                ttAgentRecharge.agentName   = tbAgent.agentName;                          //代理商名称
                ttAgentRecharge.lastBalance = tbAgent.balanceValue - ttAgentRecharge.fee; //代理商上次余额
                ttAgentRecharge.balance     = tbAgent.balanceValue;                       //代理商当前余额
                Add(db, ttAgentRecharge);

                //添加代理商充值账户明细
                TTAgentAccDetail ttAgentAccDetail = new TTAgentAccDetail();
                ttAgentAccDetail.agentId     = ttAgentRecharge.agentId;
                ttAgentAccDetail.agentName   = ttAgentRecharge.agentName;
                ttAgentAccDetail.lastBalance = ttAgentRecharge.lastBalance;
                ttAgentAccDetail.fee         = ttAgentRecharge.fee;
                ttAgentAccDetail.balance     = ttAgentRecharge.balance;
                ttAgentAccDetail.createTime  = ttAgentRecharge.createTime;
                ttAgentAccDetail.remark      = ttAgentRecharge.description;
                new TTAgentAccDetailDAO().Add(db, ttAgentAccDetail);

                new TTAgentPreRechgDAO().Edit(db, ttAgentPreRechg);//修改状态
                trans.Commit();
            }
            catch (Exception e)
            {
                trans.Rollback();
                throw e;
            }
            finally
            {
                db.Close();
            }
        }
Exemple #8
0
 /// <summary>
 /// 修改代理商充值预审
 /// </summary>
 /// <param name="ttAgentPreRechg">代理商充值预审</param>
 public virtual void Edit(TTAgentPreRechg ttAgentPreRechg)
 {
     try
     {
         db.Open();
         Edit(db, ttAgentPreRechg);
     }
     catch (Exception e)
     {
         throw e;
     }
     finally
     {
         db.Close();
     }
 }
Exemple #9
0
        /// <summary>
        /// 增加代理商充值预审
        /// </summary>
        /// <param name="data">数据库连接</param>
        /// <param name="ttAgentPreRechg">代理商充值预审</param>
        public override void Add(DataAccess data, TTAgentPreRechg ttAgentPreRechg)
        {
            string strSQL = "insert into TTAgentPreRechg (flowId,agentId,agentName,fee,operatorId,operatorName,handleMode,bankAccountId,bankFlowId,description) values (SAgentRecharge_flowId.Nextval,@agentId,@agentName,@fee,@operatorId,@operatorName,@handleMode,@bankAccountId,@bankFlowId,@description)";
            Param  param  = new Param();

            param.Clear();
            //param.Add("@flowId", ttAgentPreRechg.flowId);//流水号
            param.Add("@agentId", ttAgentPreRechg.agentId);             //代理商编号
            param.Add("@agentName", ttAgentPreRechg.agentName);         //代理商名称
            param.Add("@fee", ttAgentPreRechg.fee);                     //发生金额
            param.Add("@operatorId", ttAgentPreRechg.operatorId);       //操作人编号
            param.Add("@operatorName", ttAgentPreRechg.operatorName);   //操作人名称
            param.Add("@handleMode", ttAgentPreRechg.handleMode);       //充值方式
            param.Add("@bankAccountId", ttAgentPreRechg.bankAccountId); //银行账号
            param.Add("@bankFlowId", ttAgentPreRechg.bankFlowId);       //银行流水号
            param.Add("@description", ttAgentPreRechg.description);     //说明
            data.ExecuteNonQuery(CommandType.Text, strSQL, param);
        }
Exemple #10
0
 /// <summary>
 /// 增加代理商充值
 /// <param name="ttAgentRecharge">代理商充值</param>
 /// </summary>
 public void Add(TTAgentRecharge ttAgentRecharge, TTAgentPreRechg ttAgentPreRechg, double balanceValue)
 {
     try
     {
         if (ttAgentRecharge.fee < 0 && Math.Abs(ttAgentRecharge.fee) > balanceValue)
         {
             Message.success(context, "代理商账户余额不足");
             return;
         }
         ttAgentRechargeDAO.Add(ttAgentRecharge, ttAgentPreRechg);
         Message.success(context, "代理商充值审批成功");
         loginSession.Log(ttAgentRecharge.agentName + "代理商充值审批成功");
     }
     catch (Exception e)
     {
         Message.error(context, "代理商充值审批失败");
         loginSession.Log(e.Message);
     }
 }
Exemple #11
0
        /// <summary>
        /// 修改代理商充值预审
        /// </summary>
        /// <param name="data">数据库连接</param>
        /// <param name="ttAgentPreRechg">代理商充值预审</param>
        public virtual void Edit(DataAccess data, TTAgentPreRechg ttAgentPreRechg)
        {
            string strSQL = "update TTAgentPreRechg set agentId=@agentId,agentName=@agentName,fee=@fee,operatorId=@operatorId,operatorName=@operatorName,createTime=To_date(@createTime,'yyyy-mm-dd hh24:mi:ss'),handleMode=@handleMode,bankAccountId=@bankAccountId,bankFlowId=@bankFlowId,description=@description,auditStatus=@auditStatus where flowId=@flowId";
            Param  param  = new Param();

            param.Clear();
            param.Add("@agentId", ttAgentPreRechg.agentId);             //代理商编号
            param.Add("@agentName", ttAgentPreRechg.agentName);         //代理商名称
            param.Add("@fee", ttAgentPreRechg.fee);                     //发生金额
            param.Add("@operatorId", ttAgentPreRechg.operatorId);       //操作人编号
            param.Add("@operatorName", ttAgentPreRechg.operatorName);   //操作人名称
            param.Add("@createTime", ttAgentPreRechg.createTime);       //创建时间
            param.Add("@handleMode", ttAgentPreRechg.handleMode);       //充值方式
            param.Add("@bankAccountId", ttAgentPreRechg.bankAccountId); //银行账号
            param.Add("@bankFlowId", ttAgentPreRechg.bankFlowId);       //银行流水号
            param.Add("@description", ttAgentPreRechg.description);     //说明
            param.Add("@auditStatus", ttAgentPreRechg.auditStatus);     //审核状态
            param.Add("@flowId", ttAgentPreRechg.flowId);               //流水号
            data.ExecuteNonQuery(CommandType.Text, strSQL, param);
        }
Exemple #12
0
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                LoginUser loginUser = new LoginUser(context, "AgentPreRechg");
                if (!loginUser.Pass)//权限验证
                {
                    return;
                }

                //加载DataGrid
                if (context.Request["action"] == "gridLoad")
                {
                    AgentBLL bll = new AgentBLL(context, loginUser);
                    //加载DataGrid
                    int    page       = int.Parse(context.Request["page"]);
                    int    rows       = int.Parse(context.Request["rows"]);
                    string agentId    = context.Request["agentId"];
                    string agentName  = context.Request["agentName"];
                    string bankCardId = context.Request["bankCardId"];
                    bll.LoadGrid(page, rows, agentName, agentId, bankCardId, ((int)AuditStauts.AuditSucces).ToString());
                    return;
                }
                if (context.Request["action"] == "handleModeListLoad")
                {
                    Combobox com = new Combobox(context, loginUser);
                    com.HandleModeCombobox();
                }
                //加载信息
                if (context.Request["action"] == "load")
                {
                    AgentBLL bll = new AgentBLL(context, loginUser);
                    //加载信息
                    bll.Load(context.Request["agentId"]);
                }

                //增加
                if (context.Request["action"] == "add")
                {
                    AgentPreRechgBLL bll             = new AgentPreRechgBLL(context, loginUser);
                    TTAgentPreRechg  ttAgentPreRechg = new TTAgentPreRechg();
                    ttAgentPreRechg.agentId       = context.Request["agentId"];           //代理商编号
                    ttAgentPreRechg.agentName     = context.Request["agentName"];         //代理商名称
                    ttAgentPreRechg.fee           = double.Parse(context.Request["fee"]); //发生金额
                    ttAgentPreRechg.handleMode    = context.Request["handleMode"];        //充值方式
                    ttAgentPreRechg.operatorId    = loginUser.UserId;;                    //操作人编号
                    ttAgentPreRechg.operatorName  = loginUser.UserName;                   //操作人名称
                    ttAgentPreRechg.bankAccountId = context.Request["bankCardId"];        //银行账号
                    ttAgentPreRechg.bankFlowId    = context.Request["bankFlowId"];        //银行流水号
                    ttAgentPreRechg.description   = context.Request["description"];       //说明
                    bll.Add(ttAgentPreRechg);
                    return;
                }

                //修改
                if (context.Request["action"] == "edit")
                {
                    AgentPreRechgBLL bll             = new AgentPreRechgBLL(context, loginUser);
                    TTAgentPreRechg  ttAgentPreRechg = new TTAgentPreRechg();
                    ttAgentPreRechg.flowId        = long.Parse(context.Request["flowId"]); //流水号
                    ttAgentPreRechg.agentId       = context.Request["agentId"];            //代理商编号
                    ttAgentPreRechg.agentName     = context.Request["agentName"];          //代理商名称
                    ttAgentPreRechg.fee           = double.Parse(context.Request["fee"]);  //发生金额
                    ttAgentPreRechg.operatorId    = context.Request["operatorId"];         //操作人编号
                    ttAgentPreRechg.operatorName  = context.Request["operatorName"];       //操作人名称
                    ttAgentPreRechg.createTime    = context.Request["createTime"];         //创建时间
                    ttAgentPreRechg.handleMode    = context.Request["handleMode"];         //充值方式
                    ttAgentPreRechg.bankAccountId = context.Request["bankAccountId"];      //银行账号
                    ttAgentPreRechg.bankFlowId    = context.Request["bankFlowId"];         //银行流水号
                    ttAgentPreRechg.description   = context.Request["description"];        //说明
                    ttAgentPreRechg.auditStatus   = context.Request["auditStatus"];        //审核状态
                    bll.Edit(ttAgentPreRechg);
                    return;
                }

                //删除
                if (context.Request["action"] == "delete")
                {
                    AgentPreRechgBLL bll    = new AgentPreRechgBLL(context, loginUser);
                    long             flowId = long.Parse(context.Request["flowId"]);//流水号
                    bll.Delete(flowId);
                    return;
                }
            }
            catch (Exception e)
            {
                Message.error(context, e.Message);
            }
        }
Exemple #13
0
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                LoginUser        loginUser = new LoginUser(context, "AgentRecharge");
                AgentPreRechgBLL bll       = new AgentPreRechgBLL(context, loginUser);
                if (!loginUser.Pass)//权限验证
                {
                    return;
                }

                //加载DataGrid
                if (context.Request["action"] == "gridLoad")
                {
                    int    page        = int.Parse(context.Request["page"]);
                    int    rows        = int.Parse(context.Request["rows"]);
                    string agentId     = context.Request["agentId"];
                    string auditStatus = context.Request["auditStatus"];
                    string startDate   = context.Request["startDate"];
                    string endDate     = context.Request["endDate"];
                    bll.LoadGrid(page, rows, agentId, auditStatus, startDate, endDate);
                    return;
                }
                if (context.Request["action"] == "load")
                {
                    //加载信息
                    bll.Load(long.Parse(context.Request["flowId"]));
                }
                if (context.Request["action"] == "handleModeListLoad")
                {
                    Combobox com = new Combobox(context, loginUser);
                    com.HandleModeCombobox();
                }

                //审核
                if (context.Request["action"] == "audit")
                {
                    AgentRechargeBLL agentRechargeBLL = new AgentRechargeBLL(context, loginUser);
                    long             flowId           = long.Parse(context.Request["flowId"]);
                    string           remark           = context.Request["remark"];
                    TTAgentPreRechg  ttAgentPreRechg  = bll.Get(flowId);//预审
                    ttAgentPreRechg.auditStatus = context.Request["auditStatus"];
                    if (ttAgentPreRechg.auditStatus == "1")
                    {
                        TTAgentRecharge ttAgentRecharge = new TTAgentRecharge();       //充值明细
                        ttAgentRecharge.agentId       = ttAgentPreRechg.agentId;       //代理商编号
                        ttAgentRecharge.fee           = ttAgentPreRechg.fee;           //发生金额
                        ttAgentRecharge.operatorId    = loginUser.UserId;              //操作人编号
                        ttAgentRecharge.operatorName  = loginUser.UserName;            //操作人名称
                        ttAgentRecharge.handleMode    = ttAgentPreRechg.handleMode;    //充值方式
                        ttAgentRecharge.bankAccountId = ttAgentPreRechg.bankAccountId; //银行账号
                        ttAgentRecharge.bankFlowId    = ttAgentPreRechg.bankFlowId;    //银行流水号
                        if (remark.Trim() == "")
                        {
                            ttAgentRecharge.description = ttAgentPreRechg.description;//说明
                        }
                        else
                        {
                            ttAgentRecharge.description = remark;
                        }
                        agentRechargeBLL.Add(ttAgentRecharge, ttAgentPreRechg, ttAgentPreRechg.fee);
                    }
                    else
                    {
                        bll.Edit(ttAgentPreRechg);
                    }
                    return;
                }
            }
            catch (Exception e)
            {
                Message.error(context, e.Message);
            }
        }