Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
zjszk opened this issue Dec 4, 2019 · 0 comments

Comments

@zjszk
Copy link

zjszk commented Dec 4, 2019

`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,求指点,小白。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant