Example #1
0
        /// <summary>
        /// 添加应用
        /// </summary>
        /// <returns></returns>

        public ActionResult AppAdd()
        {
            #region =========获取应用平台在用信息=========
            JMP.BLL.jmp_platform        bll  = new JMP.BLL.jmp_platform();
            DataTable                   dt   = bll.GetList(" 1=1 and p_state='1' ").Tables[0];//获取应用平台在用信息
            List <JMP.MDL.jmp_platform> yypt = JMP.TOOL.MdlList.ToList <JMP.MDL.jmp_platform>(dt);
            ViewBag.glptdt = yypt;
            #endregion
            #region ========获取应用类型在用信息======
            JMP.BLL.jmp_apptype yybll = new JMP.BLL.jmp_apptype();
            string where = "  t_id in (select  DISTINCT(t_topid) from jmp_apptype where t_topid in( select t_id from jmp_apptype where t_topid='0'   )) and t_state='1' order by t_sort desc";
            DataTable yydt = yybll.GetList(where).Tables[0];//获取应用类型在用信息
            List <JMP.MDL.jmp_apptype> yylist = JMP.TOOL.MdlList.ToList <JMP.MDL.jmp_apptype>(yydt);
            ViewBag.yylist = yylist;
            #endregion
            int userid               = UserInfo.UserId;
            var userlist             = _UserService.FindListBySql("relation_type=2 and relation_person_id='" + userid + "' and u_state=1", "");
            JMP.BLL.jmp_user userbll = new JMP.BLL.jmp_user();
            ViewBag.userlist = userlist;
            int appid = string.IsNullOrEmpty(Request["appid"]) ? 0 : Int32.Parse(Request["appid"]);

            #region 获取所有支付方式

            JMP.BLL.jmp_paymode        zfbll  = new JMP.BLL.jmp_paymode();
            DataTable                  zfdt   = new DataTable();
            List <JMP.MDL.jmp_paymode> zflist = new List <JMP.MDL.jmp_paymode>();
            zfdt          = zfbll.GetList(" 1=1 and p_state='1' ").Tables[0];//获取支付类型在用信息
            zflist        = JMP.TOOL.MdlList.ToList <JMP.MDL.jmp_paymode>(zfdt);
            ViewBag.appid = appid;
            ViewBag.list  = zflist;
            #endregion

            return(View());
        }
Example #2
0
        public JsonResult UpdatePayRart()
        {
            JMP.BLL.jmp_paymode bll   = new JMP.BLL.jmp_paymode();
            JMP.MDL.jmp_paymode model = new JMP.MDL.jmp_paymode();

            object retJson = new { success = 0, msg = "操作失败" };

            int    pid    = string.IsNullOrEmpty(Request["pid"]) ? 0 : int.Parse(Request["pid"]);
            string p_rate = string.IsNullOrEmpty(Request["p_rate"]) ? "0" : Request["p_rate"];

            //获取一个实体对象
            model = bll.GetModel(pid);

            if (bll.Update_rate(pid, p_rate))
            {
                //记录日志(会定期清理)
                Logger.OperateLog("修改接口费率", "操作数据ID:" + pid + ",接口费率由:" + model.p_rate + ",改为:" + p_rate + "。");
                //记录日志(不会清理)
                RateLogger.OperateLog("修改接口费率", "操作数据ID:" + pid + ",接口费率由:" + model.p_rate + ",改为:" + p_rate + "。");

                retJson = new { success = 1, msg = "设置接口费率成功" };
            }

            else
            {
                retJson = new { success = 0, msg = "设置接口费率失败" };
            }

            return(Json(retJson));
        }
Example #3
0
        public ActionResult PaymodeAddOrUpdate()
        {
            int p_id = string.IsNullOrEmpty(Request["p_id"]) ? 0 : Int32.Parse(Request["p_id"]);

            JMP.BLL.jmp_paymode bll  = new JMP.BLL.jmp_paymode();
            JMP.MDL.jmp_paymode mode = new JMP.MDL.jmp_paymode();
            if (p_id > 0)
            {
                mode = bll.GetModel(p_id);
            }
            ViewBag.mode = mode;
            return(View());
        }
