public ObjectContainerDetailModel(DetailObjectModel model)
            : base(model)
        {
            fSrcModel = model;
            PageInfo info = model.CallerInfo.Info;

            Source = info.Source;
        }
Ejemplo n.º 2
0
        protected OutputData DoDetailAction(IInputData input)
        {
            DetailObjectModel model     = new DetailObjectModel();
            object            newObject = Source.Query(input, input.QueryString["Id"]);
            ObjectContainer   container = new ObjectContainer(newObject);

            model.Object = container;
            container.Decode(GetFields());
            MakeOperateRight(model, input);
            input.CallerInfo.AddInfo(model.CallerInfo);

            return(OutputData.CreateObject(model));
        }
Ejemplo n.º 3
0
        private void MakeOperateRight(DetailObjectModel model, IInputData input)
        {
            if (Operators == null)
            {
                return;
            }

            IEnumerable <Operator> listOpertors = null;
            var operateRight = Operators.Right.CreateObject();

            if (operateRight == null)
            {
                var allOpertors = Operators.Operators;
                if (allOpertors != null)
                {
                    listOpertors = from item in allOpertors
                                   select new Operator(item, this, input);
                }
            }
            else
            {
                var rights = operateRight.GetOperator(
                    new ObjectOperateRightEventArgs(input.Style, model.Object));
                var allOpertors = Operators.Operators;
                if (rights != null && allOpertors != null)
                {
                    listOpertors = from item in allOpertors
                                   join right in rights on item.Id equals right
                                   select new Operator(item, this, input);
                }
            }
            if (listOpertors != null)
            {
                model.DetailOperators = listOpertors;
            }
        }