private ActionResult Success(BaseContactFormModel model)
        {
            TempData["Success"] = true;
            var thanksPage = CurrentPage.Children(x => x.DocumentTypeAlias == "ThankYouPage").FirstOrDefault();

            return(RedirectToUmbracoPage(thanksPage));
        }
Example #2
0
        /// <summary>
        /// Get the vacancy items ordered by sort order and filtered by level.
        /// </summary>
        /// <returns></returns>
        public IEnumerable <Vacancyitem> GetVacancyitems()
        {
            //If the level is in the querystring try to convert it to the enum.
            VacancyLevel?level = null;

            if (!string.IsNullOrEmpty(Request.QueryString["level"]))
            {
                var attemptVacancyLevel = Request.QueryString["level"].TryConvertTo <VacancyLevel>();
                level = attemptVacancyLevel.Success ? attemptVacancyLevel.Result : (VacancyLevel?)null;
            }

            //Get the vacancy item children of the current page.
            var vacancyItems = CurrentPage.Children <Vacancyitem>();

            if (level.HasValue)
            {
                //Filter on the level if the enum is available.
                vacancyItems = vacancyItems.Where(x => x.VacancyLevel == level.Value);
            }

            //Return the vacancy items ordered by sort order.
            return(vacancyItems.OrderBy(x => x.SortOrder));
        }