Example #4
0
        /// <summary>
        /// 设置接口费率
        /// </summary>
        /// <returns></returns>
        public ActionResult PaymodeRartAdd()
        {
            int id = string.IsNullOrEmpty(Request["pid"]) ? 0 : int.Parse(Request["pid"]);

            JMP.MDL.jmp_paymode model = new JMP.MDL.jmp_paymode();
            JMP.BLL.jmp_paymode bll   = new JMP.BLL.jmp_paymode();

            //查询
            model = bll.GetModel(id);

            ViewBag.model = model;

            return(View());
        }
Example #5
0
        /// <summary>
        /// 添加应用基本
        /// </summary>
        /// <returns></returns>
        public ActionResult AppAdd()
        {
            #region 获取用户实名认证状态信息

            JMP.BLL.jmp_user sm_bll   = new JMP.BLL.jmp_user();
            JMP.MDL.jmp_user sm_model = new JMP.MDL.jmp_user();

            int u_ids = UserInfo.Uid;

            //查询登录信息
            sm_model = sm_bll.GetModel(u_ids);

            ViewBag.auditstate = sm_model.u_auditstate;
            ViewBag.linkEmail  = sm_model.u_email;

            #endregion

            #region =========获取应用平台在用信息=========
            JMP.BLL.jmp_platform        bll  = new JMP.BLL.jmp_platform();
            DataTable                   dt   = bll.GetList(" 1=1 and p_state='1' ").Tables[0];//获取应用平台在用信息
            List <JMP.MDL.jmp_platform> yypt = JMP.TOOL.MdlList.ToList <JMP.MDL.jmp_platform>(dt);
            ViewBag.glptdt = yypt;
            #endregion

            #region ========获取应用类型在用信息======
            JMP.BLL.jmp_apptype yybll = new JMP.BLL.jmp_apptype();
            string where = "  t_id in (select  DISTINCT(t_topid) from jmp_apptype where t_topid in( select t_id from jmp_apptype where t_topid='0'   )) and t_state='1' order by t_sort desc";
            DataTable yydt = yybll.GetList(where).Tables[0];//获取应用类型在用信息
            List <JMP.MDL.jmp_apptype> yylist = JMP.TOOL.MdlList.ToList <JMP.MDL.jmp_apptype>(yydt);
            ViewBag.yylist = yylist;
            #endregion

            int appid = string.IsNullOrEmpty(Request["appid"]) ? 0 : Int32.Parse(Request["appid"]);

            #region 获取所有支付方式

            JMP.BLL.jmp_paymode zfbll = new JMP.BLL.jmp_paymode();

            DataTable zfdt = new DataTable();
            List <JMP.MDL.jmp_paymode> zflist = new List <JMP.MDL.jmp_paymode>();
            zfdt          = zfbll.GetList(" 1=1 and p_state='1' ").Tables[0];//获取支付类型在用信息
            zflist        = JMP.TOOL.MdlList.ToList <JMP.MDL.jmp_paymode>(zfdt);
            ViewBag.appid = appid;
            ViewBag.list  = zflist;
            #endregion


            return(View());
        }
Example #6
0
        /// <summary>
        /// 一键启用或禁用支付类型状态
        /// </summary>
        /// <returns></returns>
        public JsonResult UpdatePaymodeState()
        {
            object retJson = new { success = 0, msg = "操作失败" };
            int    state   = string.IsNullOrEmpty(Request["state"]) ? 0 : Int32.Parse(Request["state"].ToString());
            string str     = Request["ids"];
            string xgzfc   = ""; //组装说明
            string tsmsg   = ""; //提示

            JMP.BLL.jmp_paymode bll = new JMP.BLL.jmp_paymode();
            if (str.CompareTo("On") > 0)
            {
                str = str.Substring(3);
            }
            if (bll.UpdateLocUserState(str, state))
            {
                if (state == 1)
                {
                    xgzfc = "一键启用ID为:" + str;
                    tsmsg = "启用成功";
                }
                else
                {
                    tsmsg = "禁用成功";
                    xgzfc = "一键禁用ID为:" + str;
                }

                Logger.OperateLog("一键启用或禁用支付类型状态", xgzfc);
                retJson = new { success = 1, msg = tsmsg };
            }
            else
            {
                if (state == 1)
                {
                    tsmsg = "启用失败";
                }
                else
                {
                    tsmsg = "禁用失败";
                }
                retJson = new { success = 0, msg = tsmsg };
            }
            return(Json(retJson));
        }
