public string GetWorkItemDisplayText(SysWorkItem wi, SysProcessInstance pi, SysActivityInstance ai)
        {
            string str6;

            try
            {
                SysActivity activity = ai.Activity;
                if (activity == null)
                {
                    throw new ApplicationException(string.Format("活动实例:{0}找不到对应活动", ai.ActivityInstanceId));
                }
                SysProcess process = pi.Process;
                if (process == null)
                {
                    throw new ApplicationException(string.Format("活动:{0}找不到对应流程", activity.ActivityId));
                }
                string activityName = activity.ActivityName;
                string processName  = process.ProcessName;
                if (process.ProcessCategory == 2)
                {
                    return(string.Format("[{0}][{1}]{2}", processName, activityName, pi.FormInstance.FormTitle));
                }
                EntityCache cache             = new EntityCache(this._manager);
                SysEntity   processEntity     = process.ProcessEntity;
                string      objectDisplayName = cache.GetObjectDisplayName(processEntity, wi.RelativeObjectId.Value);
                str6 = string.Format("[{0}][{1}]{2}", processName, activityName, objectDisplayName);
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(str6);
        }
Ejemplo n.º 2
0
        public string GetPageUrl(BizDataContext db, SysEntity entity, SysPage page)
        {
            string str = string.Empty;

            if ((page != null) && page.ModuleId.HasValue)
            {
                page.OwnerModule = db.FindById <SysModule>(new object[] { page.ModuleId });
                if (page.OwnerModule != null)
                {
                    page.OwnerModule.EntityCategory = db.FindById <SysEntityCategory>(new object[] { page.OwnerModule.CategoryId });
                    if (page.OwnerModule.EntityCategory != null)
                    {
                        str = string.Format("~/{0}_{1}/{2}", page.OwnerModule.EntityCategory.CategoryName, page.OwnerModule.ModuleName, page.PageName);
                    }
                }
                return(str);
            }
            if (entity != null)
            {
                entity.OwnerModule = db.FindById <SysModule>(new object[] { entity.ModuleId });
                if (entity.OwnerModule == null)
                {
                    return(str);
                }
                entity.OwnerModule.EntityCategory = db.FindById <SysEntityCategory>(new object[] { entity.OwnerModule.CategoryId });
                if (entity.OwnerModule.EntityCategory != null)
                {
                    str = string.Format("~/{0}_{1}/{2}", entity.OwnerModule.EntityCategory.CategoryName, entity.OwnerModule.ModuleName, page.PageName);
                }
            }
            return(str);
        }
Ejemplo n.º 3
0
        public string GetPageUrl(SysEntity entity, SysPage page)
        {
            string result = string.Empty;

            //if (page != null && page.ModuleId != null)
            //{
            //    page.OwnerModule = db.FindById<SysModule>(page.ModuleId);
            if (page.OwnerModule != null)
            {
                //page.OwnerModule.EntityCategory = db.FindById<SysEntityCategory>(page.OwnerModule.CategoryId);
                if (page.OwnerModule.EntityCategory != null)
                {
                    result = string.Format("~/{0}_{1}/{2}.aspx", page.OwnerModule.EntityCategory.CategoryName, page.OwnerModule.ModuleName, page.PageName);
                }
            }
            //}
            else
            {
                if (entity != null)
                {
                    //entity.OwnerModule = db.FindById<SysModule>(entity.ModuleId);
                    if (entity.OwnerModule != null)
                    {
                        //entity.OwnerModule.EntityCategory = db.FindById<SysEntityCategory>(entity.OwnerModule.CategoryId);
                        if (entity.OwnerModule.EntityCategory != null)
                        {
                            result = string.Format("~/{0}_{1}/{2}.aspx", entity.OwnerModule.EntityCategory.CategoryName, entity.OwnerModule.ModuleName, page.PageName);
                        }
                    }
                }
            }

            return(result);
        }
 private static void LoadFields(EntitySchema es, SysEntity entity, EntityCacheBase cache)
 {
     foreach (SysField field in entity.Fields)
     {
         bool?isNullable;
         es.Fields.Add(field);
         if (field.DataType == 1)
         {
             isNullable = field.IsNullable;
             es.PropertyTypes.Add(es.KeyName, dataTypes[(DataTypeEnum)field.DataType.Value][isNullable.HasValue ? isNullable.GetValueOrDefault() : false]);
             es.PropertyTypeEnums.Add(es.KeyName, field.DataType.Value);
         }
         else
         {
             if (!string.IsNullOrEmpty(field.DefaultValue))
             {
                 es.DefaultValues.Add(field.FieldName, field.DefaultValue);
             }
             isNullable = field.IsNullable;
             es.PropertyTypes.Add(field.FieldName, dataTypes[(DataTypeEnum)field.DataType.Value][isNullable.HasValue ? isNullable.GetValueOrDefault() : false]);
             es.PropertyTypeEnums.Add(field.FieldName, field.DataType.Value);
             if (field.DataType == 10)
             {
                 es.FilePropertys.Add(field.FieldName);
             }
         }
     }
 }
        private static void LoadRelations(EntitySchema es, SysEntity entity, EntityCacheBase cache)
        {
            List <SysMoreMoreRelation> list = cache.SysMoreMoreRelation.Where <SysMoreMoreRelation>(delegate(SysMoreMoreRelation s) {
                long?childEntityId = s.ChildEntityId;
                long entityId      = entity.EntityId;
                return(((childEntityId.GetValueOrDefault() == entityId) && childEntityId.HasValue) || (((childEntityId = s.ParentEntityId).GetValueOrDefault() == (entityId = entity.EntityId)) && childEntityId.HasValue));
            }).ToList <SysMoreMoreRelation>();

            foreach (SysMoreMoreRelation relation in list)
            {
                long oid = relation.ParentEntityId.Value;
                if (oid == entity.EntityId)
                {
                    oid = relation.ChildEntityId.Value;
                }
                SysEntity entity2 = (from s in cache.SysEntity
                                     where s.EntityId == oid
                                     select s).FirstOrDefault <SysEntity>();
                if (entity2 == null)
                {
                    throw new ApplicationException(oid.ToString());
                }
                es.MmTables.Add(entity2.EntityName + "s", relation.TableName);
                ReferencedObject item = new ReferencedObject {
                    EntityType     = cache.GetEntityType(entity2.EntityId),
                    ReferenceField = entity2.EntityName + "s",
                    DeleteFlag     = DeleteFlag.SetNull,
                    ReferenceType  = ReferenceType.MoreMore
                };
                es.ReferencedObjectList.Add(item);
            }
        }
Ejemplo n.º 6
0
 public FormEntityPublishHelper(SysEntity entity, BizDataContext db)
 {
     this._entity    = entity;
     this._fieldList = entity.Fields.ToList();
     this._db        = db;
     this._dbType    = db.DatabaseType;
 }
Ejemplo n.º 7
0
        public List <int> ExecutePython(SysProcessInstance pi, string scriptText)
        {
            List <int> list = new List <int>();

            if (!string.IsNullOrEmpty(scriptText))
            {
                EntityCache cache         = new EntityCache(this);
                SysEntity   processEntity = pi.Process.ProcessEntity;
                EntityData  data          = cache.GetObject(processEntity, pi.ObjectId);
                try
                {
                    ScriptEngine engine = Python.CreateEngine();
                    ScriptScope  scope  = engine.CreateScope();
                    scope.SetVariable("manager", this);
                    scope.SetVariable("pi_data", data);
                    scope.SetVariable("userIdList", list);
                    engine.CreateScriptSourceFromString(scriptText).Execute(scope);
                }
                catch (Exception exception)
                {
                    throw new ApplicationException("Python执行错误:" + exception.Message, exception);
                }
            }
            return(list);
        }
        /// <summary>
        /// 初始化
        /// </summary>
        private void Initialize()
        {
            long?id = QueryString <long?>("id");

            SysProcess process = this.DataHelper.FindById <SysProcess>(id);

            if (process != null)
            {
                this.ProcessId           = id.Value;
                this.lblProcessName.Text = process.ProcessName;
                SysEntity processEntity = GetEntity(process.EntityId);
                if (processEntity == null)
                {
                    throw new Exception("流程实体为空");
                }
                this.lblProcessEntity.Text = processEntity.DisplayText;

                //hc.Text用于回发
                //hc.Value记录当前选中的活动,由前台选中某活动,或调用后台SelectActivity方法更新
                this.hc.Text     = this.ClientScript.GetPostBackEventReference(this.hc, "select");
                this.hcSave.Text = this.ClientScript.GetPostBackEventReference(this.hc, "partSave");


                AddHiddenAndFirstActivity();
                BindDropDown();
            }
            else
            {
                throw new Exception("参数不正确");
            }
        }
Ejemplo n.º 9
0
 public static SysField GetField(this SysEntity entity, string field_name, DataContext context)
 {
     if (entity.Fields == null)
     {
         throw new ApplicationException("entity.Fieds没有加载");
     }
     return(context.FirstOrDefault <SysField>(f => (f.EntityId == entity.EntityId) && (f.FieldName == field_name)));
 }
        public override object GetValue(SysExpression expr, EntityCache cache, ExpressionCache expr_cache, SysProcessInstance pi, SysActivityInstance ai)
        {
            SysProcess process = pi.Process;

            if (process.ProcessEntity == null)
            {
                throw new ApplicationException("流程实体为空");
            }
            SysOneMoreRelation relation = expr.Relation;

            if (relation == null)
            {
                throw new ApplicationException("表达式的关系为空");
            }
            if (!relation.ChildEntityId.HasValue)
            {
                throw new ApplicationException("表达式的子实体为空");
            }
            if (!process.EntityId.HasValue)
            {
                throw new ApplicationException("流程的实体为空");
            }
            if (expr.Relation.ChildEntityId.Value != process.EntityId.Value)
            {
                throw new ApplicationException("不正确的关系");
            }
            if (!relation.ParentEntityId.HasValue)
            {
                throw new ApplicationException("关系的父实体为空");
            }
            if (!relation.ChildFieldId.HasValue)
            {
                throw new ApplicationException("关系的ChildFieldId为空");
            }
            long local1 = relation.ChildFieldId.Value;

            if (relation.ChildField == null)
            {
                throw new ApplicationException("关系的对应字段为空");
            }
            SysEntity  processEntity = pi.Process.ProcessEntity;
            int        objectId      = pi.ObjectId;
            EntityData data          = cache.GetObject(processEntity, objectId);
            SysEntity  parentEntity  = relation.ParentEntity;

            if (data.ContainsKey(relation.ChildField.FieldName))
            {
                int num2 = Convert.ToInt32(data[relation.ChildField.FieldName]);
                if (num2 != 0)
                {
                    object obj2 = cache.GetObject(parentEntity, num2)[expr.Field.FieldName];
                    expr_cache.Add(expr, obj2);
                    return(obj2);
                }
            }
            throw new ApplicationException(string.Format("计算表达式时需要字段{0},但其未赋值或为空", relation.ChildField.FieldName));
        }
 private static void LoadUniqueKey(EntitySchema es, SysEntity entity, EntityCacheBase cache)
 {
     foreach (SysUniqueKey key in entity.UniqueKeys)
     {
         string        str  = string.Format("{0}_id_{1}", key.UniqueKeyName, key.UniqueKeyId);
         List <string> list = (from p in key.UniqueKeyFields select p.SysField.FieldName).ToList <string>();
         es.UniqueKeyDict[str] = list;
     }
 }
Ejemplo n.º 12
0
        public override object GetValue(SysExpression expr, EntityCache cache, ExpressionCache expr_cache, SysProcessInstance pi, SysActivityInstance ai)
        {
            SysEntity processEntity = pi.Process.ProcessEntity;
            int       objectId      = pi.ObjectId;
            object    obj2          = cache.GetObject(processEntity, objectId)[expr.Field.FieldName];

            expr_cache.Add(expr, obj2);
            return(obj2);
        }
Ejemplo n.º 13
0
        private SysField ValidateEntity(SysEntity entity, Dictionary <string, object> valueDict = null)
        {
            if (entity == null)
            {
                throw new Exception("实体不能为空");
            }
            List <SysField> source = base.Where <SysField>(p => p.EntityId == entity.EntityId);

            if (source.Count < 1)
            {
                throw new Exception("没有定义字段");
            }
            List <SysField> list2 = (from p in source
                                     where p.DataType == 1
                                     select p).ToList <SysField>();

            if (list2.Count == 0)
            {
                throw new Exception("主键未定义");
            }
            if (list2.Count > 1)
            {
                throw new Exception("不支持多个主键定义");
            }
            SysField field = list2.First <SysField>();

            if (valueDict != null)
            {
                if (valueDict.Count < 1)
                {
                    throw new Exception("没有提供值");
                }
                using (Dictionary <string, object> .KeyCollection.Enumerator enumerator = valueDict.Keys.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        Func <SysField, bool> predicate = null;
                        string key = enumerator.Current;
                        if (predicate == null)
                        {
                            predicate = p => p.FieldName == key;
                        }
                        int num = source.Where <SysField>(predicate).Count <SysField>();
                        if (num == 0)
                        {
                            throw new Exception(string.Format("字段{0}未定义", key));
                        }
                        if (num > 1)
                        {
                            throw new Exception(string.Format("字段{0}重复定义", key));
                        }
                    }
                }
            }
            return(field);
        }
