Example #1
0
        /// <summary>
        /// 增加代理商信息
        /// <param name="tbAgent">代理商信息</param>
        /// </summary>
        public void Add(TBAgent tbAgent, TSAgentUser tsAgentUser)
        {
            TSAgentUserDAO tsAgentUserDAO = new TSAgentUserDAO();

            //判断是否名称重复
            if (tbAgentDAO.Exist("agentName", tbAgent.agentName))
            {
                Message.error(context, "名称重复请重新输入!");
                return;
            }
            //判断是否帐号重复
            if (tsAgentUserDAO.Exist("userCode", tsAgentUser.userCode))
            {
                Message.error(context, "用户帐号重复请重新输入!");
                return;
            }
            try
            {
                tbAgent.agentId = commonDao.GetMaxNo("TBAgent", "", 6);
                tbAgent.status  = tbAgent.status == null ? "0" : "1";
                tbAgentDAO.AddTrans(tbAgent, tsAgentUser);

                Message.success(context, "代理商信息增加成功,默认密码为帐号,登录后建议修改");
                loginSession.Log(tbAgent.agentName + "代理商信息增加成功");
            }
            catch (Exception e)
            {
                Message.error(context, "代理商信息增加失败");
                loginSession.Log(e.Message);
            }
        }
Example #2
0
        /// <summary>
        /// 增加代理商信息
        /// <param name="data">数据库连接</param>
        /// <param name="tbAgent">代理商信息</param>
        /// </summary>
        public void Add(DataAccess data, TBAgent tbAgent)
        {
            //添加系统用户信息记录
            string strSQL = "insert into TBAgent";

            strSQL += "(agentId, agentName,rebate,warnValue, contact, telephone, areaId, address,IDNumber,bankCardId,bankName,status,fixedLine,remark) values ";
            strSQL += "(:agentId,:agentName,:rebate,:warnValue, :contact, :telephone, :areaId, :address,:IDNumber,:bankCardId,:bankName,:status,:fixedLine,:remark)";
            Param param = new Param();

            param.Clear();
            param.Add(":agentId", tbAgent.agentId);
            param.Add(":agentName", tbAgent.agentName);
            param.Add(":rebate", tbAgent.rebate);
            param.Add(":warnValue", tbAgent.warnValue);
            param.Add(":contact", tbAgent.contact);
            param.Add(":telephone", tbAgent.telephone);
            param.Add(":areaId", tbAgent.areaId);
            param.Add(":address", tbAgent.address);
            param.Add(":IDNumber", tbAgent.IDNumber);
            param.Add(":bankCardId", tbAgent.bankCardId);
            param.Add(":bankName", tbAgent.bankName);
            param.Add(":warnValue", tbAgent.warnValue);
            param.Add(":status", "0");
            param.Add(":fixedLine", tbAgent.fixedLine);
            param.Add(":remark", tbAgent.remark);
            data.ExecuteNonQuery(CommandType.Text, strSQL, param);
        }
Example #3
0
        /// <summary>
        /// 修改代理商信息
        /// <param name="data">数据库连接</param>
        /// <param name="tbAgent">代理商信息</param>
        /// </summary>
        public override void Edit(DataAccess data, TBAgent tbAgent)
        {
            string strSQL = "update TBAgent set agentName=@agentName,rebate=@rebate, contact=@contact, telephone=@telephone, areaId=@areaId, address=@address,IDNumber=@IDNumber, ";

            strSQL += " bankCardId=@bankCardId,bankName=@bankName,warnValue=@warnValue,status=@status,auditStatus=@auditStatus,fixedLine=@fixedLine,remark=@remark where agentId =@agentId";
            Param param = new Param();

            param.Clear();
            param.Add("@agentId", tbAgent.agentId);
            param.Add("@agentName", tbAgent.agentName);
            param.Add("@rebate", tbAgent.rebate);
            param.Add("@contact", tbAgent.contact);
            param.Add("@telephone", tbAgent.telephone);
            param.Add("@areaId", tbAgent.areaId);
            param.Add("@address", tbAgent.address);
            param.Add("@IDNumber", tbAgent.IDNumber);
            param.Add("@bankCardId", tbAgent.bankCardId);
            param.Add("@bankName", tbAgent.bankName);
            param.Add("@warnValue", tbAgent.warnValue);
            param.Add("@status", tbAgent.status);
            param.Add("@auditStatus", tbAgent.auditStatus);
            param.Add("@fixedLine", tbAgent.fixedLine);
            param.Add("@remark", tbAgent.remark);
            data.ExecuteNonQuery(CommandType.Text, strSQL, param);
        }
