示例#1
0
        public override ViewPage GetPage(RequestQueryString reqQuery)
        {
            int entityItemId = reqQuery.EntityId.Code;

            View.PageType     = AppPageType.AppStudio;
            View.CurrentQuery = reqQuery.ToQueryString();

            var formContext = new DetailFormContext(_appContext, EntityCode.EntityMaster, new RequestQueryString()
            {
                EntityId = EntityCode.EntityMaster, ItemId = entityItemId
            });

            formContext.Build();
            formContext.CreateDataModel();

            var entityMasterModel = formContext.EntityModel;

            View.PageTitle = new DynamicObj();
            View.PageTitle.Add("Title", entityMasterModel.GetValue <string>("text", ""));

            AddHeaderActions(reqQuery, entityItemId);

            AddFieldListField(formContext);
            AddLayoutListField(formContext);
            AddListListField(formContext);
            AddEntityActionsListField(formContext);

            return(this.View);
        }
示例#2
0
        public IActionResult Detail()
        {
            var context = new DetailFormContext(this.WebAppContext, this.RequestQuery.EntityId, this.RequestQuery);

            context.Build();

            var builder = new EntityPageBuilder();
            var page    = builder.CreateDetailPage(context);

            return(CreatePageResult(page));
        }
        protected void PrepareFields(DataListContext context, DataListDefinition defn)
        {
            var formContext = new DetailFormContext(context.Context, context.SourceEntityId, context.Context.RequestQuery);

            formContext.Build();
            //AddField(context, formContext, new TField { FieldId = context.IdColumn }, true);

            foreach (var lField in defn.Layout.GetLayoutFields())
            {
                AddField(context, formContext, lField);
            }
        }
示例#4
0
        private void AddListListField(DetailFormContext formContext)
        {
            var widgetContext = WidgetContext.BuildContext(formContext, "EntityListList");

            widgetContext.WidgetType = FormControlType.EntityListView;

            var widget = new EntityListWidget(widgetContext, "entitylists");

            widget.OnCompile();
            widget.SetValue(null);

            AddFieldsInRow(new ViewModel.FormWidget.IWidget[] { widget });
        }
示例#5
0
        public ViewPage CreateDetailPage(DetailFormContext context)
        {
            if (!context.Context.UserInfo.HasAccess(context.Entity.EntityId, AccessType.Read))
            {
                throw new AuthException("Operation not allowed.");
            }

            context.CreateDataModel();
            var lConext = new LayoutContext(context.Context, context.ItemTypeId, context.Entity.EntityId);

            lConext.Build();
            context.LayoutContext = lConext;

            var renderer = new DetailFormRenderer(context);

            renderer.Generate(lConext);

            return(renderer.GetViewPage());
        }
示例#6
0
 public DetailFormRenderer(DetailFormContext context) : base(context)
 {
 }