/// <summary>初始化现有的所有插件 /// </summary> /// <param name="PluginBasePath">插件存放的根目录</param> public static void InitPlugin(string PluginBasePath) { lock (_Plugins) { _PluginBasePath = PluginBasePath; var Plugins = _pluginBll.GetPlugins(0, 0, ""); if (Plugins != null) { Plugins = Plugins.Where(p => p.Status == 1); foreach (var p in Plugins) { LoadPlugin(p); } } } }
/// <summary>获得模块列表 /// </summary> /// <returns></returns> public ActionResult ModuleList(int pageIndex, int pageSize, string searchName) { List <PluginEntity> pluginEntities; if (pageIndex == 0) { pageIndex = 1; } if (pageSize == 0) { pageSize = 10; } pluginEntities = _PluginBll.GetPlugins(pageIndex, pageSize, searchName).ToList(); ViewBag.count = _PluginBll.GetPlusginsCount(searchName); ViewBag.count = ViewBag.count % pageSize == 0 ? ViewBag.count / pageSize : (ViewBag.count / pageSize + 1); ViewBag.pageindex = pageIndex; return(PartialView(pluginEntities)); }
public ActionResult GetModule() { PluginBll _PluginBll = new PluginBll(); List <PluginEntity> pluginEntities = _PluginBll.GetPlugins(0, 0, "").ToList(); RightBll rightBll = new RightBll(); List <int> list = rightBll.GetCategory(); if (list != null) { pluginEntities.RemoveAll(m => list.Contains(m.Id)); } StringBuilder sb = new StringBuilder(); foreach (var item in pluginEntities) { sb.AppendFormat("<option value = '{0}'>", item.Id); sb.Append(item.Name); sb.Append("</option>"); } return(Content(sb.ToString())); }