Example #4
0
        /// <summary>
        /// 读取代理商信息信息
        /// </summary>
        /// <param name="dr">记录指针</param>
        /// <returns>代理商信息对象</returns>
        protected virtual TBAgent ReadData(ComDataReader dr)
        {
            TBAgent tbAgent = new TBAgent();

            tbAgent.agentId           = dr["agentId"].ToString();                         //代理商编号
            tbAgent.agentName         = dr["agentName"].ToString();                       //代理商名称
            tbAgent.rebate            = double.Parse(dr["rebate"].ToString());            //返点比例
            tbAgent.contact           = dr["contact"].ToString();                         //联系人
            tbAgent.telephone         = dr["telephone"].ToString();                       //手机号码
            tbAgent.areaId            = dr["areaId"].ToString();                          //区域编号
            tbAgent.address           = dr["address"].ToString();                         //详细地址
            tbAgent.IDNumber          = dr["IDNumber"].ToString();                        //身份证号
            tbAgent.bankName          = dr["bankName"].ToString();                        //开户银行
            tbAgent.bankCardId        = dr["bankCardId"].ToString();                      //银行卡号
            tbAgent.auditStatus       = dr["auditStatus"].ToString();                     //审批状态
            tbAgent.clientSumDraw     = double.Parse(dr["clientSumDraw"].ToString());     //客户提现总额
            tbAgent.clientSumRecharge = double.Parse(dr["clientSumRecharge"].ToString()); //客户充值总额
            tbAgent.sumDraw           = double.Parse(dr["sumDraw"].ToString());           //提现总额
            tbAgent.sumRecharge       = double.Parse(dr["sumRecharge"].ToString());       //充值总额
            tbAgent.warnValue         = double.Parse(dr["warnValue"].ToString());         //预警金额
            tbAgent.balanceValue      = double.Parse(dr["balanceValue"].ToString());      //账户余额
            tbAgent.status            = dr["status"].ToString();                          //使用状态
            tbAgent.fixedLine         = dr["fixedLine"].ToString();                       //固定电话
            tbAgent.remark            = dr["remark"].ToString();                          //备注说明
            return(tbAgent);
        }
Example #5
0
        /// <summary>
        /// 修改代理商信息
        /// <param name="data">数据库连接</param>
        /// <param name="tbAgent">代理商信息</param>
        /// </summary>
        public void Edit(DataAccess data, TBAgent tbAgent)
        {
            string strSQL = "update TBAgent set agentName=:agentName,rebate=:rebate, contact=:contact, telephone=:telephone, areaId=:areaId, address=:address,IDNumber=:IDNumber, ";

            strSQL += " bankCardId=:bankCardId,bankName=:bankName,warnValue=:warnValue,status=:status,auditStatus=:auditStatus,fixedLine=:fixedLine,remark=:remark where agentId =:agentId";
            Param param = new Param();

            param.Clear();
            param.Add(":agentId", tbAgent.agentId);
            param.Add(":agentName", tbAgent.agentName);
            param.Add(":rebate", tbAgent.rebate);
            param.Add(":contact", tbAgent.contact);
            param.Add(":telephone", tbAgent.telephone);
            param.Add(":areaId", tbAgent.areaId);
            param.Add(":address", tbAgent.address);
            param.Add(":IDNumber", tbAgent.IDNumber);
            param.Add(":bankCardId", tbAgent.bankCardId);
            param.Add(":bankName", tbAgent.bankName);
            param.Add(":warnValue", tbAgent.warnValue);
            param.Add(":status", tbAgent.status);
            param.Add(":auditStatus", tbAgent.auditStatus);
            param.Add(":fixedLine", tbAgent.fixedLine);
            param.Add(":remark", tbAgent.remark);
            data.ExecuteNonQuery(CommandType.Text, strSQL, param);
        }
Example #6
0
        /// <summary>
        /// 获取代理商信息
        /// </summary>
        /// <param name="agentId">代理商编号</param>
        /// <returns>代理商信息对象</returns>
        public virtual TBAgent Get(string agentId)
        {
            TBAgent tbAgent = null;

            try
            {
                string strSQL = "select * from TBAgent where agentId=@agentId";
                Param  param  = new Param();
                param.Clear();
                param.Add("@agentId", agentId);
                db.Open();
                ComDataReader dr = db.ExecuteReader(CommandType.Text, strSQL, param);
                if (dr.Read())
                {
                    tbAgent = ReadData(dr);
                }
                dr.Close();
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                db.Close();
            }
            return(tbAgent);
        }
Example #7
0
        /// <summary>
        /// 修改代理商信息
        /// </summary>
        /// <param name="data">数据库连接</param>
        /// <param name="tbAgent">代理商信息</param>
        public virtual void Edit(DataAccess data, TBAgent tbAgent)
        {
            string strSQL = "update TBAgent set agentName=@agentName,rebate=@rebate,contact=@contact,telephone=@telephone,areaId=@areaId,address=@address,IDNumber=@IDNumber,bankName=@bankName,bankCardId=@bankCardId,auditStatus=@auditStatus,clientSumDraw=@clientSumDraw,clientSumRecharge=@clientSumRecharge,sumDraw=@sumDraw,sumRecharge=@sumRecharge,warnValue=@warnValue,balanceValue=@balanceValue,status=@status,fixedLine=@fixedLine,remark=@remark where agentId=@agentId";
            Param  param  = new Param();

            param.Clear();
            param.Add("@agentName", tbAgent.agentName);                 //代理商名称
            param.Add("@rebate", tbAgent.rebate);                       //返点比例
            param.Add("@contact", tbAgent.contact);                     //联系人
            param.Add("@telephone", tbAgent.telephone);                 //手机号码
            param.Add("@areaId", tbAgent.areaId);                       //区域编号
            param.Add("@address", tbAgent.address);                     //详细地址
            param.Add("@IDNumber", tbAgent.IDNumber);                   //身份证号
            param.Add("@bankName", tbAgent.bankName);                   //开户银行
            param.Add("@bankCardId", tbAgent.bankCardId);               //银行卡号
            param.Add("@auditStatus", tbAgent.auditStatus);             //审批状态
            param.Add("@clientSumDraw", tbAgent.clientSumDraw);         //客户提现总额
            param.Add("@clientSumRecharge", tbAgent.clientSumRecharge); //客户充值总额
            param.Add("@sumDraw", tbAgent.sumDraw);                     //提现总额
            param.Add("@sumRecharge", tbAgent.sumRecharge);             //充值总额
            param.Add("@warnValue", tbAgent.warnValue);                 //预警金额
            param.Add("@balanceValue", tbAgent.balanceValue);           //账户余额
            param.Add("@status", tbAgent.status);                       //使用状态
            param.Add("@fixedLine", tbAgent.fixedLine);                 //固定电话
            param.Add("@remark", tbAgent.remark);                       //备注说明
            param.Add("@agentId", tbAgent.agentId);                     //代理商编号
            data.ExecuteNonQuery(CommandType.Text, strSQL, param);
        }
Example #8
0
        /// <summary>
        /// 增加代理商充值
        /// <param name="ttAgentRecharge">代理商充值</param>
        /// </summary>
        public void Add(DataAccess db, TTAgentTakeCash ttAgentTakeCash, TBAgent tbAgent)
        {
            try
            {
                //修改代理商信息表的当前余额
                tbAgent.sumDraw      = tbAgent.sumDraw + ttAgentTakeCash.fee;
                tbAgent.balanceValue = tbAgent.balanceValue - ttAgentTakeCash.fee;
                new TBAgentDAO().EditBalance(db, tbAgent);

                ttAgentTakeCash.agentName   = tbAgent.agentName;                          //代理商名称
                ttAgentTakeCash.lastBalance = tbAgent.balanceValue + ttAgentTakeCash.fee; //代理商上次余额
                ttAgentTakeCash.balance     = tbAgent.balanceValue;                       //代理商当前余额
                Add(db, ttAgentTakeCash);
                //添加代理商提现账户明细
                TTAgentAccDetailDAO ttAgentAccDetailDAO = new TTAgentAccDetailDAO();
                TTAgentAccDetail    ttAgentAccDetail    = new TTAgentAccDetail();
                ttAgentAccDetail.agentId     = ttAgentTakeCash.agentId;
                ttAgentAccDetail.agentName   = ttAgentTakeCash.agentName;
                ttAgentAccDetail.lastBalance = ttAgentTakeCash.lastBalance;
                ttAgentAccDetail.fee         = 0 - ttAgentTakeCash.fee;
                ttAgentAccDetail.balance     = ttAgentTakeCash.balance;
                ttAgentAccDetail.createTime  = ttAgentTakeCash.createTime;
                ttAgentAccDetail.remark      = ttAgentTakeCash.description;
                new TTAgentAccDetailDAO().Add(db, ttAgentAccDetail);
            }
            catch (Exception e)
            {
                throw e;
            }
        }
Example #9
0
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                LoginUser loginUser = new LoginUser(context, "AgentAudit");
                if (!loginUser.Pass)//权限验证
                {
                    return;
                }

                AgentBLL bll = new AgentBLL(context, loginUser);
                if (context.Request["action"] == "gridLoad")
                {
                    //加载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"];
                    bll.LoadGrid(page, rows, agentName, agentId, "", ((int)AuditStauts.NotAudit).ToString());
                }
                else if (context.Request["action"] == "areaListLoad")
                {
                    //加载区域列表
                    Combobox com = new Combobox(context, loginUser);
                    com.AreaCombobox();
                }
                else if (context.Request["action"] == "auditListLoad")
                {
                    //加载审核状态列表
                    Combobox com = new Combobox(context, loginUser);
                    com.AuditCombobox();
                }
                else if (context.Request["action"] == "load")
                {
                    //加载信息
                    bll.Load(context.Request["agentId"]);
                }
                else if (context.Request["action"] == "audit")
                {
                    //审核
                    TBAgent agent = new TBAgent();
                    agent.agentId     = context.Request["agentId"];
                    agent.auditStatus = context.Request["auditStatus"];
                    agent.status      = "0";
                    if (agent.auditStatus == ((int)AuditStauts.AuditSucces).ToString())
                    {
                        agent.status = "1";
                    }
                    agent.remark = context.Request["remark"];
                    bll.Audit(agent);
                }
            }
            catch (Exception e)
            {
                Message.error(context, e.Message);
            }
        }
Example #10
0
        /// <summary>
        /// 修改余额以及充值总额
        /// </summary>
        /// <param name="tbAgent"></param>
        public void EditBalance(DataAccess data, TBAgent tbAgent)
        {
            string strSQL = "update TBAgent set balanceValue=:balanceValue,sumRecharge=:sumRecharge,sumDraw=:sumDraw where agentId =:agentId";
            Param  param  = new Param();

            param.Clear();
            param.Add(":agentId", tbAgent.agentId);
            param.Add(":balanceValue", tbAgent.balanceValue);
            param.Add(":sumRecharge", tbAgent.sumRecharge);
            param.Add(":sumDraw", tbAgent.sumDraw);
            data.ExecuteNonQuery(CommandType.Text, strSQL, param);
        }
Example #11
0
 /// <summary>
 /// 修改
 /// </summary>
 /// <param name="user">用户对象</param>
 public void Audit(TBAgent tbAgent)
 {
     try
     {
         tbAgentDAO.Audit(tbAgent);
         Message.success(context, "审核操作成功");
         loginSession.Log(tbAgent.agentName + "[" + tbAgent.agentId + "]代理商审核操作成功");
     }
     catch (Exception e)
     {
         Message.error(context, "代理商审核失败");
         loginSession.Log(e.Message);
     }
 }
Example #12
0
        /// <summary>
        /// 获取指定代理商信息
        /// <param name="agentId">代理商编号</param>
        /// </summary>
        public TBAgent Get(string agentId)
        {
            TBAgent tbAgent = new TBAgent();

            try
            {
                tbAgent = tbAgentDAO.Get(agentId);
            }
            catch (Exception e)
            {
                Message.error(context, e.Message);
            }
            return(tbAgent);
        }
Example #13
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();
            }
        }
Example #14
0
 /// <summary>
 /// 增加代理商信息
 /// </summary>
 /// <param name="tbAgent">代理商信息</param>
 public virtual void Add(TBAgent tbAgent)
 {
     try
     {
         db.Open();
         Add(db, tbAgent);
     }
     catch (Exception e)
     {
         throw e;
     }
     finally
     {
         db.Close();
     }
 }
Example #15
0
 /// <summary>
 /// 修改代理商信息
 /// <param name="tbAgent">代理商信息</param>
 /// </summary>
 public void Edit(TBAgent tbAgent)
 {
     try
     {
         db.Open();
         Edit(db, tbAgent);
     }
     catch (Exception e)
     {
         throw e;
     }
     finally
     {
         db.Close();
     }
 }
Example #16
0
 /// <summary>
 /// 增加代理商充值
 /// <param name="ttAgentRecharge">代理商充值</param>
 /// </summary>
 public void Add(DataAccess db, TTAgentTakeCash ttAgentTakeCash, TBAgent tbAgent)
 {
     //ComTransaction trans = null;
     try
     {
         //db.Open();
         //trans = db.BeginTransaction();
         ttAgentTakeCash.agentName   = tbAgent.agentName;                                 //代理商名称
         ttAgentTakeCash.lastBalance = tbAgent.balanceValue;                              //代理商上次余额
         ttAgentTakeCash.balance     = ttAgentTakeCash.lastBalance - ttAgentTakeCash.fee; //代理商当前余额
         Add(db, ttAgentTakeCash);
         //添加代理商提现账户明细
         TTAgentAccDetailDAO ttAgentAccDetailDAO = new TTAgentAccDetailDAO();
         TTAgentAccDetail    ttAgentAccDetail    = new TTAgentAccDetail();
         ttAgentAccDetail.agentId     = ttAgentTakeCash.agentId;
         ttAgentAccDetail.agentName   = ttAgentTakeCash.agentName;
         ttAgentAccDetail.lastBalance = ttAgentTakeCash.lastBalance;
         ttAgentAccDetail.fee         = 0 - ttAgentTakeCash.fee;
         ttAgentAccDetail.balance     = ttAgentTakeCash.balance;
         ttAgentAccDetail.createTime  = ttAgentTakeCash.createTime;
         ttAgentAccDetail.remark      = ttAgentTakeCash.description;
         new TTAgentAccDetailDAO().Add(db, ttAgentAccDetail);
         //修改代理商信息表的当前余额
         tbAgent.sumDraw      = tbAgent.sumDraw + ttAgentTakeCash.fee;
         tbAgent.balanceValue = ttAgentTakeCash.balance;
         new TBAgentDAO().EditBalance(db, tbAgent);
         //trans.Commit();
     }
     catch (Exception e)
     {
         //trans.Rollback();
         throw e;
     }
     //finally
     //{
     //    db.Close();
     //}
 }
