예제 #1
0
        /// <summary>
        /// 删除会员分组
        /// </summary>
        public void Group_Del()
        {
            string id = RequestTool.RequestString("id");

            if (!EX_Admin.Power("supplier_group_del", "删除商家分组"))
            {
                AjaxNoPower();
                return;
            }
            if (id != "")
            {
                List <Lebi_Supplier_Group> models = B_Lebi_Supplier_Group.GetList("id in (lbsql{" + id + "})", "");
                foreach (Lebi_Supplier_Group model in models)
                {
                    int Level_id = 1;
                    Lebi_Supplier_Group tmodel = B_Lebi_Supplier_Group.GetModel("Grade>" + model.Grade + " order by Grade asc");
                    if (tmodel == null)
                    {
                        Level_id = 1;
                    }
                    else
                    {
                        Level_id = tmodel.id;
                    }
                    Common.ExecuteSql("Update Lebi_Supplier set Supplier_Group_id = " + Level_id + " where Supplier_Group_id = " + model.id + "");
                    //}->
                    B_Lebi_Supplier_Group.Delete(model.id);
                }
                Log.Add("删除商家分组", "Supplier_Group", id.ToString(), CurrentAdmin, id.ToString());
            }
            Response.Write("{\"msg\":\"OK\"}");
        }
예제 #2
0
        /// <summary>
        /// 返回供应商分组名称
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public string GroupName(int id)
        {
            if (type == "")
            {
                type = "supplier";
            }
            List <Lebi_Supplier_Group> levels = B_Lebi_Supplier_Group.GetList("type=lbsql{'" + type + "'}", "Grade asc");
            Lebi_Supplier_Group        group  = B_Lebi_Supplier_Group.GetModel(id);

            if (group == null)
            {
                return("");
            }
            return(Lang(group.Name));
        }
예제 #3
0
        public string GroupOption(int id)
        {
            string str = "";
            List <Lebi_Supplier_Group> models = B_Lebi_Supplier_Group.GetList("IsShow=1 and type='" + logintype + "'", "");

            foreach (Lebi_Supplier_Group model in models)
            {
                string sel = "";
                if (id == model.id)
                {
                    sel = "selected";
                }
                str += "<option value=\"" + model.id + "\" " + sel + " vids=\"" + model.Verified_ids + "\">" + Lang(model.Name) + "</option>";
            }
            return(str);
        }
예제 #4
0
        public string LevelOption(int level_id)
        {
            if (type == "")
            {
                type = "supplier";
            }
            List <Lebi_Supplier_Group> levels = B_Lebi_Supplier_Group.GetList("type=lbsql{'" + type + "'}", "Grade asc");
            string str = "";

            foreach (Lebi_Supplier_Group level in levels)
            {
                string sel = "";
                if (level_id == level.id)
                {
                    sel = "selected";
                }
                str += "<option value=\"" + level.id + "\" " + sel + " days=\"" + level.ServiceDays + "\">" + Shop.Bussiness.Language.Content(level.Name, CurrentLanguage) + "</option>";
            }
            return(str);
        }
예제 #5
0
        public string Supplier_GroupOption(string level_id, string lang)
        {
            if (lang == "")
            {
                lang = CurrentLanguage.Code;
            }
            if (type == "")
            {
                type = "supplier";
            }
            List <Lebi_Supplier_Group> levels = B_Lebi_Supplier_Group.GetList("type=lbsql{'" + type + "'}", "Grade asc");
            string str = "";

            foreach (Lebi_Supplier_Group level in levels)
            {
                string sel = "";
                if (level_id == "" + level.id + "")
                {
                    sel = "selected";
                }
                str += "<option value=\"" + level.id + "\" " + sel + ">" + Shop.Bussiness.Language.Content(level.Name, lang) + "</option>";
            }
            return(str);
        }
예제 #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("supplier_group_list", "商家分组列表"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }

            PageSize     = RequestTool.getpageSize(25);
            key          = RequestTool.RequestString("key");
            type         = RequestTool.RequestString("type");
            string where = "1=1";
            if (key != "")
            {
                where += " and Name like lbsql{'%" + key + "%'}";
            }
            if (type != "")
            {
                where += " and type=lbsql{'" + type + "'}";
            }
            models = B_Lebi_Supplier_Group.GetList(where, "Grade asc", PageSize, page);
            int recordCount = B_Lebi_Supplier_Group.Counts(where);

            PageString = Pager.GetPaginationString("?page={0}&key=" + key, page, PageSize, recordCount);
        }