Esempio n. 1
0
        protected override void OnActionExecuted(ActionExecutedContext filterContext)
        {
            if (filterContext.IsChildAction)
            {
                return;
            }

            ViewBag.BlogConfig = BlogConfig.MapTo <BlogConfigViewModel>();

            CompleteSessionHandler(filterContext);
        }
        public ActionResult Index(BlogConfigurationInput input)
        {
            if (ModelState.IsValid == false)
            {
                ViewBag.Message = ModelState.GetFirstErrorMessage();
                if (Request.IsAjaxRequest())
                {
                    return(Json(new { Success = false, ViewBag.Message }));
                }
                return(View(BlogConfig.MapTo <BlogConfigurationInput>()));
            }

            var config = input.MapPropertiesToInstance(BlogConfig);

            RavenSession.Store(config);

            ViewBag.Message = "Configurations successfully saved!";
            if (Request.IsAjaxRequest())
            {
                return(Json(new { Success = true, ViewBag.Message }));
            }
            return(View(config.MapTo <BlogConfigurationInput>()));
        }
 public ActionResult Index()
 {
     return(View(BlogConfig.MapTo <BlogConfigurationInput>()));
 }