/// <summary>
        /// Skyler Hiscock
        ///
        /// Created:
        /// 2017/04/20
        /// </summary>
        /// <param name="categories"></param>
        /// <param name="searchPhrase"></param>
        /// <param name="selectedCategory"></param>
        /// <returns>Nav Menu Partial View</returns>
        public PartialViewResult NavMenu(IEnumerable <string> categories, string searchPhrase = "", string selectedCategory = "")
        {
            var navViewModel = new NavMenuViewModel
            {
                Categories       = categories,
                SearchPhrase     = searchPhrase,
                SelectedCategory = selectedCategory
            };

            return(PartialView(navViewModel));
        }
Example #2
0
        /// <summary>
        /// Action method for the menu view.
        /// </summary>
        /// <returns>The menu</returns>
        public PartialViewResult Menu(string category = null)
        {
            NavMenuViewModel vm = new NavMenuViewModel()
            {
                Categories = ProductRepository.Products
                             .Select(p => p.Category)
                             .Distinct()
                             .OrderBy(p => p),

                CurrentCategory = category
            };

            return(PartialView(vm));
        }
        public PartialViewResult Menu(string category = null, string subject = null, string date = null, bool marked = false, bool followup = false, string followupDescr = null)
        {
            ViewBag.SelectedCategory = category;
            ViewBag.SelectedSubject  = subject;
            ViewBag.SelectedDate     = date;

            NavMenuViewModel menuList = new NavMenuViewModel();

            menuList.MenuCatItems  = repository.GetMenuItems(null);
            menuList.MenuDateItems = new List <string> {
                "Alle berichten", "Sinds laatste logout", "Afgelopen 24 uur", "Afgelopen week", "Afgelopen maand"
            };
            menuList.MenuIsMarked          = marked;
            menuList.MenuHasFollowup       = followup;
            menuList.MenuFollowupRoleItems = followupDescr;
            return(PartialView(menuList));
        }
Example #4
0
        public ViewResult List(DocumentsListViewModel model, NavMenuViewModel menu, int?SubmitOrder, int?SubmitFilter, int page = 1)
        {
            if (SubmitOrder == null && Session["OrderInfo"] == null)
            {
                model.OrderInfo = new OrderInfo();
            }
            else if (SubmitOrder == null && Session["OrderInfo"] != null)
            {
                model.OrderInfo = (OrderInfo)Session["OrderInfo"];
            }
            else
            {
                Session["OrderInfo"] = model.OrderInfo;
            }

            if (SubmitFilter != null)
            {
                Session["FilterInfo"] = menu.ListFilterInfo;
            }

            model.FilterInfo = (ListFilterInfo)Session["FilterInfo"] ?? new ListFilterInfo();

            model.PagingInfo = new PagingInfo
            {
                CurrentPage  = page,
                ItemsPerPage = PageSize
            };

            IEnumerable <Document> documents = DocumentsListGeneratorHelper.GetDocumentsList(model, repository);

            model.PagingInfo.TotalItems = documents.Count();
            model.Documents             = documents
                                          .Skip((model.PagingInfo.CurrentPage - 1) * model.PagingInfo.ItemsPerPage)
                                          .Take(model.PagingInfo.ItemsPerPage);


            return(View(model));
        }
        public PartialViewResult Menu()
        {
            NavMenuViewModel model = new NavMenuViewModel()
            {
                ListFilterInfo = (ListFilterInfo)Session["FilterInfo"] ?? new ListFilterInfo()
            };

            bool isAuthorised = Request.IsAuthenticated;

            ViewBag.isAuthorized = isAuthorised;

            if (isAuthorised)
            {
                string     cookieName            = FormsAuthentication.FormsCookieName;
                HttpCookie authCookie            = HttpContext.Request.Cookies[cookieName];
                FormsAuthenticationTicket ticket = FormsAuthentication.Decrypt(authCookie.Value);
                string UserName = ticket.Name;
                ViewBag.UserName = UserName;
            }



            return(PartialView(model));
        }