示例#1
0
        private void BuildActions()
        {
            var actionContext = new ActionContext(FormContext, ActionType.Save, "BTN_SAVE");

            actionContext.Query = FormContext.RequestQuery.Clone();
            FormContext.Actions.Add(PageActionCreator.Create(actionContext));
        }
示例#2
0
        private void BuildActions()
        {
            var q = new RequestQueryString();

            q.EntityId = this.FormContext.Entity.EntityId;
            if (this.FormContext.Context.UserInfo.HasAccess(this.FormContext.Entity.EntityId, AccessType.Create))
            {
                var newAction = PageActionCreator.Create(new ActionContext(this.FormContext, ActionType.New, "NEW")
                {
                    Query = q
                });
                this.FormContext.Actions.Add(newAction);
            }
        }
示例#3
0
        protected override void CompileActions(TView view)
        {
            if (this.FormContext.Context.UserInfo.HasAccess(FormContext.Entity.EntityId, AccessType.Update))
            {
                var actionContext = new ActionContext(FormContext, ActionType.Edit, "BTN_EDIT");
                actionContext.Query = FormContext.RequestQuery.Clone();
                FormContext.Actions.Add(PageActionCreator.Create(actionContext));
            }

            if (view.Commands != null)
            {
                foreach (var command in view.Commands)
                {
                    var c = EntityActionService.GetViewAction(this.FormContext.Context, this.FormContext.Entity.EntityId, FormContext.EntityLayoutType, command.Id);
                    if (c != null)
                    {
                        this.FormContext.Actions.Add(PageActionCreator.BuildActionFromDefinition(c, this.FormContext));
                    }
                }
            }
        }