Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 3
0
        public static Lebi_Agent_User User_Commission(int id)
        {
            Lebi_Agent_User model = B_Lebi_Agent_User.GetModel("User_id = " + id + "");

            if (model == null)
            {
                model = new Lebi_Agent_User();
                model.Angent1_Commission = -1;
                model.Angent2_Commission = -1;
                model.Angent3_Commission = -1;
            }
            return(model);
        }
Exemplo n.º 4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!EX_Admin.Power("agent_config", "代理-参数设置"))
     {
         WindowNoPower();
     }
     id    = RequestTool.RequestInt("id", 0);
     model = B_Lebi_Agent_User.GetModel("User_id = " + id + "");
     if (model == null)
     {
         model = new Lebi_Agent_User();
         model.Angent1_Commission = -1;
         model.Angent2_Commission = -1;
         model.Angent3_Commission = -1;
     }
 }
Exemplo n.º 5
0
        protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode)
        {
            if (!Shop.LebiAPI.Service.Instanse.Check("plugin_agent"))
            {
                Response.Write(Tag("权限不足"));
                Response.End();
            }
            if (CurrentUser.id == 0)
            {
                Response.Redirect(URL("P_Login", "" + HttpUtility.UrlEncode(RequestTool.GetRequestUrlNonDomain()) + "," + GetUrlToken(RequestTool.GetRequestUrlNonDomain()) + ""));
            }
            BaseConfig bc = ShopCache.GetBaseConfig();

            LoadTheme(themecode, siteid, languagecode, pcode);
            path = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">&raquo;</em><a href=\"" + URL("P_UserCenter", "") + "\"><span>" + Tag("会员中心") + "</span></a><em>&raquo;</em><a class=\"text\"><span>" + Tag("推广佣金") + "</span></a>";
            decimal.TryParse(bc.Angent1_Commission, out Angent1_Commission);
            decimal.TryParse(bc.Angent2_Commission, out Angent2_Commission);
            Lebi_Agent_User agent_user = B_Lebi_Agent_User.GetModel("User_id = " + CurrentUser.id + "");

            if (agent_user != null)
            {
                if (agent_user.Angent1_Commission != -1)
                {
                    Angent1_Commission = agent_user.Angent1_Commission;
                }
                if (agent_user.Angent2_Commission != -1)
                {
                    Angent2_Commission = agent_user.Angent2_Commission;
                }
            }
            Lebi_Agent_User agent_userlevel = B_Lebi_Agent_User.GetModel("User_id = " + CurrentUser.UserLevel_id + "");

            if (agent_userlevel != null)
            {
                if (agent_userlevel.Angent1_Commission != -1)
                {
                    Angent1_Commission = agent_userlevel.Angent1_Commission;
                }
                if (agent_userlevel.Angent2_Commission != -1)
                {
                    Angent2_Commission = agent_userlevel.Angent2_Commission;
                }
            }
        }