コード例 #1
0
        /// <summary>
        /// 获取代理商提现申请
        /// </summary>
        /// <param name="flowId">流水号</param>
        /// <returns>代理商提现申请对象</returns>
        public virtual TTAgentTakeCashApply Get(long flowId)
        {
            TTAgentTakeCashApply ttAgentTakeCashApply = null;

            try
            {
                string strSQL = "select * from TTAgentTakeCashApply 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())
                {
                    ttAgentTakeCashApply = ReadData(dr);
                }
                dr.Close();
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                db.Close();
            }
            return(ttAgentTakeCashApply);
        }
コード例 #2
0
        /// <summary>
        /// 修改代理商提现申请
        /// <param name="ttAgentTakeCashApply">代理商提现申请</param>
        /// </summary>
        public void Edit(TTAgentTakeCashApply ttAgentTakeCashApply, TTAgentTakeCash ttAgentTakeCash, TBAgent tbAgent)
        {
            ComTransaction trans = null;

            try
            {
                db.Open();
                trans = db.BeginTransaction();
                //当只有申请通过才进行增加提现明细以及账户明细信息
                if (ttAgentTakeCashApply.dealWithStatus == ((int)DealWithStatus.HaveToDo).ToString())
                {
                    //增加到提现申请明细以及账户明细并修改代理商的余额信息
                    new TTAgentTakeCashDAO().Add(db, ttAgentTakeCash, tbAgent);
                }
                Edit(db, ttAgentTakeCashApply);//修改提现申请状态已经信息

                trans.Commit();
            }
            catch (Exception e)
            {
                trans.Rollback();
                throw e;
            }
            finally
            {
                db.Close();
            }
        }
コード例 #3
0
 /// <summary>
 /// 加载指定代理商提现申请
 /// <param name="flowId">编号</param>
 /// </summary>
 public void Load(long flowId)
 {
     try
     {
         TTAgentTakeCashApply ttAgentTakeCashApply = ttAgentTakeCashApplyDAO.Get(flowId);
         WebJson.ToJson(context, ttAgentTakeCashApply);
     }
     catch (Exception e)
     {
         Message.error(context, e.Message);
     }
 }
コード例 #4
0
        /// <summary>
        /// 增加代理商提现申请
        /// <param name="data">数据库连接</param>
        /// <param name="ttAgentTakeCashApply">代理商提现申请</param>
        /// </summary>
        public override void Add(DataAccess data, TTAgentTakeCashApply ttAgentTakeCashApply)
        {
            string strSQL = "insert into TTAgentTakeCashApply (flowId,agentId,agentName,fee,bankAccountId,dealWithStatus,remark) values (SAgentTakeCashApply_flowId.Nextval,@agentId,@agentName,@fee,@bankAccountId,@dealWithStatus,@remark)";
            Param  param  = new Param();

            param.Clear();
            param.Add("@agentId", ttAgentTakeCashApply.agentId);               //代理商编号
            param.Add("@agentName", ttAgentTakeCashApply.agentName);           //代理商名称
            param.Add("@fee", ttAgentTakeCashApply.fee);                       //提现金额
            param.Add("@bankAccountId", ttAgentTakeCashApply.bankAccountId);   //银行账号
            param.Add("@dealWithStatus", ttAgentTakeCashApply.dealWithStatus); //办理状态
            param.Add("@remark", ttAgentTakeCashApply.remark);                 //提现说明
            data.ExecuteNonQuery(CommandType.Text, strSQL, param);
        }
