本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}