Пример #1
0
        public ActionResult Index(PagerParameters pagerParameters)
        {
            Pager pager             = new Pager(_siteService.GetSiteSettings(), pagerParameters);
            var   contactEntryCount = _contactFormService.GetEntries().Count();
            var   entries           = _contactFormService.GetEntries().ToList();//.Select(e => _contactFormService.Convert(e)).ToList(); // TODO add paging;
            var   pagerShape        = Shape.Pager(pager).TotalItemsCount(contactEntryCount);


            var vm = new ContactFormEntryListViewModel {
                ContactFormEntries = entries, Pager = pager
            };

            return(View(vm));
            //return null;
        }
Пример #2
0
 public void BuildMenu(NavigationItemBuilder menu)
 {
     menu.Add(T("Contact Info"), "1.1", item =>
              item.Action("Edit", "ContactAdmin", new { area = "Gilde" }))
     .Add(T("Reacties ({0})", _contactFormService.GetEntries().Count()), "1.2", item =>
          item.Action("List", "ContactAdmin", new { area = "Gilde" }));
 }
Пример #3
0
        public void GetNavigation(NavigationBuilder builder)
        {
            if (!_authorizer.Authorize(HarvestPermissions.ManageContactFormEntries))
            {
                throw new OrchardSecurityException(T("You don't have permission to manage contact form entries"));
            }

            builder
            .Add(T("Contact Form ({0})", _contactFormService.GetEntries().Count()), "3", item => {
                item.LinkToFirstChild(true);
                item.Add(T("Contact Form Entries"), "1", subItem => subItem
                         .LocalNav()
                         .Action("Index", "ContactFormAdmin", new { area = MyModule.Name }));
            })
            .AddImageSet("contactform");     // Includes a stylesheet named "menu-contactform-admin"
        }
        public ActionResult Index()
        {
            var entries = _contactFormService.GetEntries().ToList();

            return(View(entries));
        }