Ejemplo n.º 1
0
        public void AddEntity()
        {
            if (Context.SelectProject == null)
            {
                MessageBox.Show("请选择一个项目");
                return;
            }
            EntityConfig entity;

            if (!Model.CreateNew(out entity))
            {
                return;
            }
            entity.Parent  = Context.SelectProject;
            entity.Project = Context.SelectProject.Name;
            //Context.SelectProject.Entities.Add(entity);
            //Context.Entities.Add(entity);
            Model.Tree.SetSelect(entity);
            Context.SelectColumns = null;
            var nentity = CommandIoc.AddFieldsCommand();

            if (nentity == null)
            {
                return;
            }
            entity.Properties.AddRange(nentity.Properties);
        }
Ejemplo n.º 2
0
        public void AddFields(EntityConfig entity)
        {
            if (entity == null)
            {
                return;
            }
            var nentity = CommandIoc.AddFieldsCommand();

            if (nentity == null)
            {
                return;
            }
            entity.Properties.AddRange(nentity.Properties);
        }
Ejemplo n.º 3
0
        //private void AddRelation(PropertyConfig column)
        //{
        //    var config = new TableReleation
        //    {
        //        Parent = Context.SelectRelationTable,
        //        Name = column.Parent.Name,
        //        Friend = column.Parent.Name,
        //        ForeignKey = column.Name,
        //        PrimaryKey = Context.SelectRelationColumn.Name
        //    };
        //    if (CommandIoc.NewConfigCommand("新增关联信息", config))
        //        Context.SelectRelationTable.Releations.Add(config);
        //}

        /// <summary>
        /// 新增属性
        /// </summary>
        /// <param name="entity"></param>
        public void AddNewProperty(EntityConfig entity)
        {
            CommandIoc.AddFieldsCommand(entity);
        }