1、在Model层添加一个类,继承BaseEntity,如:
(将就demo里面的类改了一下)
using Rookey.BusSys.Model.Base; using Rookey.BusSys.Model.EnumSpace; using Rookey.Frame.EntityBase; using Rookey.Frame.EntityBase.Attr; using ServiceStack.DataAnnotations; using System; namespace Rookey.BusSys.Model.Customer { /// <summary> /// 客户联系人2 /// </summary> [ModuleConfig(Name = "客户联系人2", ModuleEditMode = 1, PrimaryKeyFields = "Crm_Cm_CustomerMasterId,Name", TitleKey = "Name", StandardJsFolder = "Customer", Sort = 2)] public class Crm_Cm_ContactInfo2 : BaseCustomerEntity { /// <summary> /// 客户信息 /// </summary> [FieldConfig(Display = "客户", ControlType = (int)ControlTypeEnum.TextBox, RowNum = 1, ColNum = 1, IsRequired = true, IsFrozen = true, HeadSort = 1, HeadWidth = 200)] public Guid? Crm_Cm_CustomerMasterId { get; set; } /// <summary> /// 联系人姓名 /// </summary> [FieldConfig(Display = "联系人姓名", IsRequired = true, IsFrozen = true, RowNum = 1, ColNum = 2, HeadSort = 2, HeadWidth = 80)] [StringLength(100)] public string Name { get; set; } /// <summary> /// 联系人姓名2 /// </summary> [FieldConfig(Display = "联系人姓名2", IsRequired = true, IsFrozen = true, RowNum = 1, ColNum = 2, HeadSort = 2, HeadWidth = 80)] [StringLength(100)] public string Name2 { get; set; } } }
2、在Web.config中,在字段RepairTables中,添加表名,如Crm_Cm_ContactInfo2
3、重新启动项目,此时线下自定义的表,已经添加到了数据库了,在模块管理中可以查看。
4、添加菜单,刷新一下页面就可以看到这个菜单了,如果刷新后 还是没有显示的话,估计是被缓存了,项目重新打开运行过就行了。
5、预览功能