예제 #1
0
        public DataListDefinition GetEntityListDefn(FieldDataSource source)
        {
            var defn = new DataListDefinition();
            var ds   = source;

            defn.DataSource = ds;

            var _Entity = Core.EntityMetaData.Get(ds.Entity);

            defn.ItemIdField   = "Id";
            defn.ItemViewField = _Entity.GetFieldSchema(_Entity.TextField).ViewName;

            defn.Layout   = PrepareLayout(defn, _Entity);
            defn.PageSize = 25;
            if (ds.Domain != null)
            {
                defn.FixedFilter = ds.Domain;
            }

            return(defn);
        }
예제 #2
0
        protected override void Init()
        {
            RelatedEntityId = RequestQuery.EntityId;
            var RefEntity = Core.EntityMetaData.Get(RelatedEntityId);

            Field = RefEntity.GetFieldSchema(RequestQuery.FieldName);
            FieldDataSource dataSource = null;

            if (Field == null)
            {
                var reqInfo = ListRequest.RequestInfo;
                if (reqInfo.Properties != null)
                {
                    var source = reqInfo.Properties.Get("PickerSource", "");
                    dataSource = Core.Datasource.SystemDataSource.GetPickerSource(source);
                }
            }
            else
            {
                dataSource = Field.ControlInfo.DataSource;
            }

            if (dataSource != null)
            {
                DataSource     = dataSource;
                SourceEntityId = dataSource.Entity;
            }
            else
            {
                throw new AppException("Datasource is not defined for this list.");
            }

            SetFormModelMapping(ListRequest.RequestInfo);

            base.Init();
        }
예제 #3
0
        public DataListDefinition GetListDefn(FieldDataSource pickerSource)
        {
            var defn = GetEntityListDefn(pickerSource);

            return(defn);
        }