コード例 #5
0
        /// <summary>
        /// 修改代理商提现申请
        /// <param name="data">数据库连接</param>
        /// <param name="ttAgentTakeCashApply">代理商提现申请</param>
        /// </summary>
        public override void Edit(DataAccess data, TTAgentTakeCashApply ttAgentTakeCashApply)
        {
            string strSQL = "update TTAgentTakeCashApply set dealWithStatus=@dealWithStatus,transferAccDate=To_date(@transferAccDate,'yyyy-mm-dd hh24:mi:ss'),operatorId=@operatorId,operatorName=@operatorName,dealWithTime=To_date(@dealWithTime,'yyyy-mm-dd hh24:mi:ss'),opinion=@opinion where flowId=@flowId";
            Param  param  = new Param();

            param.Clear();
            param.Add("@dealWithStatus", ttAgentTakeCashApply.dealWithStatus);   //办理状态
            param.Add("@transferAccDate", ttAgentTakeCashApply.transferAccDate); //转账日期
            param.Add("@operatorId", ttAgentTakeCashApply.operatorId);           //办理人编号
            param.Add("@operatorName", ttAgentTakeCashApply.operatorName);       //办理人名称
            param.Add("@dealWithTime", ttAgentTakeCashApply.dealWithTime);       //办理时间
            param.Add("@opinion", ttAgentTakeCashApply.opinion);                 //办理意见
            param.Add("@flowId", ttAgentTakeCashApply.flowId);                   //流水号
            data.ExecuteNonQuery(CommandType.Text, strSQL, param);
        }
コード例 #6
0
        private DataAccess db = new DataAccess(DataAccess.DBConn);//数据库连接

        /// <summary>
        /// 增加代理商提现申请
        /// <param name="data">数据库连接</param>
        /// <param name="ttAgentTakeCashApply">代理商提现申请</param>
        /// </summary>
        public void Add(DataAccess data, TTAgentTakeCashApply ttAgentTakeCashApply)
        {
            string strSQL = "insert into TTAgentTakeCashApply (flowId,agentId,agentName,fee,bankAccountId,createTime,dealWithStatus,remark) values (SAgentTakeCashApply_flowId.Nextval,:agentId,:agentName,:fee,:bankAccountId,To_date(:createTime,'yyyy-mm-dd hh24:mi:ss'),:dealWithStatus,:remark)";
            Param  param  = new Param();

            param.Clear();
            param.Add(":agentId", ttAgentTakeCashApply.agentId);               //代理商编号
            param.Add(":agentName", ttAgentTakeCashApply.agentName);           //代理商名称
            param.Add(":fee", ttAgentTakeCashApply.fee);                       //提现金额
            param.Add(":bankAccountId", ttAgentTakeCashApply.bankAccountId);   //银行账号
            param.Add(":createTime", ttAgentTakeCashApply.createTime);         //创建时间
            param.Add(":dealWithStatus", ttAgentTakeCashApply.dealWithStatus); //办理状态
            param.Add(":remark", ttAgentTakeCashApply.remark);                 //提现说明
            data.ExecuteNonQuery(CommandType.Text, strSQL, param);
        }
コード例 #7
0
 /// <summary>
 /// 修改代理商提现申请
 /// </summary>
 /// <param name="ttAgentTakeCashApply">代理商提现申请</param>
 public virtual void Edit(TTAgentTakeCashApply ttAgentTakeCashApply)
 {
     try
     {
         db.Open();
         Edit(db, ttAgentTakeCashApply);
     }
     catch (Exception e)
     {
         throw e;
     }
     finally
     {
         db.Close();
     }
 }
コード例 #8
0
 /// <summary>
 /// 增加代理商提现申请
 /// <param name="ttAgentTakeCashApply">代理商提现申请</param>
 /// </summary>
 public void Add(TTAgentTakeCashApply ttAgentTakeCashApply)
 {
     try
     {
         db.Open();
         Add(db, ttAgentTakeCashApply);
     }
     catch (Exception e)
     {
         throw e;
     }
     finally
     {
         db.Close();
     }
 }
コード例 #9
0
 /// <summary>
 /// 增加代理商提现申请
 /// <param name="ttAgentTakeCashApply">代理商提现申请</param>
 /// </summary>
 public void Add(TTAgentTakeCashApply ttAgentTakeCashApply, double balanceValue)
 {
     try
     {
         if (ttAgentTakeCashApply.fee > balanceValue)
         {
             Message.success(context, "当前余额不足:" + ttAgentTakeCashApply.fee);
         }
         else
         {
             ttAgentTakeCashApplyDAO.Add(ttAgentTakeCashApply);
             Message.success(context, "提现申请增加成功");
             loginSession.Log(ttAgentTakeCashApply.agentName + "提现申请增加成功");
         }
     }
     catch (Exception e)
     {
         Message.error(context, "提现申请增加失败");
         loginSession.Log(e.Message);
     }
 }