Example #7
0
        public static string SelectPay(string pid)
        {
            string paystr = "";

            if (!string.IsNullOrEmpty(pid.ToString()))
            {
                JMP.BLL.jmp_paymode zfbll = new JMP.BLL.jmp_paymode();
                DataTable           zfdt  = new DataTable();
                zfdt = zfbll.GetList(" 1=1 and p_state='1' and  p_id in(" + pid + ") ").Tables[0];//获取支付类型在用信息
                if (zfdt.Rows.Count > 0)
                {
                    for (int i = 0; i < zfdt.Rows.Count; i++)
                    {
                        paystr += zfdt.Rows[i]["p_name"] + ",";
                    }
                }
            }
            return(paystr);
        }
Example #8
0
        /// <summary>
        /// 订单列表
        /// </summary>
        /// <returns></returns>
        public ActionResult OrderList()
        {
            #region 获取信息

            JMP.BLL.jmp_paymode        paymodebll  = new JMP.BLL.jmp_paymode();
            List <JMP.MDL.jmp_paymode> paymodeList = paymodebll.GetModelList("1=1 and p_state='1' ");//支付类型
            ViewBag.paymodeList = paymodeList;
            #endregion
            #region 查询
            int    pageIndexs   = string.IsNullOrEmpty(Request["pageIndexs"]) ? 1 : Int32.Parse(Request["pageIndexs"]);            //当前页
            int    PageSize     = string.IsNullOrEmpty(Request["PageSize"]) ? 20 : Int32.Parse(Request["PageSize"]);               //每页显示数量
            int    searchType   = string.IsNullOrEmpty(Request["searchType"]) ? 0 : Int32.Parse(Request["searchType"]);            //查询条件选择
            string searchname   = string.IsNullOrEmpty(Request["searchname"]) ? "" : Request["searchname"];                        //查询类容
            string stime        = string.IsNullOrEmpty(Request["stime"]) ? DateTime.Now.ToString("yyyy-MM-dd") : Request["stime"]; //开始时间
            string etime        = string.IsNullOrEmpty(Request["etime"]) ? DateTime.Now.ToString("yyyy-MM-dd") : Request["etime"]; //结束时间
            int    paymode      = string.IsNullOrEmpty(Request["paymode"]) ? 0 : Int32.Parse(Request["paymode"]);                  //支付类型
            string paymentstate = string.IsNullOrEmpty(Request["paymentstate"]) ? "1" : Request["paymentstate"];                   //支付状态
            string noticestate  = string.IsNullOrEmpty(Request["noticestate"]) ? "" : Request["noticestate"];                      //通知状态
            int    relationtype = string.IsNullOrEmpty(Request["relationtype"]) ? 0 : Int32.Parse(Request["relationtype"]);        //商户类型
            int    userid       = UserInfo.UserId;
            var    list         = _OrderService.FindPagedListByBP(userid, relationtype, "", searchType, searchname, stime, etime, paymode, paymentstate, noticestate, null, pageIndexs, PageSize);
            var    gridModel    = new DataSource <jmp_order>(list)
            {
                Data = list.Select(x => x).ToList()
            };
            ViewBag.searchname   = searchname;
            ViewBag.searchType   = searchType;
            ViewBag.stime        = stime;
            ViewBag.etime        = etime;
            ViewBag.relationtype = relationtype;
            ViewBag.paymode      = paymode;
            ViewBag.paymentstate = paymentstate;
            ViewBag.noticestate  = noticestate;
            ViewBag.pageIndexs   = pageIndexs;
            ViewBag.PageSize     = PageSize;
            ViewBag.list         = gridModel.Data;
            ViewBag.pageCount    = gridModel.Pagination.TotalCount;
            #endregion
            return(View());
        }
