예제 #1
0
        public UserModelPack GetPDAMenu(WcsRole role)
        {
            UserModelPack     pack  = new UserModelPack();
            List <ModuleView> menus = new List <ModuleView>();

            List <WcsMenuDtl> usermenus = MenuDtlList.FindAll(c => c.rf && c.menu_id == role.menu_id);

            if (usermenus.Count > 0)
            {
                usermenus.Sort((x, y) => x.order.CompareTo(y.order));
                foreach (WcsMenuDtl item in usermenus)
                {
                    WcsModule md = GetModule(item.module_id);
                    if (md != null && md.ModuleType == WcsModuleTypeE.平板)
                    {
                        menus.Add(new ModuleView()
                        {
                            ModuleName  = item.name,
                            ModuleId    = md.key,
                            ModulePic   = md.geometry,
                            ModuleEntry = md.entity
                        });
                    }
                }
            }
            pack.AddModule(menus);
            return(pack);
        }
예제 #2
0
        public string GetModuleInfo(int module_id)
        {
            WcsModule md = GetModule(module_id);

            if (md != null)
            {
                return(md.name + " : " + md.memo);
            }

            return("找不到模块配置信息:" + module_id);;
        }
예제 #3
0
        public MenuModel GetMenu(int id, bool getrf = false)
        {
            MenuModel  menu = new MenuModel();
            WcsMenuDtl dtl  = GetMenuDtl(id);

            if (dtl != null && (!dtl.rf || getrf))
            {
                menu.Id       = dtl.id;
                menu.FolderId = dtl.folder_id;
                menu.Name     = dtl.name;
                menu.OpenPage = !dtl.folder;
                menu.ModuleId = dtl.module_id;
                menu.MenuId   = dtl.menu_id;
                menu.Rf       = dtl.rf;
                if (!dtl.folder)
                {
                    WcsModule md = GetModule(dtl.module_id);
                    if (md != null)
                    {
                        menu.IKey = md.key;
                    }
                    else
                    {
                        menu.IKey = "没有配置菜单IKEY";
                    }
                }
                else
                {
                    List <WcsMenuDtl> dtls = GetMenuDtls(dtl.id);
                    if (dtls.Count > 0)
                    {
                        dtls.Sort((x, y) => x.order.CompareTo(y.order));
                    }

                    foreach (var item in dtls)
                    {
                        menu.AddMenu(GetMenu(item.id));
                    }
                }

                return(menu);
            }
            return(null);
        }