コード例 #1
0
        protected override void OnActionExecuted(ActionExecutedContext filterContext)
        {
            if (filterContext.IsChildAction)
            {
                return;
            }

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

            CompleteSessionHandler(filterContext);
        }
コード例 #2
0
        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>()));
        }
コード例 #3
0
 public ActionResult Index()
 {
     return(View(BlogConfig.MapTo <BlogConfigurationInput>()));
 }