Ejemplo n.º 14
0
        private string GetDisplayText(SysForm p)
        {
            SysEntity entity = GetEntity(p.EntityId);

            if (entity != null)
            {
                return(entity.DisplayText);
            }
            return(string.Empty);
        }
Ejemplo n.º 15
0
        private string GetEntityName(SysForm p)
        {
            SysEntity entity = GetEntity(p.EntityId);

            if (entity != null)
            {
                return(entity.EntityName);
            }
            return(string.Empty);
        }
Ejemplo n.º 16
0
        public static string GetDefaultKeyFieldName(this SysEntity entity)
        {
            string entityName = entity.EntityName;

            if (entityName.ToUpper().StartsWith("T_"))
            {
                entityName = entityName.Remove(0, 2);
            }
            return(string.Format("{0}_Id", entityName));
        }
Ejemplo n.º 17
0
        public static string GetDisplayFieldName(this SysEntity entity)
        {
            bool?isCustomDisplayField = entity.IsCustomDisplayField;

            if (isCustomDisplayField.HasValue ? isCustomDisplayField.GetValueOrDefault() : false)
            {
                return(entity.DisplayFieldName);
            }
            return(entity.GetDefaultDisplayFieldName());
        }
Ejemplo n.º 18
0
        protected void ddlCustomEntity_TextChanged(object sender, EventArgs e)
        {
            long      id     = this.ddlCustomEntity.SelectedValue.ToLong();
            SysEntity entity = this.DataHelper.FindById <SysEntity>(id);

            if (entity != null)
            {
                this.txtSysEntityName.Text = entity.EntityName;
                this.EntityId = id;
            }
        }
