Exemple #1
0
        public JsonResult Inserkl()
        {
            object retJson = new { success = 0, msg = "操作失败!" };
            string str     = string.IsNullOrEmpty(Request["str"]) ? "" : Request["str"];
            int    appid   = string.IsNullOrEmpty(Request["appid"]) ? 0 : Int32.Parse(Request["appid"]);

            JMP.BLL.jmp_apprate bll = new jmp_apprate();
            if (appid > 0 && !string.IsNullOrEmpty(str))
            {
                string   sql = " delete from jmp_apprate where  r_appid=" + appid;
                string[] sxf = str.Split('|');
                string[] lis = new string[sxf.Length + 1];
                lis[0] = sql;
                int a = 1;
                for (int i = 0; i < sxf.Length; i++)
                {
                    string[] bl = sxf[i].Split(',');
                    lis[a] = " insert into jmp_apprate(r_appid,r_paymodeid,r_proportion,r_state,r_time,r_name) values(" + appid + "," + bl[0] + "," + bl[1] + ",0,GETDATE(),'" + UserInfo.UserName + "') ";
                    sql   += " insert into jmp_apprate(r_appid,r_paymodeid,r_proportion,r_state,r_time,r_name) values(" + appid + "," + bl[0] + "," + bl[1] + ",0,GETDATE(),'" + UserInfo.UserName + "'); ";
                    a      = a + 1;
                }
                int cg = bll.InserSxF(lis);
                if (cg > 0)
                {
                    retJson = new { success = 1, msg = "设置成功!" };

                    Logger.OperateLog("通道费率设置扣量比例", "操作数据:" + sql);
                }
                else
                {
                    retJson = new { success = 0, msg = "设置失败!" };
                }
            }
            return(Json(retJson));
        }
Exemple #2
0
        public ActionResult AppKl()
        {
            int appid = string.IsNullOrEmpty(Request["appid"]) ? 0 : Int32.Parse(Request["appid"]);
            List <JMP.MDL.jmp_apprate> list = new List <JMP.MDL.jmp_apprate>();

            JMP.BLL.jmp_apprate bll = new jmp_apprate();
            if (appid > 0)
            {
                list = bll.SelectListAppid(appid);
            }
            ViewBag.list  = list;
            ViewBag.appid = appid;
            return(View());
        }
Exemple #3
0
        /// <summary>
        /// 根据应用id和支付类型查询是否设置费率
        /// </summary>
        /// <param name="appid">应用id</param>
        /// <param name="paytype">支付类型</param>
        /// <param name="CacheTime">缓存时间</param>
        /// <returns></returns>
        public bool SelectApprate(int appid, int paytype, int CacheTime)
        {
            bool ISZero = false;

            JMP.BLL.jmp_apprate bll = new JMP.BLL.jmp_apprate();
            string CacheName        = "CacheName" + appid + paytype;

            JMP.MDL.jmp_apprate jmp_Apprate = new jmp_apprate();
            if (JMP.TOOL.CacheHelper.IsCache(CacheName))
            {
                jmp_Apprate = JMP.TOOL.CacheHelper.GetCaChe <JMP.MDL.jmp_apprate>(CacheName);
                if (jmp_Apprate != null)
                {
                    if (jmp_Apprate.r_proportion > 0)
                    {
                        ISZero = true;
                    }
                    else
                    {
                        jmp_Apprate = bll.SelectAppidState(appid, paytype);
                        if (jmp_Apprate != null)
                        {
                            if (jmp_Apprate.r_proportion > 0)
                            {
                                ISZero = true;
                            }
                            JMP.TOOL.CacheHelper.CacheObjectLocak <JMP.MDL.jmp_apprate>(jmp_Apprate, CacheName, CacheTime);//存入缓存
                        }
                    }
                }
            }
            else
            {
                jmp_Apprate = bll.SelectAppidState(appid, paytype);
                if (jmp_Apprate != null)
                {
                    if (jmp_Apprate.r_proportion > 0)
                    {
                        ISZero = true;
                    }
                    JMP.TOOL.CacheHelper.CacheObjectLocak <JMP.MDL.jmp_apprate>(jmp_Apprate, CacheName, CacheTime);//存入缓存
                }
            }
            return(ISZero);
        }