Example #1
0
        public string GetParent(int sid)
        {
            List <Lebi_Supplier_Menu> ps = B_Lebi_Supplier_Menu.GetList("parentid=0", "Sort desc");
            string str = "";

            foreach (Lebi_Supplier_Menu p in ps)
            {
                string sel = "";
                if (p.id == sid)
                {
                    sel = "selected";
                }
                str += "<option value=" + p.id + "  " + sel + ">" + p.Name + "</option>";

                List <Lebi_Supplier_Menu> ss = B_Lebi_Supplier_Menu.GetList("parentid=" + p.id + "", "Sort desc");
                foreach (Lebi_Supplier_Menu s in ss)
                {
                    sel = "";
                    if (s.id == sid)
                    {
                        sel = "selected";
                    }
                    str += "<option value=" + s.id + "  " + sel + "> - " + s.Name + "</option>";
                }
            }
            return(str);
        }
Example #2
0
        /// <summary>
        /// 删除一个菜单
        /// </summary>
        public void Menu_Del()
        {
            if (!EX_Admin.Power("supplier_group_edit", "编辑商家分组"))
            {
                AjaxNoPower();
                return;
            }
            int id = RequestTool.RequestInt("id", 0);
            Lebi_Supplier_Menu model = B_Lebi_Supplier_Menu.GetModel(id);

            if (model == null)
            {
                Response.Write("{\"msg" + Tag("参数错误") + "\"}");
                return;
            }
            else
            {
                if (model.IsSYS == 0)
                {
                    B_Lebi_Supplier_Menu.Delete(id);
                }
            }
            string action = Tag("删除菜单");

            Log.Add(action, "Supplier_Menu", id.ToString(), CurrentAdmin, "");
            Response.Write("{\"msg\":\"OK\"}");
        }
Example #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("supplier_menu_edit", "编辑菜单"))
            {
                WindowNoPower();
            }
            int id  = RequestTool.RequestInt("id", 0);
            int pid = RequestTool.RequestInt("pid", 0);

            model = B_Lebi_Supplier_Menu.GetModel(id);
            if (model == null)
            {
                model          = new Lebi_Supplier_Menu();
                model.parentid = pid;
                model.Isshow   = 1;
            }
            else
            {
                pid = model.parentid;
            }
            pmodel = B_Lebi_Supplier_Menu.GetModel(pid);
            if (pmodel == null)
            {
                pmodel      = new Lebi_Supplier_Menu();
                pmodel.Name = "-";
            }
        }
Example #4
0
        /// <summary>
        /// 编辑后台菜单
        /// </summary>
        public void Menu_Edit()
        {
            if (!EX_Admin.Power("supplier_menu_edit", "编辑菜单"))
            {
                EX_Admin.NoPower();
            }
            int id  = RequestTool.RequestInt("id", 0);
            int pid = RequestTool.RequestInt("pid", 0);
            Lebi_Supplier_Menu model = B_Lebi_Supplier_Menu.GetModel(id);

            if (model == null)
            {
                model = new Lebi_Supplier_Menu();
                B_Lebi_Supplier_Menu.BindForm(model);
                model.Isshow = 1;
                B_Lebi_Supplier_Menu.Add(model);
            }
            else
            {
                B_Lebi_Supplier_Menu.BindForm(model);
                B_Lebi_Supplier_Menu.Update(model);
            }
            ImageHelper.LebiImagesUsed(model.Image, "menu", id);
            string action = Tag("编辑菜单");

            Log.Add(action, "Supplier_Menu", id.ToString(), CurrentAdmin, model.Name);
            Response.Write("{\"msg\":\"OK\"}");
        }