コード例 #10
0
        /// <summary>
        /// 修改代理商提现申请
        /// </summary>
        /// <param name="data">数据库连接</param>
        /// <param name="ttAgentTakeCashApply">代理商提现申请</param>
        public virtual void Edit(DataAccess data, TTAgentTakeCashApply ttAgentTakeCashApply)
        {
            string strSQL = "update TTAgentTakeCashApply set agentId=@agentId,agentName=@agentName,fee=@fee,bankAccountId=@bankAccountId,remark=@remark,createTime=To_date(@createTime,'yyyy-mm-dd hh24:mi:ss'),dealWithStatus=@dealWithStatus,transferAccDate=To_date(@transferAccDate,'yyyy-mm-dd hh24:mi:ss'),operatorId=@operatorId,operatorName=@operatorName,dealWithTime=To_date(@dealWithTime,'yyyy-mm-dd hh24:mi:ss'),opinion=@opinion where flowId=@flowId";
            Param  param  = new Param();

            param.Clear();
            param.Add("@agentId", ttAgentTakeCashApply.agentId);                 //代理商编号
            param.Add("@agentName", ttAgentTakeCashApply.agentName);             //代理商名称
            param.Add("@fee", ttAgentTakeCashApply.fee);                         //提现金额
            param.Add("@bankAccountId", ttAgentTakeCashApply.bankAccountId);     //银行账号
            param.Add("@remark", ttAgentTakeCashApply.remark);                   //提现说明
            param.Add("@createTime", ttAgentTakeCashApply.createTime);           //创建时间
            param.Add("@dealWithStatus", ttAgentTakeCashApply.dealWithStatus);   //办理状态
            param.Add("@transferAccDate", ttAgentTakeCashApply.transferAccDate); //转账日期
            param.Add("@operatorId", ttAgentTakeCashApply.operatorId);           //办理人编号
            param.Add("@operatorName", ttAgentTakeCashApply.operatorName);       //办理人名称
            param.Add("@dealWithTime", ttAgentTakeCashApply.dealWithTime);       //办理时间
            param.Add("@opinion", ttAgentTakeCashApply.opinion);                 //办理意见
            param.Add("@flowId", ttAgentTakeCashApply.flowId);                   //流水号
            data.ExecuteNonQuery(CommandType.Text, strSQL, param);
        }
コード例 #11
0
        /// <summary>
        /// 读取代理商提现申请信息
        /// </summary>
        /// <param name="dr">记录指针</param>
        /// <returns>代理商提现申请对象</returns>
        protected virtual TTAgentTakeCashApply ReadData(ComDataReader dr)
        {
            TTAgentTakeCashApply ttAgentTakeCashApply = new TTAgentTakeCashApply();

            ttAgentTakeCashApply.flowId        = long.Parse(dr["flowId"].ToString()); //流水号
            ttAgentTakeCashApply.agentId       = dr["agentId"].ToString();            //代理商编号
            ttAgentTakeCashApply.agentName     = dr["agentName"].ToString();          //代理商名称
            ttAgentTakeCashApply.fee           = double.Parse(dr["fee"].ToString());  //提现金额
            ttAgentTakeCashApply.bankAccountId = dr["bankAccountId"].ToString();      //银行账号
            ttAgentTakeCashApply.remark        = dr["remark"].ToString();             //提现说明
            if (dr["createTime"] == null)
            {
                ttAgentTakeCashApply.createTime = "";//创建时间
            }
            else
            {
                ttAgentTakeCashApply.createTime = string.Format("{0:yyyy-MM-dd HH:mm:ss}", dr["createTime"]); //创建时间
            }
            ttAgentTakeCashApply.dealWithStatus = dr["dealWithStatus"].ToString();                            //办理状态
            if (dr["transferAccDate"] == null)
            {
                ttAgentTakeCashApply.transferAccDate = "";//转账日期
            }
            else
            {
                ttAgentTakeCashApply.transferAccDate = string.Format("{0:yyyy-MM-dd HH:mm:ss}", dr["transferAccDate"]); //转账日期
            }
            ttAgentTakeCashApply.operatorId   = dr["operatorId"].ToString();                                            //办理人编号
            ttAgentTakeCashApply.operatorName = dr["operatorName"].ToString();                                          //办理人名称
            if (dr["dealWithTime"] == null)
            {
                ttAgentTakeCashApply.dealWithTime = "";//办理时间
            }
            else
            {
                ttAgentTakeCashApply.dealWithTime = string.Format("{0:yyyy-MM-dd HH:mm:ss}", dr["dealWithTime"]); //办理时间
            }
            ttAgentTakeCashApply.opinion = dr["opinion"].ToString();                                              //办理意见
            return(ttAgentTakeCashApply);
        }
