コード例 #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     MenuItem1.Initialize("My Caseload", "MenuItem1", "160px");
     MenuItem2.Initialize("Report", "MenuItem2", "160px");
     MenuItem3.Initialize("Logout", "MenuItem3", "160px");
     MenuItem4.Initialize("My EEC Apps", "MenuItem4", "160px");
     //MenuItem2.Initialize("Menu 2", "MenuItem2", "110px");
     //MenuItem3.Initialize("Menu 3", "MenuItem3", "110px");
     //MenuItem4.Initialize("Menu 4", "MenuItem4", "110px");
     //MenuItem5.Initialize("Menu 5", "MenuItem5", "110px");
 }
コード例 #2
0
        private List <MenuItem2> ReadTables2(DataTable dataTable)
        {
            List <MenuItem2> items = new List <MenuItem2>();

            foreach (DataRow dr in dataTable.Rows)
            {
                MenuItem2 item = new MenuItem2()
                {
                    ID       = (int)dr["menuItemID"],
                    ItemNaam = (string)dr["omschrijving"],
                    Prijs    = (decimal)dr["prijs"],
                    Aantal   = (int)dr["aantal"],
                    menu     = (int)dr["menu"],
                };
                items.Add(item);
            }
            return(items);
        }
コード例 #3
0
 public List <MenuItem2> GetMenuItems()
 {
     try
     {
         List <MenuItem2> item = menuItem.GetMenuItems();
         return(item);
     }
     catch (Exception e)
     {
         MessageBox.Show("Chapoo couldn't connect to the database " + e.Message);
         List <MenuItem2> werknemers = new List <MenuItem2>();
         MenuItem2        item       = new MenuItem2();
         item.ID       = 1;
         item.Aantal   = 0;
         item.ItemNaam = "menuItem";
         item.Prijs    = 1.0M;
         item.menu     = 1;
         werknemers.Add(item);
         return(werknemers);
     }
 }
コード例 #4
0
ファイル: AdminMenu.cs プロジェクト: jangocheng/SchoolWeb
        public void BuildNavigation(string name, NavigationBuilder builder)
        {
            if (!String.Equals(name, "admin", StringComparison.OrdinalIgnoreCase))
            {
                return;
            }

            var AdminMenu = _session.Query <ContentItem>().ListAsync().Result.Where(x => x.ContentType == "Menu" && x.Latest && x.As <TitlePart>().Title == "AdminMenu");

            if (AdminMenu.Count() == 1)
            {
                ContentItem AdminMenuItem = AdminMenu.First();
                var         Menu          = AdminMenuItem.As <MenuItemsListPart>().MenuItems;
                foreach (var MenuItem in Menu)
                {
                    string AAA  = MenuItem.Content.ToString();
                    var    Name = MenuItem.As <LinkMenuItemPart>().Name;
                    var    Url  = MenuItem.As <LinkMenuItemPart>().Url;
                    builder
                    .Add(T[Name], "2", contentParts => contentParts
                         .Action("List", "Admin", new { area = "NewsManage", ModelName = Url })
                         .Permission(Permissions.NewManage)
                         .LocalNav()
                         );
                    if (AAA.Contains("MenuItemsListPart") && MenuItem.As <MenuItemsListPart>().MenuItems.Count != 0)
                    {
                        var MenuChildren = MenuItem.As <MenuItemsListPart>().MenuItems;
                        foreach (var MenuItem1 in MenuChildren)
                        {
                            string AAA1  = MenuItem1.Content.ToString();
                            var    Name2 = MenuItem1.As <LinkMenuItemPart>().Name;
                            var    Url2  = MenuItem1.As <LinkMenuItemPart>().Url;
                            builder
                            .Add(T[Name], "2", contentParts => contentParts
                                 .Action("List", "Admin", new { area = "NewsManage", ModelName = Url })
                                 .Permission(Permissions.NewManage)
                                 .Add(T[Name2], "2", conParts => conParts
                                      .Action("List", "Admin", new { area = "NewsManage", ModelName = Url2 })
                                      .Permission(Permissions.NewManage)
                                      ));
                            if (AAA1.Contains("MenuItemsListPart") && MenuItem1.As <MenuItemsListPart>().MenuItems.Count != 0)
                            {
                                var MenuChildren1 = MenuItem.As <MenuItemsListPart>().MenuItems;
                                foreach (var MenuItem2 in MenuChildren1)
                                {
                                    string AAA2  = MenuItem2.Content.ToString();
                                    var    Name3 = MenuItem2.As <LinkMenuItemPart>().Name;
                                    var    Url3  = MenuItem2.As <LinkMenuItemPart>().Url;
                                    builder
                                    .Add(T[Name], "2", contentParts => contentParts
                                         .Action("List", "Admin", new { area = "NewsManage", ModelName = Url })
                                         .Permission(Permissions.NewManage)
                                         .Add(T[Name2], "2", conParts => conParts
                                              .Action("List", "Admin", new { area = "NewsManage", ModelName = Url2 })
                                              .Permission(Permissions.NewManage)
                                              .Add(T[Name3], "2", conarts => conarts
                                                   .Action("List", "Admin", new { area = "NewsManage", ModelName = Url3 })
                                                   .Permission(Permissions.NewManage)
                                                   )));
                                    if (AAA2.Contains("MenuItemsListPart") && MenuItem2.As <MenuItemsListPart>().MenuItems.Count != 0)
                                    {
                                        builder
                                        .Add(T["导航添加出错"], "5", contentParts => contentParts
                                             .Action("AdminMenuError", "Admin", new { area = "NewsManage" })
                                             .Permission(Permissions.NewManage)
                                             .LocalNav()
                                             );
                                    }
                                    else
                                    {
                                    }
                                }
                            }
                            else
                            {
                            }
                        }
                    }
                    else
                    {
                    }
                }
            }
            else
            {
                var contentItem = _session.Query <ContentItem>().ListAsync().Result.Where(x => x.ContentType == "新闻组管理" && x.Latest);
                if (contentItem.Count() != 0)
                {
                    foreach (var item in contentItem)
                    {
                        var NewDisplayName = item.As <NewPart>().NewDisplayName;
                        var Name           = item.As <NewPart>().Name;
                        builder.Add(T["新闻组管理"], index => index
                                    .Add(T[NewDisplayName], "3", contentParts => contentParts
                                         .Permission(Permissions.NewManage)
                                         .Action("List", "Admin", new { area = "NewsManage", ModelName = Name }))
                                    );
                        builder
                        .Add(T["编辑管理"], index => index
                             .Add(T[NewDisplayName], "3", contentParts => contentParts
                                  .Permission(Permissions.NewEditor)
                                  .Action("List", "Admin", new { area = "NewsManage", ModelName = Name }))
                             );
                    }
                }
            }

            builder
            .Add(T["新闻组管理"], index => index
                 .Add(T["添加新闻类型"], "1", Top => Top
                      .Permission(Permissions.NewManage)
                      .Action("NewManage", "Admin", new { area = "NewsManage" }))
                 );
            builder
            .Add(T["查看新闻"], index => index
                 .Permission(Permissions.NewManage)
                 .Action("ReleaseManage", "Admin", new { area = "NewsManage" })
                 );
            //builder.
            //    Add(T["新闻模块初始化"], initialSetup => initialSetup
            //        .Permission(Permissions.NewManage)
            //        .Action("NewSetup", "InitialSetup", new { area = "NewsManage" })
            //);
        }