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);
        }
Beispiel #2
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);
        }
        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);
        }
Beispiel #4
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);
        }
Beispiel #5
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("菜单设置错误"));
        }