Example #9
0
        public ActionResult PaymodeList()
        {
            #region 权限查询
            string locUrl = "";

            bool getUidT = bll_limit.GetLocUserLimitVoids("/System/UpdatePaymodeState", UserInfo.UserId.ToString(), int.Parse(UserInfo.UserRoleId.ToString()));//一键启用支付类型
            if (getUidT)
            {
                locUrl += "<li onclick=\"UpdatePaymodeState(1)\"><i class='fa fa-check-square-o'></i>一键解锁</li>";
            }
            bool getUidF = bll_limit.GetLocUserLimitVoids("/System/UpdatePaymodeState", UserInfo.UserId.ToString(), int.Parse(UserInfo.UserRoleId.ToString()));//一键禁用支付类型
            if (getUidF)
            {
                locUrl += "<li onclick=\"UpdatePaymodeState(0)\"><i class='fa fa-check-square-o'></i>一键锁定</li>";
            }
            ViewBag.locUrl = locUrl;
            #endregion
            #region 查询信息
            int    pageCount        = 0;
            int    pageIndexs       = string.IsNullOrEmpty(Request["pageIndexs"]) ? 1 : Int32.Parse(Request["pageIndexs"]); //当前页
            int    PageSize         = string.IsNullOrEmpty(Request["PageSize"]) ? 20 : Int32.Parse(Request["PageSize"]);    //每页显示数量
            string sql              = "select * from jmp_paymode where 1=1 ";
            JMP.BLL.jmp_paymode bll = new JMP.BLL.jmp_paymode();
            int searchDesc          = string.IsNullOrEmpty(Request["searchDesc"]) ? 0 : Int32.Parse(Request["searchDesc"]); //排序方式
            ViewBag.searchDesc = searchDesc;
            int SelectState = string.IsNullOrEmpty(Request["SelectState"]) ? -1 : Int32.Parse(Request["SelectState"]);      //状态
            ViewBag.SelectState = SelectState;
            int searchType = string.IsNullOrEmpty(Request["searchType"]) ? 0 : Int32.Parse(Request["searchType"]);          //查询条件选择
            ViewBag.searchType = searchType;
            string sea_name = string.IsNullOrEmpty(Request["sea_name"]) ? "" : Request["sea_name"];                         //查询条件内容
            ViewBag.sea_name = sea_name;
            if (searchType > 0 && !string.IsNullOrEmpty(sea_name))
            {
                switch (searchType)
                {
                case 1:
                    sql += " and p_id='" + sea_name + "' ";
                    break;

                case 2:
                    sql += " and p_name='" + sea_name + "' ";
                    break;
                }
            }
            if (SelectState > -1)
            {
                sql += " and p_state='" + SelectState + "' ";
            }
            string Order = " order by p_id desc ";
            if (searchDesc == 1)
            {
                Order = " order by p_id  ";
            }
            else
            {
                Order = " order by p_id desc ";
            }
            List <JMP.MDL.jmp_paymode> list = bll.SelectList(sql, Order, pageIndexs, PageSize, out pageCount);
            ViewBag.pageCount  = pageCount;
            ViewBag.pageIndexs = pageIndexs;
            ViewBag.PageSize   = PageSize;
            ViewBag.list       = list;
            #endregion
            return(View());
        }