Example #5
0
        public List <Lebi_Supplier_Menu> Supplier_GetMenus(int pid)
        {
            string menu_ids = "";

            if (CurrentSupplierUserGroup != null && CurrentSupplierUser.User_id != CurrentSupplier.User_id)
            {
                menu_ids = CurrentSupplierUserGroup.Menu_ids;
            }
            else
            {
                CurrentSupplierGroup = B_Lebi_Supplier_Group.GetModel(CurrentSupplier.Supplier_Group_id);
                if (CurrentSupplierGroup != null)
                {
                    menu_ids = CurrentSupplierGroup.Menu_ids;
                }
            }
            AllMenus = new List <Lebi_Supplier_Menu>();
            List <Lebi_Supplier_Menu> All = B_Lebi_Supplier_Menu.GetList("Isshow=1", "Sort desc");
            string currentgroupmenu       = "," + menu_ids + ",";

            foreach (Lebi_Supplier_Menu m in All)
            {
                if (currentgroupmenu.Contains("," + m.id + ","))
                {
                    AllMenus.Add(m);
                }
            }
            List <Lebi_Supplier_Menu> menus = (from m in AllMenus
                                               where m.parentid == pid
                                               select m).ToList();

            return(menus);
        }
Example #6
0
        public List <Lebi_Supplier_Menu> GetMenu(int pid)
        {
            string where = "";
            where        = "parentid=" + pid + " and Isshow=1";
            List <Lebi_Supplier_Menu> ls = B_Lebi_Supplier_Menu.GetList(where, "Sort desc");

            if (ls == null)
            {
                ls = new List <Lebi_Supplier_Menu>();
            }
            return(ls);
        }
Example #7
0
        public List <Lebi_Supplier_Menu> GetMenu(int pid)
        {
            CurrentSupplierGroup.Menu_ids = CurrentSupplierGroup.Menu_ids == "" ? "0" : CurrentSupplierGroup.Menu_ids;
            string where = "";
            where        = "parentid=" + pid + " and Isshow=1 and id in (" + CurrentSupplierGroup.Menu_ids + ")";
            List <Lebi_Supplier_Menu> ls = B_Lebi_Supplier_Menu.GetList(where, "Sort desc");

            if (ls == null)
            {
                ls = new List <Lebi_Supplier_Menu>();
            }
            return(ls);
        }
Example #8
0
        /// <summary>
        /// 头部菜单跳转
        /// </summary>
        /// <param name="pid"></param>
        public void MenuJump()
        {
            int pid = RequestTool.RequestInt("pid", 0);

            if (pid == 0)
            {
                ////前往快捷桌面菜单
                //if (EX_Admin.Power("admin_data", "系统桌面"))
                //{
                //    Response.Redirect(AdminMenuURL("default.aspx?desk=1"));
                //}
                if (CurrentAdminGroup.Menu_ids_index != "")
                {
                    List <Lebi_Supplier_Menu> ims = B_Lebi_Supplier_Menu.GetList("id in (" + CurrentAdminGroup.Menu_ids_index + ")", "Sort desc");
                    foreach (Lebi_Supplier_Menu im in ims)
                    {
                        if (im.URL.Contains("?"))
                        {
                            im.URL = im.URL + "&desk=1";
                        }
                        else
                        {
                            im.URL = im.URL + "?desk=1";
                        }
                        Response.Redirect(AdminMenuURL(im.URL));
                        return;
                    }
                }
            }
            string currentgroupmenu      = "," + CurrentAdminGroup.Menu_ids + ",";
            List <Lebi_Supplier_Menu> ms = B_Lebi_Supplier_Menu.GetList("parentid=" + pid + "", "Sort desc");

            foreach (Lebi_Supplier_Menu m in ms)
            {
                if (CurrentAdmin.AdminType == "super")
                {
                    List <Lebi_Supplier_Menu> models = B_Lebi_Supplier_Menu.GetList("parentid=" + m.id + "", "Sort desc");
                    foreach (Lebi_Supplier_Menu model in models)
                    {
                        Response.Redirect(AdminMenuURL(model.URL));
                        return;
                    }
                }
                else
                {
                    if (currentgroupmenu.Contains("," + m.id + ","))
                    {
                        List <Lebi_Supplier_Menu> models = B_Lebi_Supplier_Menu.GetList("parentid=" + m.id + "", "Sort desc");
                        foreach (Lebi_Supplier_Menu model in models)
                        {
                            if (currentgroupmenu.Contains("," + model.id + ","))
                            {
                                Response.Redirect(AdminMenuURL(model.URL));
                                return;
                            }
                        }
                    }
                }
            }
            Response.Write(Tag("菜单设置错误"));
        }