Ejemplo n.º 19
0
        public static long GetDefaultKeyFieldId(this SysEntity entity, DataContext context)
        {
            int      fieldType = Convert.ToInt32(DataTypeEnum.pkey);
            SysField field     = context.FirstOrDefault <SysField>(f => (f.EntityId == entity.EntityId) && (f.DataType == fieldType));

            if (field == null)
            {
                throw new ApplicationException(string.Format("实体{0}未定义主键!", entity.EntityName));
            }
            return(field.FieldId);
        }
Ejemplo n.º 20
0
        public static SysField GetKeyField(this SysEntity entity, DataContext context)
        {
            string   key_name = entity.GetKeyFieldName();
            SysField field    = context.FirstOrDefault <SysField>(f => (f.EntityId == entity.EntityId) && (f.FieldName == key_name));

            if (field == null)
            {
                throw new ApplicationException(string.Format("没有找到主键字段:{0} -{1}", entity.EntityName, key_name));
            }
            return(field);
        }
Ejemplo n.º 21
0
        internal EntityData LoadWithEntity(SysEntity entity, int object_id)
        {
            EntityData data      = null;
            Type       tableType = TableCache.GetTableType(entity.EntityName);
            object     obj2      = this.context.FindById(tableType, new object[] { object_id });

            if (obj2 != null)
            {
                data = ObjectToEntityData(obj2, entity);
            }
            return(data);
        }
