Beispiel #1
0
        /// <summary>
        /// 编辑会员推广佣金比例
        /// </summary>
        public void User_Edit()
        {
            if (!EX_Admin.Power("agent_config", "代理-参数设置"))
            {
                AjaxNoPower();
                return;
            }
            int             id    = RequestTool.RequestInt("id", 0);
            Lebi_Agent_User model = B_Lebi_Agent_User.GetModel("User_id = " + id + "");

            if (model == null)
            {
                model = new Lebi_Agent_User();
            }
            B_Lebi_Agent_User.SafeBindForm(model);
            if (model.id == 0)
            {
                model.User_id = id;
                B_Lebi_Agent_User.Add(model);
                Log.Add("添加会员推广佣金比例", "Agent_User", id.ToString(), CurrentAdmin, "");
            }
            else
            {
                B_Lebi_Agent_User.Update(model);
                Log.Add("编辑会员推广佣金比例", "Agent_User", id.ToString(), CurrentAdmin, "");
            }
            string result = "{\"msg\":\"OK\", \"id\":\"" + id + "\"}";

            Response.Write(result);
        }
Beispiel #2
0
        /// <summary>
        /// 批量编辑会员推广佣金比例
        /// </summary>
        public void User_Update()
        {
            if (!EX_Admin.Power("agent_config", "代理-参数设置"))
            {
                AjaxNoPower();
                return;
            }
            string           ids   = RequestTool.RequestSafeString("id");
            List <Lebi_User> lists = B_Lebi_User.GetList("id in (lbsql{" + ids + "})", "");

            foreach (Lebi_User list in lists)
            {
                Lebi_Agent_User model = B_Lebi_Agent_User.GetModel("User_id = " + list.id + "");
                if (model == null)
                {
                    model = new Lebi_Agent_User();
                }
                B_Lebi_Agent_User.SafeBindForm(model);
                if (model.id == 0)
                {
                    model.User_id = list.id;
                    B_Lebi_Agent_User.Add(model);
                    Log.Add("添加会员推广佣金比例", "Agent_User", list.id.ToString(), CurrentAdmin, "");
                }
                else
                {
                    B_Lebi_Agent_User.Update(model);
                    Log.Add("编辑会员推广佣金比例", "Agent_User", list.id.ToString(), CurrentAdmin, "");
                }
            }
            string result = "{\"msg\":\"OK\", \"id\":\"" + ids + "\"}";

            Response.Write(result);
        }