SiteServer.Plugin icon indicating copy to clipboard operation
SiteServer.Plugin copied to clipboard

官网插件文档是2.0的,现在新版的插件2.4的文档没有,按照2.0的写法不对,求指点。

Open zjszk opened this issue 6 years ago • 0 comments

`using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using SiteServer.Plugin;

namespace Site.Teacher { public class Main : PluginBase {

    private const string SubTitle1 = "SubTitle";
    private const string ImageUrl1 = "ImageUrl";
    private const string Content1 = "Content";
    private const string stardata = "stardata";

    public override void Startup(IService service)
    {
        service.AddContentModel("cms_teacher", new List<TableColumn>
    {
        new TableColumn
        {
            AttributeName = SubTitle1,
            DataType = DataType.VarChar,
            DataLength = 255,
            InputStyle = new InputStyle
            {
                InputType = InputType.Text,
                DisplayName = "最高职称",
                IsRequired = true
            }
        },
        new TableColumn
        {
            AttributeName = ImageUrl1,
            DataType = DataType.VarChar,
            DataLength = 200,
            InputStyle = new InputStyle
            {
                InputType = InputType.Image,
                DisplayName = "照片",
                IsRequired = true,
             }
        },
        new TableColumn
        {
            AttributeName = Content1,
            DataType = DataType.Text,
            InputStyle = new InputStyle
            {
                InputType = InputType.TextEditor,
                DisplayName = "教师介绍",
                IsRequired = true
            }
        },
        new TableColumn
        {
            AttributeName = stardata,
            DataType = DataType.DateTime,
            InputStyle = new InputStyle
            {
                InputType = InputType.Date,
                DisplayName = "参加工作时间",
                IsRequired = true
            }
        }
     });
    }
}

} ` 运行提示:TableColumn 未找到类型名或者命名空间, DataType 上下文不存在。插板库版本2.4,求指点,小白。

zjszk avatar Dec 04 '19 08:12 zjszk