Ejemplo n.º 22
0
        public string GetObjectDisplayName(SysEntity entity, int object_id)
        {
            EntityData data = this.GetObject(entity, object_id);

            if (data != null)
            {
                string displayFieldName = entity.GetDisplayFieldName();
                if (data.ContainsKey(displayFieldName))
                {
                    return(Convert.ToString(data[displayFieldName]));
                }
            }
            return(null);
        }
        public override object GetValue(SysExpression expr, EntityCache cache, ExpressionCache expr_cache, SysProcessInstance pi, SysActivityInstance ai)
        {
            SysProcess process        = pi.Process;
            SysEntity  activityEntity = process.ActivityEntity;

            if (activityEntity == null)
            {
                throw new ApplicationException("活动实体为空");
            }
            SysOneMoreRelation relation = expr.Relation;

            if (relation == null)
            {
                throw new ApplicationException("表达式的关系为空");
            }
            if (!relation.ChildEntityId.HasValue)
            {
                throw new ApplicationException("表达式的子实体为空");
            }
            if (!process.ActivityEntityId.HasValue)
            {
                throw new ApplicationException("活动的实体为空");
            }
            if (expr.Relation.ChildEntityId.Value != process.ActivityEntityId.Value)
            {
                throw new ApplicationException("不正确的关系");
            }
            if (!relation.ParentEntityId.HasValue)
            {
                throw new ApplicationException("关系的父实体为空");
            }
            if (!relation.ChildFieldId.HasValue)
            {
                throw new ApplicationException("关系的ChildFieldId为空");
            }
            long local1 = relation.ChildFieldId.Value;

            if (relation.ChildField == null)
            {
                throw new ApplicationException("关系的对应字段为空");
            }
            int        activityInstanceId = ai.ActivityInstanceId;
            EntityData data         = cache.GetObject(activityEntity, activityInstanceId);
            SysEntity  parentEntity = relation.ParentEntity;
            int        num2         = Convert.ToInt32(data[relation.ChildField.FieldName]);
            object     obj2         = cache.GetObject(parentEntity, num2)[expr.Field.FieldName];

            expr_cache.Add(expr, obj2);
            return(obj2);
        }
