码迷,mamicode.com
首页 > 其他好文 > 详细

快速添加Basic表单

时间:2016-07-16 06:59:06      阅读:217      评论:0      收藏:0      [点我收藏+]

标签:

第一步添加实体

  1. 继承基类Basic
  2. 定义特性
技术分享
namespace ZKCloud.CMS.Market.Domain.Entities {

    [ClassProperty("友情链接", AppName = "Common", Name = "友情链接", GroupName = "基本信息,高级选项", Icon = "fa-puzzle-piece", SortOrder = 1, Description = "设置以及查看系统的详细信息")]
    [SideBar(GroupName ="CMS",Name = "SideBar")]
    public class FriendlyLink : Basic {
        [Field("链接名称", ControlsType.TextBox, GroupTabId = 1,ListShow =true,SortOrder =10)]
        [Display(Name = "链接名称")]
        [Required(ErrorMessage = "链接名称不能为空")]
        public string Name { get; set; }

        [Field("网址", ControlsType.TextBox, GroupTabId = 1,ListShow =true,SortOrder =11)]
        [Display(Name = "网址")]
        [Required(ErrorMessage = "网址不能为空")]
        public string Url { get; set; }
    }



    public class FriendlyLinkCreator : IModelCreator {
        public void CreateModel(ModelBuilder builder) {
            builder.Entity<FriendlyLink>(d => {
                d.ToTable("CMS_FriendlyLink");
                d.HasKey(e => e.Id);
                d.Property(e => e.Name).IsRequired();
            });
        }
    }
}
View Code

 

第二步指定连接在何处显示

url格式:

列表页面:/Admin/Basic/Index?Key=ZKCloud.CMS.Market.Domain.Entities.FriendlyLink

编辑页面:/Admin/Basic/Edit?Key=ZKCloud.CMS.Market.Domain.Entities.FriendlyLink

快速添加Basic表单

标签:

原文地址:http://www.cnblogs.com/zkcloud/p/5675210.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!