Example #1
0
        public override void Startup(IService service)
        {
            PluginId = Id;

            service
            .AddContentModel(ContentTableUtils.ContentTableName, ContentTableUtils.ContentTableColumns)
            .AddContentMenu(contentInfo => new Menu
            {
                Text = "杂志文章管理",
                Href = $"{nameof(PageArticles)}.aspx"
            })
            .AddDatabaseTable(ArticleDao.TableName, ArticleDao.Columns)
            .AddStlElementParser(StlMagazineArticles.ElementName, StlMagazineArticles.Parse)
            .AddStlElementParser(StlMagazineArticle.ElementName, StlMagazineArticle.Parse)
            ;

            service.RestApiGet  += Service_RestApiGet;
            service.RestApiPost += Service_RestApiPost;
        }
Example #2
0
 public override void Startup(IService service)
 {
     service.AddContentModel("ss_jobs", new List <TableColumn>
     {
         new TableColumn
         {
             AttributeName = Department,
             DataType      = DataType.VarChar,
             DataLength    = 200
         },
         new TableColumn
         {
             AttributeName = Location,
             DataType      = DataType.VarChar,
             DataLength    = 200
         },
         new TableColumn
         {
             AttributeName = NumberOfPeople,
             DataType      = DataType.VarChar,
             DataLength    = 200
         },
         new TableColumn
         {
             AttributeName = Responsibility,
             DataType      = DataType.Text
         },
         new TableColumn
         {
             AttributeName = Requirement,
             DataType      = DataType.Text
         }
     },
                             new List <InputStyle>
     {
         new InputStyle
         {
             InputType     = InputType.Text,
             AttributeName = Department,
             DisplayName   = "所属部门",
             IsRequired    = true
         },
         new InputStyle
         {
             InputType     = InputType.Text,
             AttributeName = Location,
             DisplayName   = "工作地点",
             IsRequired    = true
         },
         new InputStyle
         {
             InputType     = InputType.Text,
             AttributeName = NumberOfPeople,
             DisplayName   = "招聘人数",
             IsRequired    = true,
             DefaultValue  = "不限"
         },
         new InputStyle
         {
             InputType     = InputType.TextEditor,
             AttributeName = Responsibility,
             DisplayName   = "工作职责",
             IsRequired    = true
         },
         new InputStyle
         {
             InputType     = InputType.TextEditor,
             AttributeName = Requirement,
             DisplayName   = "工作要求",
             IsRequired    = true
         }
     });
 }
Example #3
0
        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;     // // 页面加载处理函数
        }
Example #4
0
        // 插件被激活时初始化工作
        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;     // 页面加载处理函数
        }