Ejemplo n.º 24
0
        private string GetEntityName(object entityId)
        {
            string res = string.Empty;

            //using (BizDataContext contex = new BizDataContext())
            {
                //SysEntity entity = this.DataHelper.FindById<SysEntity>(entityId);
                SysEntity entity = this.EntityCache.FindById <SysEntity>(entityId);
                if (entity != null)
                {
                    res = entity.EntityName;
                }
            }
            return(res);
        }
Ejemplo n.º 25
0
        private string GetChangeFieldDisplayText(SysChangeLog log, SysChangeLogDetail logDetail)
        {
            string    result = string.Empty;
            SysEntity entity = this.EntityCache.SysEntity.FirstOrDefault(p => p.EntityName == log.EntityName);

            if (entity != null)
            {
                SysField field = entity.Fields.FirstOrDefault(p => p.FieldName == logDetail.FieldName);
                if (field != null)
                {
                    result = field.DisplayText;
                }
            }
            return(result);
        }
        private static void LoadEntitySchema()
        {
            EntityCacheBase cache = EntityCacheBase.LoadCache();

            using (List <SysEntity> .Enumerator enumerator = cache.SysEntity.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    Func <SysMobileStepEntity, bool> predicate = null;
                    SysEntity    e         = enumerator.Current;
                    EntitySchema es        = new EntitySchema();
                    bool?        isHistory = e.IsHistory;
                    es.IsHistory = isHistory.HasValue ? isHistory.GetValueOrDefault() : false;
                    SysOneMoreRelation relation = e.ChildOneMoreRelations.FirstOrDefault <SysOneMoreRelation>(p => p.Is_Tree == true);
                    if (relation != null)
                    {
                        es.TreeRelationFieldName = relation.ChildField.FieldName;
                    }
                    es.IsChangeTableVersion = false;
                    if (predicate == null)
                    {
                        predicate = delegate(SysMobileStepEntity p) {
                            long?entityId = p.EntityId;
                            long num      = e.EntityId;
                            return((entityId.GetValueOrDefault() == num) && entityId.HasValue);
                        };
                    }
                    if (cache.SysMobileStepEntity.Where <SysMobileStepEntity>(predicate).Count <SysMobileStepEntity>() > 0)
                    {
                        es.IsChangeTableVersion = true;
                    }
                    es.EntityId    = e.EntityId;
                    es.EntityName  = e.EntityName;
                    es.KeyName     = e.GetKeyFieldName();
                    es.EntityType  = cache.GetEntityType(e.EntityId);
                    es.DisplayName = e.GetDisplayFieldName();
                    int?privilegeMode = e.PrivilegeMode;
                    es.PrivilegeMode = privilegeMode.HasValue ? privilegeMode.GetValueOrDefault() : -2147483647;
                    privilegeMode    = e.RequiredLevel;
                    es.RequiredLevel = privilegeMode.HasValue ? privilegeMode.GetValueOrDefault() : -2147483647;
                    LoadUniqueKey(es, e, cache);
                    LoadFields(es, e, cache);
                    LoadRelations(es, e, cache);
                    Add(es);
                }
            }
        }
