Exemplo n.º 1
0
        public virtual ActionResult Include(ModuleListInSiteModel[] model, string @return)
        {
            var data = new JsonResultData(ModelState);

            data.RunWithTry((resultData) =>
            {
                if (ModelState.IsValid)
                {
                    foreach (var item in model)
                    {
                        Manager.AddSiteToModule(item.ModuleName, Site.FullName);
                    }
                    resultData.RedirectUrl = @return;
                }
            });

            return Json(data);
        }
Exemplo n.º 2
0
        public virtual ActionResult Include(ModuleListInSiteModel[] model)
        {
            JsonResultEntry result = new JsonResultEntry(ModelState);

            if (ModelState.IsValid)
            {
                try
                {
                    foreach (var item in model)
                    {
                        Manager.AddSiteToModule(item.ModuleName, Site.FullName);
                    }
                    result.RedirectUrl = Url.Action("Index", this.ControllerContext.RequestContext.AllRouteValues());
                }
                catch (Exception e)
                {
                    result.AddException(e);
                }
            }

            return Json(result);
        }