Example #17
0
        private DataAccess db = new DataAccess(DataAccess.DBConn);//数据库连接

        #region 新增代码


        /// <summary>
        /// 事务增加代理商信息并添加代理商用户
        /// <param name="tbAgent">代理商信息</param>
        /// <param name="tbAgent">代理商用户信息</param>
        /// </summary>
        public void AddTrans(TBAgent tbAgent, TSAgentUser tsAgentUser)
        {
            ComTransaction trans = null;

            try
            {
                db.Open();
                trans = db.BeginTransaction();
                Add(db, tbAgent);
                tsAgentUser.userId  = tbAgent.agentId;
                tsAgentUser.userPwd = Encrypt.ConvertPwd(tsAgentUser.userId, tsAgentUser.userPwd);
                new TSAgentUserDAO().Add(db, tsAgentUser);
                trans.Commit();
            }
            catch (Exception e)
            {
                trans.Rollback();
                throw e;
            }
            finally
            {
                db.Close();
            }
        }
Example #18
0
        /// <summary>
        /// 审核修改审核状态
        /// </summary>
        /// <param name="tbAgent"></param>
        public void Audit(TBAgent tbAgent)
        {
            string strSQL = "update TBAgent set auditStatus=:auditStatus,remark=:remark,status=:status where agentId =:agentId";
            Param  param  = new Param();

            param.Clear();
            param.Add(":agentId", tbAgent.agentId);
            param.Add(":auditStatus", tbAgent.auditStatus);
            param.Add(":status", tbAgent.status);
            param.Add(":remark", tbAgent.remark);
            try
            {
                db.Open();
                db.ExecuteNonQuery(CommandType.Text, strSQL, param);
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                db.Close();
            }
        }
Example #19
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);
     }
 }
Example #20
0
        /// <summary>
        /// 修改代理商信息
        /// <param name="tbAgent">代理商信息</param>
        /// </summary>
        public void Edit(TBAgent tbAgent)
        {
            //判断是否帐号重复
            List <TBAgent> list = tbAgentDAO.GetList("agentName", tbAgent.agentName);

            if (list.Count > 0 && !tbAgent.agentId.Equals(list[0].agentId))
            {
                Message.error(context, "名称重复请重新输入!");
                return;
            }

            try
            {
                tbAgent.status = (tbAgent.status == null || tbAgent.status == "off") ? "0" : "1";
                tbAgentDAO.Edit(tbAgent);
                Message.success(context, "代理商信息修改成功");
                loginSession.Log(tbAgent.agentName + "[" + tbAgent.agentId + "]代理商信息修改成功");
            }
            catch (Exception e)
            {
                Message.error(context, "代理商信息修改失败");
                loginSession.Log(e.Message);
            }
        }
