public override void Startup(IService service) { ContentRepository = new ContentRepository(); CategoryClassRepository = new CategoryClassRepository(); CategoryRepository = new CategoryRepository(); DepartmentRepository = new DepartmentRepository(); IdentifierRuleRepository = new IdentifierRuleRepository(); IdentifierSeqRepository = new IdentifierSeqRepository(); service .AddContentModel(ContentRepository.TableName, ContentRepository.TableColumns, ContentRepository.InputStyles) .AddDatabaseTable(CategoryClassRepository.TableName, CategoryClassRepository.TableColumns) .AddDatabaseTable(CategoryRepository.TableName, CategoryRepository.TableColumns) .AddDatabaseTable(DepartmentRepository.TableName, DepartmentRepository.TableColumns) .AddDatabaseTable(IdentifierRuleRepository.TableName, IdentifierRuleRepository.TableColumns) .AddDatabaseTable(IdentifierSeqRepository.TableName, IdentifierSeqRepository.TableColumns) .AddSiteMenu(siteId => new Menu { Text = "主动信息公开", IconClass = "ion-ios-book", Menus = new List <Menu> { new Menu { Text = "信息采集", Href = PageMain.GetRedirectUrl(siteId, Context.UtilsApi.GetAdminUrl($"cms/pageContentAdd.aspx?siteId={siteId}")) }, new Menu { Text = "信息管理", Href = PageMain.GetRedirectUrl(siteId, Context.UtilsApi.GetAdminUrl($"cms/contents.cshtml?siteId={siteId}")) }, new Menu { Text = "信息审核", Href = PageMain.GetRedirectUrl(siteId, Context.UtilsApi.GetAdminUrl($"cms/pageContentSearch.aspx?isCheckOnly=true&siteId={siteId}")) }, new Menu { Text = "分类法管理", Href = PageInit.GetRedirectUrl(siteId, PageCategoryMain.GetRedirectUrl(siteId)) }, new Menu { Text = "索引号生成规则", Href = PageInit.GetRedirectUrl(siteId, PageIdentifierRule.GetRedirectUrl(siteId)) }, new Menu { Text = "重新生成索引号", Href = PageInit.GetRedirectUrl(siteId, PageIdentifierCreate.GetRedirectUrl(siteId)) }, new Menu { Text = "部门设置", Href = "pages/departments.html" }, new Menu { Text = "信息公开设置", Href = PageInit.GetRedirectUrl(siteId, PageSettings.GetRedirectUrl(siteId)) }, new Menu { Text = "数据统计分析", Href = PageInit.GetRedirectUrl(siteId, PageAnalysis.GetRedirectUrl(siteId)) } } }); service.ContentFormSubmit += Service_ContentFormSubmited; // 页面提交处理函数 service.ContentFormLoad += Service_ContentFormLoad; // // 页面加载处理函数 }
// 插件被激活时初始化工作 public override void Startup(IService service) { PluginId = Id; service.AddContentModel(ContentDao.TableName, ContentDao.Columns) // 插件对应的内容模型表 .AddDatabaseTable(ChannelDao.TableName, ChannelDao.Columns) // 插件需要用到的其他表结构 .AddDatabaseTable(LogDao.TableName, LogDao.Columns) .AddDatabaseTable(PermissionsDao.TableName, PermissionsDao.Columns) .AddDatabaseTable(RemarkDao.TableName, RemarkDao.Columns) .AddDatabaseTable(ReplyDao.TableName, ReplyDao.Columns) .AddDatabaseTable(TypeDao.TableName, TypeDao.Columns) .AddSiteMenu(siteId => new Menu { Text = "互动交流", IconClass = "ion-chatbox-working", Menus = new List <Menu> { new Menu { Text = "待受理办件", Href = PageMain.GetRedirectUrl(siteId, PageListAccept.GetRedirectUrl(siteId, 0)) }, new Menu { Text = "待办理办件", Href = PageMain.GetRedirectUrl(siteId, PageListReply.GetRedirectUrl(siteId, 0)) }, new Menu { Text = "待审核办件", Href = PageMain.GetRedirectUrl(siteId, PageListCheck.GetRedirectUrl(siteId, 0)) }, new Menu { Text = "所有办件", Href = PageMain.GetRedirectUrl(siteId, PageListAll.GetRedirectUrl(siteId, 0)) }, new Menu { Text = "新增办件", Href = PageMain.GetRedirectUrl(siteId, $"@/cms/pageContentAdd.aspx?siteId={siteId}") }, new Menu { Text = "互动交流设置", Href = PageInit.GetRedirectUrl(siteId, PageConfiguration.GetRedirectUrl(siteId)) }, new Menu { Text = "前台页面标签", Href = PageInit.GetRedirectUrl(siteId, PageFormStyle.GetRedirectUrl(siteId)) }, new Menu { Text = "数据统计分析", Href = PageInit.GetRedirectUrl(siteId, PageAnalysis.GetRedirectUrl(siteId)) } } }); // 插件站点菜单 service.ContentFormSubmit += Service_ContentFormSubmited; // 页面提交处理函数 service.ContentFormLoad += Service_ContentFormLoad; // 页面加载处理函数 }