Example #10
0
        public ActionResult OrderList()
        {
            #region 获取信息

            JMP.BLL.jmp_paymode        paymodebll  = new JMP.BLL.jmp_paymode();
            List <JMP.MDL.jmp_paymode> paymodeList = paymodebll.GetModelList("1=1 and p_state='1' ");//支付类型
            ViewBag.paymodeList = paymodeList;
            #endregion
            #region 查询
            string sql  = "";
            string sql1 = "";
            //组装查询条件
            string TableName    = "";                                                                                              //表名
            string order        = "o_ptime ";                                                                                      //排序字段
            int    pageCount    = 0;
            int    pageIndexs   = string.IsNullOrEmpty(Request["pageIndexs"]) ? 1 : Int32.Parse(Request["pageIndexs"]);            //当前页
            int    PageSize     = string.IsNullOrEmpty(Request["PageSize"]) ? 20 : Int32.Parse(Request["PageSize"]);               //每页显示数量
            int    searchType   = string.IsNullOrEmpty(Request["searchType"]) ? 0 : Int32.Parse(Request["searchType"]);            //查询条件选择
            string searchname   = string.IsNullOrEmpty(Request["searchname"]) ? "" : Request["searchname"];                        //查询类容
            string stime        = string.IsNullOrEmpty(Request["stime"]) ? DateTime.Now.ToString("yyyy-MM-dd") : Request["stime"]; //开始时间
            string etime        = string.IsNullOrEmpty(Request["etime"]) ? DateTime.Now.ToString("yyyy-MM-dd") : Request["etime"]; //结束时间
            int    paymode      = string.IsNullOrEmpty(Request["paymode"]) ? 0 : Int32.Parse(Request["paymode"]);                  //支付类型
            string paymentstate = string.IsNullOrEmpty(Request["paymentstate"]) ? "1" : Request["paymentstate"];                   //支付状态
            string noticestate  = string.IsNullOrEmpty(Request["noticestate"]) ? "" : Request["noticestate"];                      //通知状态
            int    platformid   = string.IsNullOrEmpty(Request["platformid"]) ? 0 : Int32.Parse(Request["platformid"]);            //关联平台
            int    relationtype = string.IsNullOrEmpty(Request["relationtype"]) ? -1 : Int32.Parse(Request["relationtype"]);       //商户类型

            ViewBag.platformid = platformid;
            ArrayList sjfw = JMP.TOOL.WeekDateTime.WeekMonday(DateTime.Parse(stime), DateTime.Parse(etime));//根据时间返回获取每周周一组装查询语句
            for (int i = 0; i < sjfw.Count; i++)
            {
                TableName = "jmp_order_" + DateTime.Parse(sjfw[i].ToString()).ToString("yyyyMMdd");
                // TableName = "jmp_order_20161107";
                sql += " SELECT o_id,o_code,o_bizcode,o_tradeno,o_paymode_id,o_app_id,o_goodsname,o_term_key,o_price,o_payuser,o_ctime,o_ptime,o_state,o_times,o_address,o_noticestate,o_noticetimes,o_privateinfo,o_interface_id, o_showaddress  FROM " + TableName + " where 1=1 ";
                if (!string.IsNullOrEmpty(stime) && !string.IsNullOrEmpty(etime))
                {
                    sql += " and convert(varchar(10),o_ptime,120)>='" + stime + "' and convert(varchar(10),o_ptime,120)<='" + etime + "' ";
                }
                if (paymode > 0)
                {
                    sql += " and o_paymode_id='" + paymode + "' ";
                }
                if (!string.IsNullOrEmpty(paymentstate))
                {
                    sql += " and o_state='" + paymentstate + "' ";
                }
                if (!string.IsNullOrEmpty(noticestate))
                {
                    sql += " and o_noticestate='" + noticestate + "' ";
                }
                sql += "    UNION ALL ";
            }
            string where = "where 1=1";//组装查询条件
            if (searchType > 0 && !string.IsNullOrEmpty(searchname))
            {
                switch (searchType)
                {
                case 1:
                    where += " and a.o_code='" + searchname + "' ";
                    break;

                case 2:
                    where += " and  b.a_name='" + searchname + "'   ";
                    break;

                case 3:
                    where += " and  a.o_goodsname='" + searchname + "' ";
                    break;

                case 4:
                    where += " and e.u_realname like '%" + searchname + "%' ";
                    break;

                case 5:
                    where += " and a.o_tradeno= '" + searchname + "' ";
                    break;

                case 6:
                    where += " and a.o_bizcode= '" + searchname + "' ";
                    break;

                case 7:
                    where += " and inn.l_corporatename like '%" + searchname + "%' ";
                    break;
                }
            }
            if (platformid > 0)
            {
                where += " and b.a_platform_id=" + platformid;
            }
            if (relationtype > -1)
            {
                where += " and e.relation_type=" + relationtype;
            }


            //组装时时表数据
            sql1 = "SELECT o_id,o_code,o_bizcode,o_tradeno,o_paymode_id,o_app_id,o_goodsname,o_term_key,o_price,o_payuser,o_ctime,o_ptime,o_state,o_times,o_address,o_noticestate,o_noticetimes,o_privateinfo,o_interface_id, o_showaddress FROM jmp_order where 1=1";
            if (!string.IsNullOrEmpty(stime) && !string.IsNullOrEmpty(etime))
            {
                sql1 += " and convert(varchar(10),o_ptime,120)>='" + stime + "' and convert(varchar(10),o_ptime,120)<='" + etime + "' ";
            }
            if (paymode > 0)
            {
                sql1 += " and o_paymode_id='" + paymode + "' ";
            }
            if (!string.IsNullOrEmpty(paymentstate))
            {
                sql1 += " and o_state='" + paymentstate + "' ";
            }
            if (!string.IsNullOrEmpty(noticestate))
            {
                sql1 += " and o_noticestate='" + noticestate + "' ";
            }
            sql = sql + sql1;
            ViewBag.searchname   = searchname;
            ViewBag.searchType   = searchType;
            ViewBag.stime        = stime;
            ViewBag.etime        = etime;
            ViewBag.paymode      = paymode;
            ViewBag.paymentstate = paymentstate;
            ViewBag.noticestate  = noticestate;
            List <JMP.MDL.jmp_order> list     = new List <JMP.MDL.jmp_order>();
            JMP.BLL.jmp_order        orderbll = new JMP.BLL.jmp_order();
            list = orderbll.SelectPager(where, sql, order, pageIndexs, PageSize, out pageCount);
            ViewBag.pageIndexs   = pageIndexs;
            ViewBag.PageSize     = PageSize;
            ViewBag.pageCount    = pageCount;
            ViewBag.list         = list;
            ViewBag.relationtype = relationtype;
            #endregion

            return(View());
        }