Ejemplo n.º 27
0
        public EntityData GetObject(SysEntity entity, int object_id)
        {
            long   entityId = entity.EntityId;
            string key      = this.GetKey(entityId, object_id);

            if (this._dict.ContainsKey(key))
            {
                return(this._dict[key]);
            }
            EntityData data = this.Load(entity, object_id);

            if (data != null)
            {
                this._dict.Add(key, data);
            }
            return(data);
        }
Ejemplo n.º 28
0
        public EntityData GetObjectFull(SysEntity entity, int object_id, ProcessInstanceCacheFactory piCacheFactory)
        {
            long   entityId = entity.EntityId;
            string key      = this.GetKey(entityId, object_id);

            if (this._dictFull.ContainsKey(key))
            {
                return(this._dictFull[key]);
            }
            EntityData data = this.LoadFull(entity, object_id, piCacheFactory);

            if (data != null)
            {
                this._dictFull.Add(key, data);
            }
            return(data);
        }
Ejemplo n.º 29
0
        /// <summary>
        /// 发布
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnPublish_Click(object sender, EventArgs e)
        {
            try
            {
                SysForm form = this.DataHelper.FindById <SysForm>(this.FormId);
                if (form != null)
                {
                    using (System.Transactions.TransactionScope ts = new System.Transactions.TransactionScope())
                    {
                        using (BizDataContext db = new BizDataContext())
                        {
                            //更新表单状态
                            form.State        = (int)FormState.StartUsed;
                            form.UpdateTime   = DateTime.Now;
                            form.UpdateUserId = this.LoginUserID;
                            db.UpdatePartial(form, p => new { p.State, p.UpdateUserId, p.UpdateTime });

                            //发布数据库
                            SysEntity entity = this.EntityCache.FindById <SysEntity>(this.EntityId);
                            if (entity == null) //新增加的实体
                            {
                                entity = db.FindById <SysEntity>(this.EntityId);
                                if (entity == null)
                                {
                                    throw new Exception("表单关联实体不存在");
                                }
                                entity.Fields = db.Where <SysField>(p => p.EntityId == entity.EntityId);

                                FormEntityPublishHelper publish = new FormEntityPublishHelper(entity, db);
                                publish.Publish();
                            }
                        }
                        ts.Complete();
                    }
                }
                else
                {
                    throw new Exception("表单不存在");
                }
                this.AjaxAlertAndRedirect("发布成功", "FormQuery.aspx");
            }
            catch (Exception ex)
            {
                this.AjaxAlertAndEnableButton(ex);
            }
        }
Ejemplo n.º 30
0
        /// <summary>
        /// 绑定现有字段
        /// </summary>
        private void BindSelectField()
        {
            List <EntityAndField> source = new List <EntityAndField>();
            SysEntity             entity = this.EntityCache.FindById <SysEntity>(this.EntityId);

            if (entity != null)
            {
                this.hc.Value = "Y"; //表示元数据实体,不能再新增字段
                source.Add(new EntityAndField()
                {
                    DisplayName = entity.DisplayText,
                    Fields      = entity.Fields.Where(p => //2013-9-18 zhumin 过滤不支持的字段类型
                                                      p.DataType != (int)DataTypeEnum.pkey &&
                                                      p.DataType != (int)DataTypeEnum.MultiRef &&
                                                      p.DataType != (int)DataTypeEnum.pbinary
                                                      ).OrderBy(p => p.FieldId).ToList()
                });

                //2013-9-18 zhumin 突然发现这里用不着关联实体的字段,至少这些字段是不可编辑的,暂时不支持
                //foreach (var relation in entity.ChildOneMoreRelations)
                //{
                //    source.Add(new EntityAndField()
                //    {
                //        DisplayName = string.Format("{0}=>{1}", entity.DisplayText, relation.ChildField.FieldName),
                //        RelationId = relation.RelationId,
                //        Fields = relation.ParentEntity.Fields.OrderBy(p => p.FieldId).ToList(),
                //    });
                //}
            }
            else
            {
                this.hc.Value = "N"; //表示上一步自定义实体,可以新增字段
                entity        = this.DataHelper.FindById <SysEntity>(this.EntityId);
                if (entity != null)
                {
                    source.Add(new EntityAndField()
                    {
                        DisplayName = entity.DisplayText,
                        Fields      = this.DataHelper.Set <SysField>().Where(p => p.EntityId == this.EntityId).OrderBy(p => p.FieldId).ToList(),
                    });
                }
            }
            this.rRelation.DataSource = source;
            this.rRelation.DataBind();
        }