コード例 #12
0
 /// <summary>
 /// 修改代理商提现申请
 /// <param name="ttAgentTakeCashApply">代理商提现申请</param>
 /// </summary>
 public void Edit(TTAgentTakeCashApply ttAgentTakeCashApply, TTAgentTakeCash ttAgentTakeCash)
 {
     try
     {
         TBAgentDAO tbAgentDAO = new TBAgentDAO();
         TBAgent    tbAgent    = new TBAgent();
         tbAgent = tbAgentDAO.Get(ttAgentTakeCash.agentId);//获取代理商信息
         if (tbAgent.balanceValue < ttAgentTakeCash.fee && ttAgentTakeCashApply.dealWithStatus == ((int)DealWithStatus.HaveToDo).ToString())
         {
             Message.error(context, "代理商余额不足" + ttAgentTakeCash.fee);
         }
         else
         {
             ttAgentTakeCashApplyDAO.Edit(ttAgentTakeCashApply, ttAgentTakeCash, tbAgent);
             Message.success(context, "提现申请修改成功");
             loginSession.Log("提现申请修改成功");
         }
     }
     catch (Exception e)
     {
         Message.error(context, "代理商提现申请修改失败");
         loginSession.Log(e.Message);
     }
 }
コード例 #13
0
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                LoginUser loginUser = new LoginUser(context, "AgentTakeCashApply");
                if (!loginUser.Pass)//权限验证
                {
                    return;
                }
                //加载DataGrid
                if (context.Request["action"] == "gridLoad")
                {
                    AgentTakeCashApplyBLL bll = new AgentTakeCashApplyBLL(context, loginUser);
                    int    page      = int.Parse(context.Request["page"]);
                    int    rows      = int.Parse(context.Request["rows"]);
                    string startDate = context.Request["startDate"];
                    string endDate   = context.Request["endDate"];
                    bll.LoadGrid(page, rows, "", startDate, endDate);
                    return;
                }
                //办理状态
                if (context.Request["action"] == "dealWSListLoad")
                {
                    Combobox com = new Combobox(context, loginUser);
                    com.DealWSCombobox();
                }
                //加载信息
                if (context.Request["action"] == "load")
                {
                    AgentTakeCashApplyBLL bll = new AgentTakeCashApplyBLL(context, loginUser);
                    long flowId = long.Parse(context.Request["flowId"]);//流水号
                    bll.Load(flowId);
                    return;
                }

                //修改
                if (context.Request["action"] == "edit")
                {
                    AgentTakeCashApplyBLL bll = new AgentTakeCashApplyBLL(context, loginUser);
                    TTAgentTakeCashApply  ttAgentTakeCashApply = new TTAgentTakeCashApply();
                    ttAgentTakeCashApply.flowId          = long.Parse(context.Request["flowId"]);        //流水号
                    ttAgentTakeCashApply.dealWithStatus  = context.Request["dealWithStatus"];            //办理状态
                    ttAgentTakeCashApply.transferAccDate = context.Request["transferAccDate"];           //转账日期
                    ttAgentTakeCashApply.operatorId      = loginUser.UserId;                             //办理人编号
                    ttAgentTakeCashApply.operatorName    = loginUser.UserName;                           //办理人名称
                    ttAgentTakeCashApply.dealWithTime    = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); //办理时间
                    ttAgentTakeCashApply.opinion         = context.Request["opinion"];                   //办理意见

                    TTAgentTakeCash ttAgentTakeCash = new TTAgentTakeCash();
                    ttAgentTakeCash.agentId       = context.Request["agentId"];           //代理商编号
                    ttAgentTakeCash.fee           = double.Parse(context.Request["fee"]); //发生金额
                    ttAgentTakeCash.operatorId    = loginUser.UserId;;                    //操作人编号
                    ttAgentTakeCash.operatorName  = loginUser.UserName;                   //操作人名称
                    ttAgentTakeCash.handleMode    = "0";
                    ttAgentTakeCash.bankAccountId = context.Request["bankAccountId"];     //银行账号
                    ttAgentTakeCash.bankFlowId    = "";
                    ttAgentTakeCash.description   = context.Request["remark"];            //说明

                    bll.Edit(ttAgentTakeCashApply, ttAgentTakeCash);
                    return;
                }

                //删除
                if (context.Request["action"] == "delete")
                {
                    AgentTakeCashApplyBLL bll = new AgentTakeCashApplyBLL(context, loginUser);
                    long flowId = long.Parse(context.Request["flowId"]);//流水号
                    bll.Delete(flowId);
                    return;
                }
            }
            catch (Exception e)
            {
                Message.error(context, e.Message);
            }
        }