Example #11
0
        public ActionResult UpdateApp()
        {
            int appid = string.IsNullOrEmpty(Request["appid"]) ? 0 : Int32.Parse(Request["appid"]);

            JMP.BLL.jmp_app appbll = new JMP.BLL.jmp_app();
            JMP.MDL.jmp_app model  = new JMP.MDL.jmp_app();

            string yy = "";

            if (appid > 0)
            {
                model = appbll.SelectId(appid);
                #region =========获取应用平台在用信息=========
                JMP.BLL.jmp_platform        bll  = new JMP.BLL.jmp_platform();
                DataTable                   dt   = bll.GetList(" 1=1 and p_state='1' ").Tables[0];//获取应用平台在用信息
                List <JMP.MDL.jmp_platform> yypt = JMP.TOOL.MdlList.ToList <JMP.MDL.jmp_platform>(dt);
                ViewBag.glptdt = yypt;
                #endregion

                #region ========获取应用类型在用信息======
                JMP.BLL.jmp_apptype yybll = new JMP.BLL.jmp_apptype();
                string where = "  t_id in (select  DISTINCT(t_topid) from jmp_apptype where t_topid in( select t_id from jmp_apptype where t_topid='0'   )) and t_state='1' order by t_sort desc";
                DataTable           yydt   = yybll.GetList(where).Tables[0];//获取应用类型在用信息
                JMP.MDL.jmp_apptype models = new JMP.MDL.jmp_apptype();
                int t_topid = 0;
                if (model.a_apptype_id > 0)
                {
                    models  = yybll.GetModel(model.a_apptype_id);//查询单条信息
                    t_topid = models.t_topid;
                }
                string yyid = "";

                if (model.a_auditstate == 1)
                {
                    yy += "<select id='xzyylx' disabled ='disabled' > ";
                }
                else
                {
                    yy += "<select id='xzyylx' onclick='xzyylx()'> ";
                }

                for (int j = 0; j < yydt.Rows.Count; j++)
                {
                    yyid = yydt.Rows[j]["t_id"].ToString();
                    if (t_topid > 0)
                    {
                        if (Int32.Parse(yydt.Rows[j]["t_id"].ToString()) == models.t_topid)
                        {
                            yy += "<option value='" + yyid + "' selected=selected >" + yydt.Rows[j]["t_name"] + "</option>";
                        }
                        else
                        {
                            yy += "<option value='" + yyid + "' >" + yydt.Rows[j]["t_name"] + "</option>";
                        }
                    }
                    else
                    {
                        yy += "<option value='" + yyid + "' >" + yydt.Rows[j]["t_name"] + "</option>";
                    }
                }

                yy += "</select>";
                #endregion
            }
            int userid   = UserInfo.UserId;
            var userlist = _UserService.FindListBySql("relation_type='" + (int)Relationtype.Agent + "' and relation_person_id='" + userid + "' and u_state=1", "");

            ViewBag.userlist = userlist;

            #region 获取所有支付方式

            JMP.BLL.jmp_paymode zfbll = new JMP.BLL.jmp_paymode();

            DataTable zfdt = new DataTable();
            List <JMP.MDL.jmp_paymode> zflist = new List <JMP.MDL.jmp_paymode>();
            zfdt          = zfbll.GetList(" 1=1 and p_state='1' ").Tables[0];//获取支付类型在用信息
            zflist        = JMP.TOOL.MdlList.ToList <JMP.MDL.jmp_paymode>(zfdt);
            ViewBag.appid = appid;
            ViewBag.list  = zflist;
            #endregion

            ViewBag.yy    = yy;
            ViewBag.model = model;
            //支付方式
            string[] zffs = model.a_paymode_id.Split(',');
            ViewBag.zffs = zffs;
            return(View());
        }
