当前位置: 首页>>代码示例>>C#>>正文


C# JsonResultData.AddMessage方法代码示例

本文整理汇总了C#中Kooboo.CMS.Common.JsonResultData.AddMessage方法的典型用法代码示例。如果您正苦于以下问题:C# JsonResultData.AddMessage方法的具体用法?C# JsonResultData.AddMessage怎么用?C# JsonResultData.AddMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Kooboo.CMS.Common.JsonResultData的用法示例。


在下文中一共展示了JsonResultData.AddMessage方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Install

        public virtual ActionResult Install(InstallModuleModel installModel, string @return)
        {
            var data = new JsonResultData(ModelState);
            if (ModelState.IsValid)
            {
                data.RunWithTry((resultData) =>
                {
                    var moduleFile = this.Request.Files["ModuleFile"];

                    StringBuilder log = new StringBuilder();
                    var moduleName = System.IO.Path.GetFileNameWithoutExtension(moduleFile.FileName);

                    var moduleInfo = Manager.Install(moduleName, moduleFile.InputStream, ref log);

                    if (moduleInfo == null && log.Length != 0)
                    {
                        data.Success = false;
                        data.AddMessage(log.ToString());
                    }
                    else
                    {
                        data.RedirectUrl = @return;
                    }
                });
            }

            return Json(data);
        }
开发者ID:ebojangi,项目名称:CMS,代码行数:28,代码来源:ModuleManagementController.cs

示例2: Index

 public virtual ActionResult Index(string body)
 {
     JsonResultData data = new JsonResultData(ModelState);
     data.RunWithTry((resultData) =>
     {
         Robots_Txt robot_txt = new Robots_Txt(Site);
         robot_txt.Save(body);
         data.AddMessage("The robots.txt has been saved.".Localize());
     });
     return Json(data);
 }
开发者ID:night-king,项目名称:CMS,代码行数:11,代码来源:Robots_TxtController.cs

示例3: ResetAll

 public virtual ActionResult ResetAll(string repositoryName)
 {
     var data = new JsonResultData(ModelState);
     if (ModelState.IsValid)
     {
         data.RunWithTry((resultData) =>
         {
             var repository = Kooboo.CMS.Content.Services.ServiceFactory.RepositoryManager.Get(repositoryName);
             var count = _service.ResetSchema(repository);
             data.AddMessage(String.Format("Reset {0} Schemas", count));
         });
     }
     return Json(data);
 }
开发者ID:Qupy,项目名称:Extensions,代码行数:14,代码来源:SchemasController.cs

示例4: ResetSpecified

        public virtual ActionResult ResetSpecified(Schema[] model, string repositoryName)
        {
            var data = new JsonResultData(ModelState);
            data.RunWithTry((resultData) =>
            {
                if (model != null)
                {
                    var repository = Kooboo.CMS.Content.Services.ServiceFactory.RepositoryManager.Get(repositoryName);
                    var count = _service.ResetSchema(repository, model);
                    data.AddMessage(String.Format("Reset {0} Schemas", count));
                }
            });

            return Json(data);
        }
开发者ID:Qupy,项目名称:Extensions,代码行数:15,代码来源:SchemasController.cs

示例5: Index

        public ActionResult Index(string siteName, ModuleInfo_Metadata moduleInfo)
        {
            JsonResultData resultEntry = new JsonResultData(ModelState);
            try
            {
                if (ModelState.IsValid)
                {
                    ModuleInfo.SaveModuleSetting(ModuleName, siteName, moduleInfo.Settings);
                    resultEntry.AddMessage("Module setting has been changed.".Localize());
                }

            }
            catch (Exception e)
            {
                resultEntry.AddException(e);
            }
            return Json(resultEntry);
        }
开发者ID:ebojangi,项目名称:CMS,代码行数:18,代码来源:AdminController.cs

示例6: Install

        public virtual ActionResult Install(InstallModuleModel installModel, string @return)
        {
            var data = new JsonResultData(ModelState);
            if (ModelState.IsValid)
            {
                data.RunWithTry((resultData) =>
                {
                    var moduleFile = this.Request.Files["ModuleFile"];

                    StringBuilder log = new StringBuilder();
                    var moduleName = System.IO.Path.GetFileNameWithoutExtension(moduleFile.FileName);

                    var moduleInfo = Manager.Install(moduleName, moduleFile.InputStream, ref log);

                    if (moduleInfo == null && log.Length != 0)
                    {
                        data.Success = false;
                        data.AddMessage(log.ToString());
                    }
                    else
                    {
                        if (!string.IsNullOrEmpty(moduleInfo.InstallingTemplate))
                        {
                            data.RedirectUrl = Url.Action("OnInstalling", ControllerContext.RequestContext.AllRouteValues().Merge("ModuleName", moduleName));
                        }
                        else
                        {
                            data.RedirectUrl = @return;
                        }
                    }
                });
            }

            return Json(data);
        }
开发者ID:rrsc,项目名称:CMS,代码行数:35,代码来源:ModuleManagementController.cs

示例7: ClearCache

        public virtual ActionResult ClearCache()
        {
            var data = new JsonResultData(ModelState);

            data.RunWithTry((resultData) =>
            {
                Site.ClearCache();
                var repository = Site.GetRepository();
                if (repository != null)
                {
                    repository.ClearCache();
                }
                CacheManagerFactory.DefaultCacheManager.ClearGlobalObjectCache();

                data.AddMessage("The site cache has been cleared.".Localize());
            });

            return Json(data);
        }
开发者ID:Godoy,项目名称:CMS,代码行数:19,代码来源:SiteController.cs

示例8: ResetTemplates

        public virtual ActionResult ResetTemplates(Schema[] model)
        {
            var data = new JsonResultData(ModelState);
            data.RunWithTry((resultData) =>
            {
                if (model != null)
                {
                    foreach (var item in model)
                    {
                        ResetForm(item);
                    }
                    data.AddMessage("The templates have been reset.".Localize());
                }
            });

            return Json(data);
        }
开发者ID:night-king,项目名称:CMS,代码行数:17,代码来源:ContentTypeController.cs


注:本文中的Kooboo.CMS.Common.JsonResultData.AddMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。