示例#1
0
        public IActionResult EntityList()
        {
            this.RequestQuery.EntityId = EntityCode.EntityMaster;
            var context = new DeskPageContext(this.WebAppContext, EntityCode.EntityMaster, this.RequestQuery);

            context.Build();

            var widgetContext = WidgetContext.BuildContext(context, "LayoutList");

            widgetContext.WidgetType = FormControlType.EntityListView;

            var widget = new ViewModel.FormWidget.EntityListWidget(widgetContext);

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

            var page = new ViewPage(context);

            page.Actions = new InvariantDictionary <Model.Form.ActionInfo>();
            var qs = new RequestQueryString()
            {
                EntityId = EntityCode.EntityMaster
            };

            page.Actions.Add("BTN_NEW", new Model.Form.ActionInfo(AppLinkProvider.NEW_ENTITY_URL, qs)
            {
                Title = "New Entity", LinkTarget = "POPUP"
            });

            return(CreatePageResult(page));
        }
        private IWidget AddFieldName(FormContext formContext, BaseField fieldInfo)
        {
            var widgetContext = WidgetContext.BuildContext(formContext, "Name");
            var label         = new LabelWidget(widgetContext);

            label.SetValue(fieldInfo.Text);

            return(label);
        }
示例#3
0
        private void AddField(EditFormContext formContext)
        {
            var widgetContext = WidgetContext.BuildContext(formContext, "NameX");

            widgetContext.WidgetType = FormControlType.TextBox;

            var widget = ViewModel.FormWidget.WidgetFactory.Create(widgetContext);

            widget.OnCompile();

            AddFieldsInRow(new ViewModel.FormWidget.IWidget[] { widget });
        }
示例#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 });
        }
        private void AddOperationField(FormContext formContext, BaseField fieldInfo, FilterExpField filterField = null)
        {
            var widgetContext = WidgetContext.BuildContext(formContext, "OP");

            widgetContext.WidgetType = FormControlType.Dropdown;

            DropdownWidget widget = (DropdownWidget)ViewModel.FormWidget.WidgetFactory.Create(widgetContext);

            widget.Options = GetOptions(fieldInfo.BaseType, fieldInfo.Type);
            widget.OnCompile();
            if (filterField != null)
            {
                widget.SetValue((int)filterField.Op);
            }

            formContext.AddControl(widget);
        }