Example #12
0
        /// <summary>
        /// 订单列表
        /// </summary>
        /// <returns></returns>
        public ActionResult OrderList()
        {
            #region 获取用户实名认证状态信息

            JMP.BLL.jmp_user sm_bll   = new JMP.BLL.jmp_user();
            JMP.MDL.jmp_user sm_model = new JMP.MDL.jmp_user();

            int u_ids = UserInfo.Uid;

            //查询登录信息
            sm_model = sm_bll.GetModel(u_ids);

            ViewBag.auditstate = sm_model.u_auditstate;
            ViewBag.linkEmail  = sm_model.u_email;

            #endregion

            #region 获取信息

            JMP.BLL.jmp_paymode        paymodebll  = new JMP.BLL.jmp_paymode();
            List <JMP.MDL.jmp_paymode> paymodeList = paymodebll.GetModelList("1=1 and p_state='1' ");//支付类型
            ViewBag.paymodeList = paymodeList;
            #endregion
            #region 查询
            //string sql = " select o_id,o_code,o_bizcode,o_tradeno,o_paymode_id,o_app_id,o_goods_id,o_term_key,o_price,o_payuser,o_ctime,o_ptime,o_state,o_times,o_address,o_noticestate,o_noticetimes,o_privateinfo,o_interface_id,o_showaddress,b.a_key,b.a_name,c.p_name,d.g_name from (  ";//组装查询条件
            string    sql          = "";
            string    sql1         = "";
            string    TableName    = "";                                                                                              //表名
            string    order        = "o_ptime";                                                                                       //排序字段
            int       pageCount    = 0;
            int       pageIndexs   = string.IsNullOrEmpty(Request["pageIndexs"]) ? 1 : Int32.Parse(Request["pageIndexs"]);            //当前页
            int       PageSize     = string.IsNullOrEmpty(Request["PageSize"]) ? 20 : Int32.Parse(Request["PageSize"]);               //每页显示数量
            int       searchType   = string.IsNullOrEmpty(Request["searchType"]) ? 0 : Int32.Parse(Request["searchType"]);            //查询条件选择
            string    searchname   = string.IsNullOrEmpty(Request["searchname"]) ? "" : Request["searchname"];                        //查询类容
            string    stime        = string.IsNullOrEmpty(Request["stime"]) ? DateTime.Now.ToString("yyyy-MM-dd") : Request["stime"]; //开始时间
            string    etime        = string.IsNullOrEmpty(Request["etime"]) ? DateTime.Now.ToString("yyyy-MM-dd") : Request["etime"]; //结束时间
            int       paymode      = string.IsNullOrEmpty(Request["paymode"]) ? 0 : Int32.Parse(Request["paymode"]);                  //支付类型
            string    paymentstate = string.IsNullOrEmpty(Request["paymentstate"]) ? "1" : Request["paymentstate"];                   //支付状态
            string    noticestate  = string.IsNullOrEmpty(Request["noticestate"]) ? "" : Request["noticestate"];                      //通知状态
            ArrayList sjfw         = JMP.TOOL.WeekDateTime.WeekMonday(DateTime.Parse(stime), DateTime.Parse(etime));                  //根据时间返回获取每周周一组装查询语句
            string where = "where 1=1";
            for (int i = 0; i < sjfw.Count; i++)
            {
                TableName = "jmp_order_" + DateTime.Parse(sjfw[i].ToString()).ToString("yyyyMMdd");
                // TableName = "jmp_order_20161107";
                sql += " SELECT o_id,o_code,o_bizcode,o_tradeno,o_paymode_id,o_app_id,o_goodsname,o_term_key,o_price,o_payuser,o_ctime,o_ptime,o_state,o_times,o_address,o_noticestate,o_noticetimes,o_privateinfo,o_interface_id,o_showaddress FROM " + TableName + " where 1=1 ";
                if (!string.IsNullOrEmpty(stime) && !string.IsNullOrEmpty(etime))
                {
                    sql += " and convert(varchar(10),o_ptime,120)>='" + stime + "' and convert(varchar(10),o_ptime,120)<='" + etime + "' ";
                }
                if (paymode > 0)
                {
                    sql += " and o_paymode_id='" + paymode + "' ";
                }
                if (!string.IsNullOrEmpty(paymentstate))
                {
                    sql += " and o_state='" + paymentstate + "' ";
                }
                if (!string.IsNullOrEmpty(noticestate))
                {
                    sql += " and o_noticestate='" + noticestate + "' ";
                }
                sql += "    UNION ALL ";
            }
            if (searchType > 0 && !string.IsNullOrEmpty(searchname))
            {
                switch (searchType)
                {
                case 1:
                    where += " and a.o_code='" + searchname + "' ";
                    break;

                case 2:
                    where += " and  b.a_name='" + searchname + "'   ";
                    break;

                case 3:
                    where += " and  a.o_goodsname='" + searchname + "' ";
                    break;

                case 4:
                    where += " and a.o_tradeno= '" + searchname + "' ";
                    break;

                case 5:
                    where += " and a.o_bizcode like '%" + searchname + "%' ";
                    break;
                }
            }
            where += "and b.a_user_id='" + UserInfo.UserId + "'";
            //sql = sql.Remove(sql.Length - 10);//去掉最后一个UNION ALL
            //sql += " ) a   left join jmp_app  b on  a.o_app_id=b.a_id left join jmp_paymode c on c.p_id=a.o_paymode_id  left join jmp_goods d on d.g_id=a.o_goods_id and d.g_app_id=b.a_id and d.g_app_id=a.o_app_id where 1=1  and  " + where;
            //组装时时表数据
            sql1 = "SELECT o_id,o_code,o_bizcode,o_tradeno,o_paymode_id,o_app_id,o_goodsname,o_term_key,o_price,o_payuser,o_ctime,o_ptime,o_state,o_times,o_address,o_noticestate,o_noticetimes,o_privateinfo,o_interface_id, o_showaddress FROM jmp_order where 1=1";
            if (!string.IsNullOrEmpty(stime) && !string.IsNullOrEmpty(etime))
            {
                sql1 += " and convert(varchar(10),o_ptime,120)>='" + stime + "' and convert(varchar(10),o_ptime,120)<='" + etime + "' ";
            }
            if (paymode > 0)
            {
                sql1 += " and o_paymode_id='" + paymode + "' ";
            }
            if (!string.IsNullOrEmpty(paymentstate))
            {
                sql1 += " and o_state='" + paymentstate + "' ";
            }
            if (!string.IsNullOrEmpty(noticestate))
            {
                sql1 += " and o_noticestate='" + noticestate + "' ";
            }
            sql = sql + sql1;
            ViewBag.searchname   = searchname;
            ViewBag.searchType   = searchType;
            ViewBag.stime        = stime;
            ViewBag.etime        = etime;
            ViewBag.paymode      = paymode;
            ViewBag.paymentstate = paymentstate;
            ViewBag.noticestate  = noticestate;
            List <JMP.MDL.jmp_order> list     = new List <JMP.MDL.jmp_order>();
            JMP.BLL.jmp_order        orderbll = new JMP.BLL.jmp_order();
            list = orderbll.SelectPager(where, sql, order, pageIndexs, PageSize, out pageCount);
            ViewBag.pageIndexs = pageIndexs;
            ViewBag.PageSize   = PageSize;
            ViewBag.pageCount  = pageCount;
            ViewBag.list       = list;
            #endregion
            return(View());
        }