Example #21
0
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                LoginUser loginUser = new LoginUser(context, "AgentAdd");
                if (!loginUser.Pass)//权限验证
                {
                    return;
                }

                AgentBLL bll = new AgentBLL(context, loginUser);
                if (context.Request["action"] == "gridLoad")
                {
                    //加载DataGrid
                    int    page        = int.Parse(context.Request["page"]);
                    int    rows        = int.Parse(context.Request["rows"]);
                    string agentName   = context.Request["agentName"];
                    string agentId     = context.Request["agentId"];
                    string auditStatus = context.Request["auditStatus"];
                    bll.LoadGrid(page, rows, agentName, agentId, "", auditStatus);
                }
                else if (context.Request["action"] == "areaListLoad")
                {
                    //加载区域列表
                    Combobox com = new Combobox(context, loginUser);
                    com.AreaCombobox();
                }
                else if (context.Request["action"] == "auditListLoad")
                {
                    //加载审核状态列表
                    Combobox com = new Combobox(context, loginUser);
                    com.AuditCombobox();
                }
                else if (context.Request["action"] == "load")
                {
                    //加载信息
                    bll.Load(context.Request["agentId"]);
                }
                else if (context.Request["action"] == "add")
                {
                    //增加
                    TBAgent     agent       = new TBAgent();
                    TSAgentUser tsAgentUser = new TSAgentUser();
                    agent.agentId        = context.Request["agentId"];
                    agent.agentName      = context.Request["agentName"];
                    agent.rebate         = double.Parse(context.Request["rebate"]);
                    agent.warnValue      = double.Parse(context.Request["warnValue"]);
                    agent.contact        = context.Request["contact"];
                    agent.telephone      = context.Request["telephone"];
                    agent.areaId         = context.Request["areaId"];
                    agent.address        = context.Request["address"];
                    agent.IDNumber       = context.Request["IDNumber"];
                    agent.bankCardId     = context.Request["bankCardId"];
                    agent.bankName       = context.Request["bankName"];
                    agent.status         = "0";
                    agent.fixedLine      = context.Request["fixedLine"];
                    agent.remark         = context.Request["remark"];
                    tsAgentUser.roleId   = "001";
                    tsAgentUser.userCode = context.Request["agentUserCode"];
                    tsAgentUser.userPwd  = tsAgentUser.userCode;
                    bll.Add(agent, tsAgentUser);
                }
                else if (context.Request["action"] == "edit")
                {
                    //修改
                    TBAgent agent = new TBAgent();
                    agent.agentId     = context.Request["agentId"];
                    agent.agentName   = context.Request["agentName"];
                    agent.rebate      = double.Parse(context.Request["rebate"]);
                    agent.contact     = context.Request["contact"];
                    agent.telephone   = context.Request["telephone"];
                    agent.areaId      = context.Request["areaId"];
                    agent.address     = context.Request["address"];
                    agent.IDNumber    = context.Request["IDNumber"];
                    agent.bankCardId  = context.Request["bankCardId"];
                    agent.bankName    = context.Request["bankName"];
                    agent.status      = context.Request["status"];
                    agent.warnValue   = double.Parse(context.Request["warnValue"]);
                    agent.auditStatus = "0";
                    agent.fixedLine   = context.Request["fixedLine"];
                    agent.remark      = context.Request["remark"];
                    bll.Edit(agent);
                }
                else if (context.Request["action"] == "delete")
                {
                    //删除
                    string agentId = context.Request["agentId"];
                    bll.Delete(agentId);
                }
            }
            catch (Exception e)
            {
                Message.error(context, e.Message);
            }
        }
Example #22
0
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                LoginUser loginUser = new LoginUser(context, "AgentOam");
                if (!loginUser.Pass)//权限验证
                {
                    return;
                }

                AgentBLL bll = new AgentBLL(context, loginUser);
                if (context.Request["action"] == "gridLoad")
                {
                    //加载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"];
                    bll.LoadGrid(page, rows, agentName, agentId, "", ((int)AuditStauts.AuditSucces).ToString());
                }
                else if (context.Request["action"] == "areaListLoad")
                {
                    //加载区域列表
                    bll.AreaCombobox();
                }
                else if (context.Request["action"] == "auditListLoad")
                {
                    //加载审核状态列表
                    bll.AuditCombobox();
                }
                else if (context.Request["action"] == "load")
                {
                    //加载信息
                    bll.Load(context.Request["agentId"]);
                }
                else if (context.Request["action"] == "edit")
                {
                    //修改
                    TBAgent agent = new TBAgent();
                    agent.agentId     = context.Request["agentId"];
                    agent.agentName   = context.Request["agentName"];
                    agent.rebate      = double.Parse(context.Request["rebate"]);
                    agent.contact     = context.Request["contact"];
                    agent.telephone   = context.Request["telephone"];
                    agent.areaId      = context.Request["areaId"];
                    agent.address     = context.Request["address"];
                    agent.IDNumber    = context.Request["IDNumber"];
                    agent.bankCardId  = context.Request["bankCardId"];
                    agent.bankName    = context.Request["bankName"];
                    agent.status      = context.Request["status"];
                    agent.auditStatus = ((int)AuditStauts.AuditSucces).ToString();
                    agent.fixedLine   = context.Request["fixedLine"];
                    agent.remark      = context.Request["remark"];
                    bll.Edit(agent);
                }
            }
            catch (Exception e)
            {
                Message.error(context, e.Message);
            }
        }
Example #23
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();
            }
        }