コード例 #14
0
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                LoginAgentUser loginAgentUser = new LoginAgentUser(context, "AgentTakeCashApply");
                AgentRoleBLL   agentRoleBLL   = new AgentRoleBLL(context, loginAgentUser);
                StaffBLL       staffBll       = new StaffBLL(context, loginAgentUser);
                if (!loginAgentUser.Pass)//权限验证
                {
                    return;
                }
                //获取用户登录的角色类型 0为 代理商 1 为员工
                string roleType = agentRoleBLL.GetRoleType(loginAgentUser.RoleIds);
                string agentId  = "";
                if (roleType == "0")
                {
                    agentId = loginAgentUser.UserId;
                }
                else
                {
                    agentId = staffBll.Get(loginAgentUser.UserId).agentId;
                }
                //加载DataGrid
                if (context.Request["action"] == "gridLoad")
                {
                    AgentTakeCashApplyBLL bll = new AgentTakeCashApplyBLL(context, loginAgentUser);
                    int    page      = int.Parse(context.Request["page"]);
                    int    rows      = int.Parse(context.Request["rows"]);
                    string startDate = context.Request["startDate"];
                    string endDate   = context.Request["endDate"];
                    bll.LoadGrid(page, rows, agentId, startDate, endDate);
                    return;
                }

                //加载信息
                if (context.Request["action"] == "load")
                {
                    AgentTakeCashApplyBLL bll = new AgentTakeCashApplyBLL(context, loginAgentUser);
                    long flowId = long.Parse(context.Request["flowId"]);//流水号
                    bll.Load(flowId);
                    return;
                }

                //增加
                if (context.Request["action"] == "add")
                {
                    AgentTakeCashApplyBLL bll = new AgentTakeCashApplyBLL(context, loginAgentUser);
                    TTAgentTakeCashApply  ttAgentTakeCashApply = new TTAgentTakeCashApply();
                    ttAgentTakeCashApply.agentId        = loginAgentUser.UserId;                //代理商编号
                    ttAgentTakeCashApply.agentName      = loginAgentUser.GetUserName();         //代理商名称
                    ttAgentTakeCashApply.fee            = double.Parse(context.Request["fee"]); //提现金额
                    ttAgentTakeCashApply.bankAccountId  = context.Request["bankAccountId"];     //银行账号
                    ttAgentTakeCashApply.remark         = context.Request["remark"];            //提现说明
                    ttAgentTakeCashApply.createTime     = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                    ttAgentTakeCashApply.dealWithStatus = "0";
                    bll.Add(ttAgentTakeCashApply);
                    return;
                }
                //删除
                if (context.Request["action"] == "delete")
                {
                    AgentTakeCashApplyBLL bll = new AgentTakeCashApplyBLL(context, loginAgentUser);
                    long flowId = long.Parse(context.Request["flowId"]);//流水号
                    bll.Delete(flowId);
                    return;
                }
            }
            catch (Exception e)
            {
                Message.error(context, e.Message);
            }
        }